🎨 Fewer serial macros

This commit is contained in:
Scott Lahteine
2021-09-09 04:57:05 -05:00
committed by Scott Lahteine
parent 6d96c221bd
commit b661795ae5
159 changed files with 1002 additions and 1014 deletions

View File

@ -388,10 +388,10 @@ void L64XX_Marlin::set_param(const L64XX_axis_t axis, const uint8_t param, const
inline void echo_min_max(const char a, const_float_t min, const_float_t max) {
DEBUG_CHAR(' '); DEBUG_CHAR(a);
DEBUG_ECHOLNPAIR(" min = ", min, " max = ", max);
DEBUG_ECHOLNPGM(" min = ", min, " max = ", max);
}
inline void echo_oct_used(const_float_t oct, const uint8_t stall) {
DEBUG_ECHOPAIR("over_current_threshold used : ", oct);
DEBUG_ECHOPGM("over_current_threshold used : ", oct);
DEBUG_ECHOPGM_P(stall ? PSTR(" (Stall") : PSTR(" (OCD"));
DEBUG_ECHOLNPGM(" threshold)");
}
@ -568,7 +568,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
}
DEBUG_ECHOPGM("Monitoring:");
for (j = 0; j < driver_count; j++) DEBUG_ECHOPAIR(" ", axis_mon[j]);
for (j = 0; j < driver_count; j++) DEBUG_ECHOPGM(" ", axis_mon[j]);
DEBUG_EOL();
// now have a list of driver(s) to monitor
@ -589,19 +589,19 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
}
// only print the tval from one of the drivers
kval_hold = get_param(axis_index[0], L6474_TVAL);
DEBUG_ECHOLNPAIR("TVAL current (mA) = ", (kval_hold + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV);
DEBUG_ECHOLNPGM("TVAL current (mA) = ", (kval_hold + 1) * sh.AXIS_STALL_CURRENT_CONSTANT_INV);
}
else {
kval_hold = parser.byteval('K');
if (kval_hold) {
DEBUG_ECHOLNPAIR("kval_hold = ", kval_hold);
DEBUG_ECHOLNPGM("kval_hold = ", kval_hold);
for (j = 0; j < driver_count; j++)
set_param(axis_index[j], L6470_KVAL_HOLD, kval_hold);
}
else {
// only print the KVAL_HOLD from one of the drivers
kval_hold = get_param(axis_index[0], L6470_KVAL_HOLD);
DEBUG_ECHOLNPAIR("KVAL_HOLD = ", kval_hold);
DEBUG_ECHOLNPGM("KVAL_HOLD = ", kval_hold);
}
}
@ -629,7 +629,7 @@ uint8_t L64XX_Marlin::get_user_input(uint8_t &driver_count, L64XX_axis_t axis_in
OCD_TH_actual = (OCD_TH_val_local + 1) * 375;
}
DEBUG_ECHOLNPAIR("over_current_threshold specified: ", over_current_threshold);
DEBUG_ECHOLNPGM("over_current_threshold specified: ", over_current_threshold);
if (!(sh.STATUS_AXIS_LAYOUT == L6474_STATUS_LAYOUT)) echo_oct_used((STALL_TH_val_local + 1) * 31.25, true);
echo_oct_used((OCD_TH_val_local + 1) * 375, false);

View File

@ -177,14 +177,14 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) {
#ifdef MAX31865_DEBUG_SPI
#ifndef LARGE_PINMAP
SERIAL_ECHOLNPAIR(
SERIAL_ECHOLNPGM(
"Regular begin call with _cs: ", _cs,
" _miso: ", _miso,
" _sclk: ", _sclk,
" _mosi: ", _mosi
);
#else
SERIAL_ECHOLNPAIR(
SERIAL_ECHOLNPGM(
"LARGE_PINMAP begin call with _cs: ", _cs,
" _miso: ", _miso,
" _sclk: ", _sclk,
@ -192,7 +192,7 @@ void MAX31865::begin(max31865_numwires_t wires, float zero, float ref) {
);
#endif // LARGE_PINMAP
SERIAL_ECHOLNPAIR("config: ", readRegister8(MAX31856_CONFIG_REG));
SERIAL_ECHOLNPGM("config: ", readRegister8(MAX31856_CONFIG_REG));
SERIAL_EOL();
#endif // MAX31865_DEBUG_SPI
}
@ -290,7 +290,7 @@ uint16_t MAX31865::readRaw() {
uint16_t rtd = readRegister16(MAX31856_RTDMSB_REG);
#ifdef MAX31865_DEBUG
SERIAL_ECHOLNPAIR("RTD MSB:", (rtd >> 8), " RTD LSB:", (rtd & 0x00FF));
SERIAL_ECHOLNPGM("RTD MSB:", (rtd >> 8), " RTD LSB:", (rtd & 0x00FF));
#endif
// Disable the bias to lower power dissipation between reads.
@ -437,7 +437,7 @@ void MAX31865::readRegisterN(uint8_t addr, uint8_t buffer[], uint8_t n) {
while (n--) {
buffer[0] = spixfer(0xFF);
#ifdef MAX31865_DEBUG_SPI
SERIAL_ECHOLNPAIR("buffer read ", n, " data: ", buffer[0]);
SERIAL_ECHOLNPGM("buffer read ", n, " data: ", buffer[0]);
#endif
buffer++;
}

View File

@ -120,11 +120,11 @@ public:
static void report(const uint8_t index) {
if (index < Cfg::SIZE) {
SERIAL_ECHOPAIR("bresenham ", index, " : (", dividend[index], "/", divisor, ") ");
SERIAL_ECHOPGM("bresenham ", index, " : (", dividend[index], "/", divisor, ") ");
if (counter[index] >= 0) SERIAL_CHAR(' ');
if (labs(counter[index]) < 100) { SERIAL_CHAR(' '); if (labs(counter[index]) < 10) SERIAL_CHAR(' '); }
SERIAL_ECHO(counter[index]);
SERIAL_ECHOLNPAIR(" ... ", value[index]);
SERIAL_ECHOLNPGM(" ... ", value[index]);
}
}