Serial macros cleanup

This commit is contained in:
Scott Lahteine
2021-02-28 19:43:46 -06:00
committed by Scott Lahteine
parent f0b662ff58
commit dd42831cba
48 changed files with 101 additions and 117 deletions

View File

@ -37,8 +37,6 @@ L64XX_Marlin L64xxManager;
#include "../../module/planner.h"
#include "../../HAL/shared/Delay.h"
void echo_yes_no(const bool yes) { serialprintPGM(yes ? PSTR(" YES") : PSTR(" NO ")); }
static const char str_X[] PROGMEM = "X ", str_Y[] PROGMEM = "Y ", str_Z[] PROGMEM = "Z ",
str_X2[] PROGMEM = "X2", str_Y2[] PROGMEM = "Y2",
str_Z2[] PROGMEM = "Z2", str_Z3[] PROGMEM = "Z3", str_Z4[] PROGMEM = "Z4",
@ -56,6 +54,8 @@ PGM_P const L64XX_Marlin::index_to_axis[] PROGMEM = {
#define DEBUG_OUT ENABLED(L6470_CHITCHAT)
#include "../../core/debug_out.h"
void echo_yes_no(const bool yes) { DEBUG_ECHOPGM_P(yes ? PSTR(" YES") : PSTR(" NO ")); UNUSED(yes); }
uint8_t L64XX_Marlin::dir_commands[MAX_L64XX]; // array to hold direction command for each driver
const uint8_t L64XX_Marlin::index_to_dir[MAX_L64XX] = {
@ -375,7 +375,7 @@ inline void echo_min_max(const char a, const float &min, const float &max) {
}
inline void echo_oct_used(const float &oct, const uint8_t stall) {
DEBUG_ECHOPAIR("over_current_threshold used : ", oct);
serialprintPGM(stall ? PSTR(" (Stall") : PSTR(" (OCD"));
DEBUG_ECHOPGM_P(stall ? PSTR(" (Stall") : PSTR(" (OCD"));
DEBUG_ECHOLNPGM(" threshold)");
}
inline void err_out_of_bounds() { DEBUG_ECHOLNPGM("Test aborted - motion out of bounds"); }
@ -652,7 +652,7 @@ void L64XX_Marlin::say_axis(const L64XX_axis_t axis, const uint8_t label/*=true*
) {
say_axis(axis);
DEBUG_ECHOPGM(" THERMAL: ");
serialprintPGM((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK "));
DEBUG_ECHOPGM_P((status & _status_axis_th_sd) ? PSTR("SHUTDOWN") : (status & _status_axis_th_wrn) ? PSTR("WARNING ") : PSTR("OK "));
DEBUG_ECHOPGM(" OVERCURRENT: ");
echo_yes_no((status & _status_axis_ocd) != 0);
if (!(_status_axis_layout == L6474_STATUS_LAYOUT)) { // L6474 doesn't have these bits

View File

@ -98,7 +98,7 @@ millis_t Stopwatch::duration() {
void Stopwatch::debug(const char func[]) {
if (DEBUGGING(INFO)) {
SERIAL_ECHOPGM("Stopwatch::");
serialprintPGM(func);
SERIAL_ECHOPGM_P(func);
SERIAL_ECHOLNPGM("()");
}
}

View File

@ -77,7 +77,7 @@ void vector_3::apply_rotation(const matrix_3x3 &matrix) {
}
void vector_3::debug(PGM_P const title) {
serialprintPGM(title);
SERIAL_ECHOPGM_P(title);
SERIAL_ECHOPAIR_F_P(SP_X_STR, x, 6);
SERIAL_ECHOPAIR_F_P(SP_Y_STR, y, 6);
SERIAL_ECHOLNPAIR_F_P(SP_Z_STR, z, 6);
@ -139,10 +139,7 @@ matrix_3x3 matrix_3x3::transpose(const matrix_3x3 &original) {
}
void matrix_3x3::debug(PGM_P const title) {
if (title) {
serialprintPGM(title);
SERIAL_EOL();
}
if (title) SERIAL_ECHOLNPGM_P(title);
LOOP_L_N(i, 3) {
LOOP_L_N(j, 3) {
if (vectors[i][j] >= 0.0) SERIAL_CHAR('+');