Use serial shorthand

This commit is contained in:
Scott Lahteine
2021-02-04 23:22:42 -06:00
parent 49564e5310
commit 708ea3d0bb
21 changed files with 88 additions and 132 deletions

View File

@ -552,10 +552,8 @@ void AnycubicTFTClass::GetCommandFromTFT() {
a_command = ((int)((strtod(&TFTcmdbuffer[TFTbufindw][TFTstrchr_pointer - TFTcmdbuffer[TFTbufindw] + 1], nullptr))));
#if ENABLED(ANYCUBIC_LCD_DEBUG)
if ((a_command > 7) && (a_command != 20)) { // No debugging of status polls, please!
SERIAL_ECHOPGM("TFT Serial Command: ");
SERIAL_ECHOLN(TFTcmdbuffer[TFTbufindw]);
}
if ((a_command > 7) && (a_command != 20)) // No debugging of status polls, please!
SERIAL_ECHOLNPAIR("TFT Serial Command: ", TFTcmdbuffer[TFTbufindw]);
#endif
switch (a_command) {

View File

@ -1074,7 +1074,7 @@ void CLCD::init() {
uint8_t device_id = mem_read_8(REG::ID); // Read Device ID, Should Be 0x7C;
if (device_id == 0x7C) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_MSG("FTDI chip initialized ");
SERIAL_ECHO_MSG("FTDI chip initialized");
#endif
break;
}
@ -1082,11 +1082,10 @@ void CLCD::init() {
delay(1);
if (counter == 249) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("Timeout waiting for device ID, should be 124, got ", device_id);
#endif
}
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_MSG("Timeout waiting for device ID, should be 124, got ", int(device_id));
#endif
}
}
/* make sure that all units are in working conditions, usually the touch-controller needs a little more time */
@ -1101,10 +1100,8 @@ void CLCD::init() {
else
delay(1);
if (ENABLED(TOUCH_UI_DEBUG) && counter == 99) {
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("Timeout waiting for reset status. Should be 0x00, got ", reset_status);
}
if (ENABLED(TOUCH_UI_DEBUG) && counter == 99)
SERIAL_ECHO_MSG("Timeout waiting for reset status. Should be 0x00, got ", int(reset_status));
}
mem_write_8(REG::PWM_DUTY, 0); // turn off Backlight, Frequency already is set to 250Hz default

View File

@ -124,8 +124,7 @@ namespace FTDI {
case UNPRESSED:
if (tag != 0) {
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("Touch start: ", tag);
SERIAL_ECHO_MSG("Touch start: ", int(tag));
#endif
pressed_tag = tag;
@ -186,8 +185,7 @@ namespace FTDI {
if (UIData::flags.bits.touch_end_sound) sound.play(unpress_sound);
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("Touch end: ", pressed_tag);
SERIAL_ECHO_MSG("Touch end: ", int(pressed_tag));
#endif
const uint8_t saved_pressed_tag = pressed_tag;

View File

@ -43,8 +43,7 @@ void ScreenRef::setScreen(onRedraw_func_t onRedraw_ptr) {
if (type != 0xFF) {
setType(type);
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("New screen: ", type);
SERIAL_ECHO_MSG("New screen: ", int(type));
#endif
}
}

View File

@ -127,8 +127,7 @@ void BioPrintingDialogBox::setStatusMessage(const char* message) {
storeBackground();
#if ENABLED(TOUCH_UI_DEBUG)
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR("New status message: ", message);
SERIAL_ECHO_MSG("New status message: ", message);
#endif
if (AT_SCREEN(BioPrintingDialogBox))