Save some string flash

This commit is contained in:
Scott Lahteine
2019-11-01 23:51:25 -05:00
parent 23d21dd81c
commit ca6d00b862
18 changed files with 47 additions and 32 deletions

View File

@ -108,7 +108,7 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) {
SERIAL_ECHO(temp_buf);
SERIAL_ECHOPGM(" Motor Status: ");
const char * const stat_str;
const char *stat_str;
switch (motor_status) {
default:
case 0: stat_str = PSTR("stopped"); break;
@ -124,7 +124,7 @@ void L6470_report_current(L6470 &motor, const uint8_t axis) {
SERIAL_ECHOPGM(" Vs_compensation: ");
serialprintPGM((motor.GetParam(L6470_CONFIG) & CONFIG_EN_VSCOMP) ? PSTR("ENABLED ") : PSTR("DISABLED"));
SERIAL_ECHOLNPGM(" Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr));
SERIAL_ECHOLNPAIR(" Compensation coefficient: ", dtostrf(comp_coef * 0.01f, 7, 2, numstr));
SERIAL_ECHOPAIR("...KVAL_HOLD: ", motor.GetParam(L6470_KVAL_HOLD));
SERIAL_ECHOPAIR(" KVAL_RUN : ", motor.GetParam(L6470_KVAL_RUN));
SERIAL_ECHOPAIR(" KVAL_ACC: ", motor.GetParam(L6470_KVAL_ACC));

View File

@ -36,11 +36,11 @@ static void jiggle_axis(const char axis_char, const float &min, const float &max
char gcode_string[30], str1[11], str2[11];
// Turn the motor(s) both directions
sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(rate, 1, 3, str2));
process_subcommands_now(gcode_string);
sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(min, 1, 3, str1), dtostrf(fr_mm_m, 1, 3, str2));
gcode.process_subcommands_now(gcode_string);
sprintf_P(gcode_string, PSTR("G0 %c%s F%s"), axis_char, dtostrf(max, 1, 3, str1), str2);
process_subcommands_now(gcode_string);
gcode.process_subcommands_now(gcode_string);
planner.synchronize();
}

View File

@ -340,7 +340,10 @@ public:
static void process_subcommands_now_P(PGM_P pgcode);
static void process_subcommands_now(char * gcode);
static inline void home_all_axes() { process_subcommands_now_P(PSTR("G28")); }
static inline void home_all_axes() {
extern const char G28_STR[];
process_subcommands_now_P(G28_STR);
}
#if ENABLED(HOST_KEEPALIVE_FEATURE)
/**