🎨 Fewer serial macros
This commit is contained in:
@@ -394,7 +394,7 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
|
||||
void Temperature::report_fan_speed(const uint8_t fan) {
|
||||
if (fan >= FAN_COUNT) return;
|
||||
PORT_REDIRECT(SerialMask::All);
|
||||
SERIAL_ECHOLNPAIR("M106 P", fan, " S", fan_speed[fan]);
|
||||
SERIAL_ECHOLNPGM("M106 P", fan, " S", fan_speed[fan]);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -676,7 +676,7 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
LIMIT(bias, 20, max_pow - 20);
|
||||
d = (bias > max_pow >> 1) ? max_pow - 1 - bias : bias;
|
||||
|
||||
SERIAL_ECHOPAIR(STR_BIAS, bias, STR_D_COLON, d, STR_T_MIN, minT, STR_T_MAX, maxT);
|
||||
SERIAL_ECHOPGM(STR_BIAS, bias, STR_D_COLON, d, STR_T_MIN, minT, STR_T_MAX, maxT);
|
||||
if (cycles > 2) {
|
||||
const float Ku = (4.0f * d) / (float(M_PI) * (maxT - minT) * 0.5f),
|
||||
Tu = float(t_low + t_high) * 0.001f,
|
||||
@@ -687,12 +687,12 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
tune_pid.Ki = tune_pid.Kp * 2.0f / Tu;
|
||||
tune_pid.Kd = tune_pid.Kp * Tu * df;
|
||||
|
||||
SERIAL_ECHOLNPAIR(STR_KU, Ku, STR_TU, Tu);
|
||||
SERIAL_ECHOLNPGM(STR_KU, Ku, STR_TU, Tu);
|
||||
if (ischamber || isbed)
|
||||
SERIAL_ECHOLNPGM(" No overshoot");
|
||||
else
|
||||
SERIAL_ECHOLNPGM(STR_CLASSIC_PID);
|
||||
SERIAL_ECHOLNPAIR(STR_KP, tune_pid.Kp, STR_KI, tune_pid.Ki, STR_KD, tune_pid.Kd);
|
||||
SERIAL_ECHOLNPGM(STR_KP, tune_pid.Kp, STR_KI, tune_pid.Ki, STR_KD, tune_pid.Kd);
|
||||
}
|
||||
}
|
||||
SHV((bias + d) >> 1);
|
||||
@@ -756,13 +756,13 @@ volatile bool Temperature::raw_temps_ready = false;
|
||||
|
||||
#if EITHER(PIDTEMPBED, PIDTEMPCHAMBER)
|
||||
PGM_P const estring = GHV(PSTR("chamber"), PSTR("bed"), NUL_STR);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPGM("Kp ", tune_pid.Kp);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPGM("Ki ", tune_pid.Ki);
|
||||
say_default_(); SERIAL_ECHOPGM_P(estring); SERIAL_ECHOLNPGM("Kd ", tune_pid.Kd);
|
||||
#else
|
||||
say_default_(); SERIAL_ECHOLNPAIR("Kp ", tune_pid.Kp);
|
||||
say_default_(); SERIAL_ECHOLNPAIR("Ki ", tune_pid.Ki);
|
||||
say_default_(); SERIAL_ECHOLNPAIR("Kd ", tune_pid.Kd);
|
||||
say_default_(); SERIAL_ECHOLNPGM("Kp ", tune_pid.Kp);
|
||||
say_default_(); SERIAL_ECHOLNPGM("Ki ", tune_pid.Ki);
|
||||
say_default_(); SERIAL_ECHOLNPGM("Kd ", tune_pid.Kd);
|
||||
#endif
|
||||
|
||||
auto _set_hotend_pid = [](const uint8_t e, const PID_t &in_pid) {
|
||||
@@ -996,7 +996,7 @@ void Temperature::_temp_error(const heater_id_t heater_id, PGM_P const serial_ms
|
||||
OPTCODE(HAS_TEMP_BED, case H_BED: SERIAL_ECHOPGM(STR_HEATER_BED); break)
|
||||
default:
|
||||
if (real_heater_id >= 0)
|
||||
SERIAL_ECHOLNPAIR("E", real_heater_id);
|
||||
SERIAL_ECHOLNPGM("E", real_heater_id);
|
||||
}
|
||||
SERIAL_EOL();
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@ void Temperature::manage_heater() {
|
||||
|
||||
void Temperature::M305_report(const uint8_t t_index, const bool forReplay/*=true*/) {
|
||||
gcode.report_heading_etc(forReplay, PSTR(STR_USER_THERMISTORS));
|
||||
SERIAL_ECHOPAIR(" M305 P", AS_DIGIT(t_index));
|
||||
SERIAL_ECHOPGM(" M305 P", AS_DIGIT(t_index));
|
||||
|
||||
const user_thermistor_t &t = user_thermistor[t_index];
|
||||
|
||||
@@ -2535,7 +2535,7 @@ void Temperature::init() {
|
||||
case H_CHAMBER: SERIAL_ECHOPGM("chamber"); break;
|
||||
default: SERIAL_ECHO(heater_id);
|
||||
}
|
||||
SERIAL_ECHOLNPAIR(
|
||||
SERIAL_ECHOLNPGM(
|
||||
" ; sizeof(running_temp):", sizeof(running_temp),
|
||||
" ; State:", state, " ; Timer:", timer, " ; Temperature:", current, " ; Target Temp:", target
|
||||
#if HEATER_IDLE_HANDLER
|
||||
@@ -2813,7 +2813,7 @@ void Temperature::disable_all_heaters() {
|
||||
SERIAL_ERROR_START();
|
||||
SERIAL_ECHOPGM("Temp measurement error! ");
|
||||
#if HAS_MAX31855
|
||||
SERIAL_ECHOPAIR("MAX31855 Fault: (", max_tc_temp & 0x7, ") >> ");
|
||||
SERIAL_ECHOPGM("MAX31855 Fault: (", max_tc_temp & 0x7, ") >> ");
|
||||
if (max_tc_temp & 0x1)
|
||||
SERIAL_ECHOLNPGM("Open Circuit");
|
||||
else if (max_tc_temp & 0x2)
|
||||
@@ -2825,7 +2825,7 @@ void Temperature::disable_all_heaters() {
|
||||
max865ref.clearFault();
|
||||
if (fault_31865) {
|
||||
SERIAL_EOL();
|
||||
SERIAL_ECHOLNPAIR("\nMAX31865 Fault: (", fault_31865, ") >>");
|
||||
SERIAL_ECHOLNPGM("\nMAX31865 Fault: (", fault_31865, ") >>");
|
||||
if (fault_31865 & MAX31865_FAULT_HIGHTHRESH)
|
||||
SERIAL_ECHOLNPGM("RTD High Threshold");
|
||||
if (fault_31865 & MAX31865_FAULT_LOWTHRESH)
|
||||
@@ -3543,7 +3543,7 @@ void Temperature::isr() {
|
||||
SERIAL_PRINT(t, SFP);
|
||||
#if ENABLED(SHOW_TEMP_ADC_VALUES)
|
||||
// Temperature MAX SPI boards do not have an OVERSAMPLENR defined
|
||||
SERIAL_ECHOPAIR(" (", TERN(HAS_MAXTC_LIBRARIES, k == 'T', false) ? r : r * RECIPROCAL(OVERSAMPLENR));
|
||||
SERIAL_ECHOPGM(" (", TERN(HAS_MAXTC_LIBRARIES, k == 'T', false) ? r : r * RECIPROCAL(OVERSAMPLENR));
|
||||
SERIAL_CHAR(')');
|
||||
#endif
|
||||
delay(2);
|
||||
@@ -3576,19 +3576,19 @@ void Temperature::isr() {
|
||||
#if HAS_MULTI_HOTEND
|
||||
HOTEND_LOOP() print_heater_state((heater_id_t)e, degHotend(e), degTargetHotend(e) OPTARG(SHOW_TEMP_ADC_VALUES, rawHotendTemp(e)));
|
||||
#endif
|
||||
SERIAL_ECHOPAIR(" @:", getHeaterPower((heater_id_t)target_extruder));
|
||||
SERIAL_ECHOPGM(" @:", getHeaterPower((heater_id_t)target_extruder));
|
||||
#if HAS_HEATED_BED
|
||||
SERIAL_ECHOPAIR(" B@:", getHeaterPower(H_BED));
|
||||
SERIAL_ECHOPGM(" B@:", getHeaterPower(H_BED));
|
||||
#endif
|
||||
#if HAS_HEATED_CHAMBER
|
||||
SERIAL_ECHOPAIR(" C@:", getHeaterPower(H_CHAMBER));
|
||||
SERIAL_ECHOPGM(" C@:", getHeaterPower(H_CHAMBER));
|
||||
#endif
|
||||
#if HAS_COOLER
|
||||
SERIAL_ECHOPAIR(" C@:", getHeaterPower(H_COOLER));
|
||||
SERIAL_ECHOPGM(" C@:", getHeaterPower(H_COOLER));
|
||||
#endif
|
||||
#if HAS_MULTI_HOTEND
|
||||
HOTEND_LOOP() {
|
||||
SERIAL_ECHOPAIR(" @", e);
|
||||
SERIAL_ECHOPGM(" @", e);
|
||||
SERIAL_CHAR(':');
|
||||
SERIAL_ECHO(getHeaterPower((heater_id_t)e));
|
||||
}
|
||||
@@ -3896,7 +3896,7 @@ void Temperature::isr() {
|
||||
const bool wants_to_cool = isProbeAboveTemp(target_temp),
|
||||
will_wait = !(wants_to_cool && no_wait_for_cooling);
|
||||
if (will_wait)
|
||||
SERIAL_ECHOLNPAIR("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees.");
|
||||
SERIAL_ECHOLNPGM("Waiting for probe to ", (wants_to_cool ? PSTR("cool down") : PSTR("heat up")), " to ", target_temp, " degrees.");
|
||||
|
||||
#if DISABLED(BUSY_WHILE_HEATING) && ENABLED(HOST_KEEPALIVE_FEATURE)
|
||||
KEEPALIVE_STATE(NOT_BUSY);
|
||||
|
||||
Reference in New Issue
Block a user