🎨 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

@@ -178,9 +178,9 @@ bool UIFlashStorage::is_present = false;
if (!is_known) {
SERIAL_ECHO_MSG("Unable to locate supported SPI Flash Memory.");
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Manufacturer ID, got: ", manufacturer_id);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Device Type , got: ", device_type);
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR(" Capacity , got: ", capacity);
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Manufacturer ID, got: ", manufacturer_id);
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Device Type , got: ", device_type);
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM(" Capacity , got: ", capacity);
}
return is_known;
@@ -247,7 +247,7 @@ bool UIFlashStorage::is_present = false;
case 0xFFFFFFFFul: return read_offset;
case delimiter: read_offset = offset; break;
default:
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Invalid delimiter in Flash: ", delim);
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Invalid delimiter in Flash: ", delim);
return -1;
}
}
@@ -325,7 +325,7 @@ bool UIFlashStorage::is_present = false;
}
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Writing UI settings to SPI Flash (offset ", write_addr);
SERIAL_ECHOPGM("Writing UI settings to SPI Flash (offset ", write_addr);
SERIAL_ECHOPGM(")...");
const uint32_t delim = delimiter;
@@ -509,7 +509,7 @@ bool UIFlashStorage::is_present = false;
bytes_remaining = get_media_file_size(slot);
if (bytes_remaining != 0xFFFFFFFFUL) {
SERIAL_ECHO_START(); SERIAL_ECHOLNPAIR("Boot media file size:", bytes_remaining);
SERIAL_ECHO_START(); SERIAL_ECHOLNPGM("Boot media file size:", bytes_remaining);
addr = get_media_file_start(slot);
return true;
}

View File

@@ -131,7 +131,7 @@ namespace ExtUI {
#if HAS_PID_HEATING
void onPidTuning(const result_t rst) {
// Called for temperature PID tuning result
//SERIAL_ECHOLNPAIR("OnPidTuning:", rst);
//SERIAL_ECHOLNPGM("OnPidTuning:", rst);
switch (rst) {
case PID_STARTED:
StatusScreen::setStatusMessage(GET_TEXT_F(MSG_PID_AUTOTUNE));

View File

@@ -1025,8 +1025,8 @@ template <class T> bool CLCD::CommandFifo::write(T data, uint16_t len) {
if (Command_Space < (len + padding)) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Waiting for ", len + padding);
SERIAL_ECHOLNPAIR(" bytes in command queue, now free: ", Command_Space);
SERIAL_ECHOPGM("Waiting for ", len + padding);
SERIAL_ECHOLNPGM(" bytes in command queue, now free: ", Command_Space);
#endif
do {
Command_Space = mem_read_32(REG::CMDB_SPACE) & 0x0FFF;

View File

@@ -199,7 +199,7 @@
#define _NUM_ARGS(_,Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,OUT,...) OUT
#define NUM_ARGS(V...) _NUM_ARGS(0,V,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
// SERIAL_ECHOPAIR / SERIAL_ECHOPAIR_P is used to output a key value pair. The key must be a string and the value can be anything
// SERIAL_ECHOPGM / SERIAL_ECHOPGM_P is used to output a key value pair. The key must be a string and the value can be anything
// Print up to 12 pairs of values. Odd elements auto-wrapped in PSTR().
#define __SEP_N(N,V...) _SEP_##N(V)
#define _SEP_N(N,V...) __SEP_N(N,V)
@@ -218,9 +218,9 @@
#define SERIAL_ECHO_START()
#define SERIAL_ECHOLNPGM(str) Serial.println(F(str))
#define SERIAL_ECHOPGM(str) Serial.print(F(str))
#define SERIAL_ECHO_MSG(V...) SERIAL_ECHOLNPAIR(V)
#define SERIAL_ECHOLNPAIR(V...) _SELP_N(NUM_ARGS(V),V)
#define SERIAL_ECHOPAIR(str, val) do{ Serial.print(F(str)); Serial.print(val); }while(0)
#define SERIAL_ECHO_MSG(V...) SERIAL_ECHOLNPGM(V)
#define SERIAL_ECHOLNPGM(V...) _SELP_N(NUM_ARGS(V),V)
#define SERIAL_ECHOPGM(str, val) do{ Serial.print(F(str)); Serial.print(val); }while(0)
#define safe_delay delay

View File

@@ -132,8 +132,8 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) {
// Not enough memory to cache the display list.
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size);
SERIAL_ECHOLNPAIR(" Required: ", dl_size);
SERIAL_ECHOPGM ("Not enough space in GRAM to cache display list, free space: ", dl_slot_size);
SERIAL_ECHOLNPGM(" Required: ", dl_size);
#endif
dl_slot_used = 0;
save_slot();
@@ -142,8 +142,8 @@ bool DLCache::store(uint32_t min_bytes /* = 0*/) {
else {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR ("Saving DL to RAMG cache, bytes: ", dl_slot_used);
SERIAL_ECHOLNPAIR(" Free space: ", dl_slot_size);
SERIAL_ECHOPGM ("Saving DL to RAMG cache, bytes: ", dl_slot_used);
SERIAL_ECHOLNPGM(" Free space: ", dl_slot_size);
#endif
dl_slot_used = dl_size;
save_slot();
@@ -172,8 +172,8 @@ void DLCache::append() {
cmd.execute();
wait_until_idle();
SERIAL_ECHO_START();
SERIAL_ECHOPAIR ("Appending to DL from RAMG cache, bytes: ", dl_slot_used);
SERIAL_ECHOLNPAIR(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
SERIAL_ECHOPGM ("Appending to DL from RAMG cache, bytes: ", dl_slot_used);
SERIAL_ECHOLNPGM(" REG_CMD_DL: ", CLCD::mem_read_32(REG::CMD_DL));
#endif
}

View File

@@ -33,7 +33,7 @@ uint8_t ScreenRef::lookupScreen(onRedraw_func_t onRedraw_ptr) {
}
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOPAIR("Screen not found: ", (uintptr_t) onRedraw_ptr);
SERIAL_ECHOPGM("Screen not found: ", (uintptr_t) onRedraw_ptr);
#endif
return 0xFF;
}

View File

@@ -237,7 +237,7 @@ class CachedScreen {
cmd.cmd(CMD_SWAP);
cmd.execute();
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHOLNPAIR("Time to draw screen (ms): ", millis() - start_time);
SERIAL_ECHOLNPGM("Time to draw screen (ms): ", millis() - start_time);
#endif
}
};