Simplify stepper driver per-axis selection
This commit is contained in:
committed by
Scott Lahteine
parent
e5c0b490c8
commit
fbcdf5eaeb
57
Marlin/src/core/drivers.h
Normal file
57
Marlin/src/core/drivers.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define A4988 0x001
|
||||
#define DRV8825 0x002
|
||||
#define LV8729 0x003
|
||||
#define L6470 0x104
|
||||
#define TB6560 0x005
|
||||
#define TB6600 0x006
|
||||
#define TMC2100 0x007
|
||||
#define TMC2130 0x108
|
||||
#define TMC2130_STANDALONE 0x008
|
||||
#define TMC2208 0x109
|
||||
#define TMC2208_STANDALONE 0x009
|
||||
#define TMC26X 0x10A
|
||||
#define TMC26X_STANDALONE 0x00A
|
||||
#define TMC2660 0x10B
|
||||
#define TMC2660_STANDALONE 0x00B
|
||||
|
||||
#define AXIS_DRIVER_TYPE(A, T) ( defined(A##_DRIVER_TYPE) && (A##_DRIVER_TYPE == T) )
|
||||
|
||||
#define HAS_DRIVER(T) (AXIS_DRIVER_TYPE( X,T) || AXIS_DRIVER_TYPE(X2,T) || \
|
||||
AXIS_DRIVER_TYPE( Y,T) || AXIS_DRIVER_TYPE(Y2,T) || \
|
||||
AXIS_DRIVER_TYPE( Z,T) || AXIS_DRIVER_TYPE(Z2,T) || \
|
||||
AXIS_DRIVER_TYPE(E0,T) || \
|
||||
AXIS_DRIVER_TYPE(E1,T) || \
|
||||
AXIS_DRIVER_TYPE(E2,T) || \
|
||||
AXIS_DRIVER_TYPE(E3,T) || \
|
||||
AXIS_DRIVER_TYPE(E4,T) )
|
||||
|
||||
// Test for supported TMC drivers that require advanced configuration
|
||||
// Does not match standalone configurations
|
||||
#define HAS_TRINAMIC ( HAS_DRIVER(TMC2130) || HAS_DRIVER(TMC2208) || HAS_DRIVER(TMC2660) )
|
||||
|
||||
#define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A, TMC2130) || \
|
||||
AXIS_DRIVER_TYPE(A, TMC2208) || \
|
||||
AXIS_DRIVER_TYPE(A, TMC2660) )
|
@@ -20,8 +20,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MACROS_H
|
||||
#define MACROS_H
|
||||
#ifndef _CORE_MACROS_H_
|
||||
#define _CORE_MACROS_H_
|
||||
|
||||
#define NUM_AXIS 4
|
||||
#define ABCE 4
|
||||
@@ -270,4 +270,4 @@
|
||||
#define FMOD(x, y) fmodf(x, y)
|
||||
#define HYPOT(x,y) SQRT(HYPOT2(x,y))
|
||||
|
||||
#endif //__MACROS_H
|
||||
#endif // _CORE_MACROS_H_
|
||||
|
Reference in New Issue
Block a user