Move stepper macros from config.h(.dist) to dda.c, as they're not
meant to be configured by the user.
This commit is contained in:
parent
f799228a8e
commit
4bddf3452f
|
|
@ -183,57 +183,6 @@ firmware build options
|
|||
#define UM_PER_STEP_Z ((uint32_t) ((1000.0 / STEPS_PER_MM_Z) + 0.5))
|
||||
#define UM_PER_STEP_E ((uint32_t) ((1000.0 / STEPS_PER_MM_E) + 0.5))
|
||||
|
||||
|
||||
/*
|
||||
X Stepper
|
||||
*/
|
||||
|
||||
#define _x_step(st) WRITE(X_STEP_PIN, st)
|
||||
#define x_step() _x_step(1);
|
||||
#define x_direction(dir) WRITE(X_DIR_PIN, dir)
|
||||
#define x_min() READ(X_MIN_PIN)
|
||||
#ifdef X_MAX_PIN
|
||||
#define x_max() READ(X_MAX_PIN)
|
||||
#else
|
||||
#define x_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Y Stepper
|
||||
*/
|
||||
|
||||
#define _y_step(st) WRITE(Y_STEP_PIN, st)
|
||||
#define y_step() _y_step(1);
|
||||
#define y_direction(dir) WRITE(Y_DIR_PIN, dir)
|
||||
#define y_min() READ(Y_MIN_PIN)
|
||||
#ifdef Y_MAX_PIN
|
||||
#define y_max() READ(Y_MAX_PIN)
|
||||
#else
|
||||
#define y_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Z Stepper
|
||||
*/
|
||||
|
||||
#define _z_step(st) WRITE(Z_STEP_PIN, st)
|
||||
#define z_step() _z_step(1);
|
||||
#define z_direction(dir) WRITE(Z_DIR_PIN, dir)
|
||||
#define z_min() READ(Z_MIN_PIN)
|
||||
#ifdef Z_MAX_PIN
|
||||
#define z_max() READ(Z_MAX_PIN)
|
||||
#else
|
||||
#define z_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Extruder
|
||||
*/
|
||||
|
||||
#define _e_step(st) WRITE(E_STEP_PIN, st)
|
||||
#define e_step() _e_step(1);
|
||||
#define e_direction(dir) WRITE(E_DIR_PIN, dir)
|
||||
|
||||
/*
|
||||
Heater
|
||||
*/
|
||||
|
|
@ -279,11 +228,4 @@ firmware build options
|
|||
#define power_off() if (0) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
End Step - All Steppers
|
||||
(so we don't have to delay in interrupt context)
|
||||
*/
|
||||
|
||||
#define unstep() do { _x_step(0); _y_step(0); _z_step(0); _e_step(0); } while (0)
|
||||
|
||||
#endif /* _CONFIG_H */
|
||||
|
|
|
|||
61
dda.c
61
dda.c
|
|
@ -10,6 +10,67 @@
|
|||
#include "debug.h"
|
||||
#include "sersendf.h"
|
||||
|
||||
/*
|
||||
X Stepper
|
||||
*/
|
||||
|
||||
#define _x_step(st) WRITE(X_STEP_PIN, st)
|
||||
#define x_step() _x_step(1);
|
||||
#define x_direction(dir) WRITE(X_DIR_PIN, dir)
|
||||
#define x_min() READ(X_MIN_PIN)
|
||||
#ifdef X_MAX_PIN
|
||||
#define x_max() READ(X_MAX_PIN)
|
||||
#else
|
||||
#define x_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Y Stepper
|
||||
*/
|
||||
|
||||
#define _y_step(st) WRITE(Y_STEP_PIN, st)
|
||||
#define y_step() _y_step(1);
|
||||
#define y_direction(dir) WRITE(Y_DIR_PIN, dir)
|
||||
#define y_min() READ(Y_MIN_PIN)
|
||||
#ifdef Y_MAX_PIN
|
||||
#define y_max() READ(Y_MAX_PIN)
|
||||
#else
|
||||
#define y_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Z Stepper
|
||||
*/
|
||||
|
||||
#define _z_step(st) WRITE(Z_STEP_PIN, st)
|
||||
#define z_step() _z_step(1);
|
||||
#define z_direction(dir) WRITE(Z_DIR_PIN, dir)
|
||||
#define z_min() READ(Z_MIN_PIN)
|
||||
#ifdef Z_MAX_PIN
|
||||
#define z_max() READ(Z_MAX_PIN)
|
||||
#else
|
||||
#define z_max() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Extruder
|
||||
*/
|
||||
|
||||
#define _e_step(st) WRITE(E_STEP_PIN, st)
|
||||
#define e_step() _e_step(1);
|
||||
#define e_direction(dir) WRITE(E_DIR_PIN, dir)
|
||||
|
||||
/*
|
||||
End Step - All Steppers
|
||||
(so we don't have to delay in interrupt context)
|
||||
*/
|
||||
|
||||
#define unstep() do { _x_step(0); _y_step(0); _z_step(0); _e_step(0); } while (0)
|
||||
|
||||
/*
|
||||
Maths
|
||||
*/
|
||||
|
||||
#ifndef ABS
|
||||
#define ABS(v) (((v) >= 0)?(v):(-(v)))
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue