Merge pull request #9974 from thinkyhead/bf2_tmc_util_progmem

[2.0.x] Move tmc_util.* extended_axis_codes to PROGMEM
This commit is contained in:
Scott Lahteine
2018-03-07 00:16:50 -06:00
committed by GitHub
24 changed files with 138 additions and 132 deletions

View File

@ -43,7 +43,7 @@
constexpr uint8_t _7P_STEP = 1, // 7-point step - to change number of calibration points
_4P_STEP = _7P_STEP * 2, // 4-point step
NPP = _7P_STEP * 6; // number of calibration points on the radius
enum CalEnum { // the 7 main calibration points - add definitions if needed
enum CalEnum : char { // the 7 main calibration points - add definitions if needed
CEN = 0,
__A = 1,
_AB = __A + _7P_STEP,

View File

@ -37,8 +37,8 @@ void GcodeSuite::M906() {
LOOP_XYZE(i) values[i] = parser.intval(axis_codes[i]);
#define TMC_SET_GET_CURRENT(P,Q) do { \
if (values[P##_AXIS]) tmc_set_current(stepper##Q, extended_axis_codes[TMC_##Q], values[P##_AXIS]); \
else tmc_get_current(stepper##Q, extended_axis_codes[TMC_##Q]); } while(0)
if (values[P##_AXIS]) tmc_set_current(stepper##Q, TMC_##Q, values[P##_AXIS]); \
else tmc_get_current(stepper##Q, TMC_##Q); } while(0)
#if X_IS_TRINAMIC
TMC_SET_GET_CURRENT(X,X);

View File

@ -36,16 +36,16 @@
*/
void GcodeSuite::M911() {
#if ENABLED(X_IS_TMC2130) || (ENABLED(X_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX)) || ENABLED(IS_TRAMS)
tmc_report_otpw(stepperX, extended_axis_codes[TMC_X]);
tmc_report_otpw(stepperX, TMC_X);
#endif
#if ENABLED(Y_IS_TMC2130) || (ENABLED(Y_IS_TMC2208) && PIN_EXISTS(Y_SERIAL_RX)) || ENABLED(IS_TRAMS)
tmc_report_otpw(stepperY, extended_axis_codes[TMC_Y]);
tmc_report_otpw(stepperY, TMC_Y);
#endif
#if ENABLED(Z_IS_TMC2130) || (ENABLED(Z_IS_TMC2208) && PIN_EXISTS(Z_SERIAL_RX)) || ENABLED(IS_TRAMS)
tmc_report_otpw(stepperZ, extended_axis_codes[TMC_Z]);
tmc_report_otpw(stepperZ, TMC_Z);
#endif
#if ENABLED(E0_IS_TMC2130) || (ENABLED(E0_IS_TMC2208) && PIN_EXISTS(E0_SERIAL_RX)) || ENABLED(IS_TRAMS)
tmc_report_otpw(stepperE0, extended_axis_codes[TMC_E0]);
tmc_report_otpw(stepperE0, TMC_E0);
#endif
}
@ -56,22 +56,22 @@ void GcodeSuite::M912() {
const bool clearX = parser.seen(axis_codes[X_AXIS]), clearY = parser.seen(axis_codes[Y_AXIS]), clearZ = parser.seen(axis_codes[Z_AXIS]), clearE = parser.seen(axis_codes[E_AXIS]),
clearAll = (!clearX && !clearY && !clearZ && !clearE) || (clearX && clearY && clearZ && clearE);
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS) || (ENABLED(X_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX))
if (clearX || clearAll) tmc_clear_otpw(stepperX, extended_axis_codes[TMC_X]);
if (clearX || clearAll) tmc_clear_otpw(stepperX, TMC_X);
#endif
#if ENABLED(X2_IS_TMC2130) || (ENABLED(X2_IS_TMC2208) && PIN_EXISTS(X_SERIAL_RX))
if (clearX || clearAll) tmc_clear_otpw(stepperX, extended_axis_codes[TMC_X]);
if (clearX || clearAll) tmc_clear_otpw(stepperX, TMC_X);
#endif
#if ENABLED(Y_IS_TMC2130) || (ENABLED(Y_IS_TMC2208) && PIN_EXISTS(Y_SERIAL_RX))
if (clearY || clearAll) tmc_clear_otpw(stepperY, extended_axis_codes[TMC_Y]);
if (clearY || clearAll) tmc_clear_otpw(stepperY, TMC_Y);
#endif
#if ENABLED(Z_IS_TMC2130) || (ENABLED(Z_IS_TMC2208) && PIN_EXISTS(Z_SERIAL_RX))
if (clearZ || clearAll) tmc_clear_otpw(stepperZ, extended_axis_codes[TMC_Z]);
if (clearZ || clearAll) tmc_clear_otpw(stepperZ, TMC_Z);
#endif
#if ENABLED(E0_IS_TMC2130) || (ENABLED(E0_IS_TMC2208) && PIN_EXISTS(E0_SERIAL_RX))
if (clearE || clearAll) tmc_clear_otpw(stepperE0, extended_axis_codes[TMC_E0]);
if (clearE || clearAll) tmc_clear_otpw(stepperE0, TMC_E0);
#endif
}
@ -84,8 +84,8 @@ void GcodeSuite::M912() {
LOOP_XYZE(i) values[i] = parser.intval(axis_codes[i]);
#define TMC_SET_GET_PWMTHRS(P,Q) do { \
if (values[P##_AXIS]) tmc_set_pwmthrs(stepper##Q, extended_axis_codes[TMC_##Q], values[P##_AXIS], planner.axis_steps_per_mm[P##_AXIS]); \
else tmc_get_pwmthrs(stepper##Q, extended_axis_codes[TMC_##Q], planner.axis_steps_per_mm[P##_AXIS]); } while(0)
if (values[P##_AXIS]) tmc_set_pwmthrs(stepper##Q, TMC_##Q, values[P##_AXIS], planner.axis_steps_per_mm[P##_AXIS]); \
else tmc_get_pwmthrs(stepper##Q, TMC_##Q, planner.axis_steps_per_mm[P##_AXIS]); } while(0)
#if X_IS_TRINAMIC
TMC_SET_GET_PWMTHRS(X,X);
@ -129,8 +129,8 @@ void GcodeSuite::M912() {
#if ENABLED(SENSORLESS_HOMING)
void GcodeSuite::M914() {
#define TMC_SET_GET_SGT(P,Q) do { \
if (parser.seen(axis_codes[P##_AXIS])) tmc_set_sgt(stepper##Q, extended_axis_codes[TMC_##Q], parser.value_int()); \
else tmc_get_sgt(stepper##Q, extended_axis_codes[TMC_##Q]); } while(0)
if (parser.seen(axis_codes[P##_AXIS])) tmc_set_sgt(stepper##Q, TMC_##Q, parser.value_int()); \
else tmc_get_sgt(stepper##Q, TMC_##Q); } while(0)
#ifdef X_HOMING_SENSITIVITY
#if ENABLED(X_IS_TMC2130) || ENABLED(IS_TRAMS)

View File

@ -267,7 +267,7 @@ public:
* Workspace planes only apply to G2/G3 moves
* (and "canned cycles" - not a current feature)
*/
enum WorkspacePlane { PLANE_XY, PLANE_ZX, PLANE_YZ };
enum WorkspacePlane : char { PLANE_XY, PLANE_ZX, PLANE_YZ };
static WorkspacePlane workspace_plane;
#endif
@ -304,7 +304,7 @@ public:
* States for managing Marlin and host communication
* Marlin sends messages if blocked or busy
*/
enum MarlinBusyState {
enum MarlinBusyState : char {
NOT_BUSY, // Not in a handler
IN_HANDLER, // Processing a GCode
IN_PROCESS, // Known to be blocking command input (as in G29)