From c9aba688e3f3d95015d5d1a526c382b703353ddc Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Wed, 27 Dec 2023 16:37:34 +0100 Subject: [PATCH] Saving few bytes by removing spaces in `//action:` host commands. Thanks to @sarusani pointing out inconsistent documentation. Renaming `MSG_OCTOPRINT_*` to `MSG_HOST_ACTION_*` as it is used also with PrusaLink and other host printing solutions Fix rebase issues --- Firmware/Marlin_main.cpp | 4 ++-- Firmware/messages.cpp | 18 +++++++++--------- Firmware/messages.h | 18 +++++++++--------- Firmware/ultralcd.cpp | 16 ++++++++-------- Firmware/xyzcal.cpp | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index f5e2fd5a6..143942707 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -979,7 +979,7 @@ static void fw_crash_init() if(xfdump_check_state(&crash_reason)) { // always signal to the host that a dump is available for retrieval - puts_P(_N("// action:dump_available")); + puts_P(_N("//action:dump_available")); #ifdef EMERGENCY_DUMP if(crash_reason != dump_crash_reason::manual && @@ -6003,7 +6003,7 @@ Sigma_Exit: // but up to this point the printer has been waiting for the M79 from the host // Send action to the host, so the host can resume the print. It is up to the host // to resume the print correctly. - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_UVLO_RECOVERY_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_UVLO_RECOVERY_READY); } break; diff --git a/Firmware/messages.cpp b/Firmware/messages.cpp index 3f5056018..12b314392 100644 --- a/Firmware/messages.cpp +++ b/Firmware/messages.cpp @@ -228,15 +228,15 @@ const char MSG_ENDSTOP_OPEN[] PROGMEM_N1 = "open"; //// const char MSG_POWERUP[] PROGMEM_N1 = "PowerUp"; //// const char MSG_ERR_STOPPED[] PROGMEM_N1 = "Printer stopped due to errors. Supervision required."; //// const char MSG_ENDSTOP_HIT[] PROGMEM_N1 = "TRIGGERED"; //// -const char MSG_OCTOPRINT_ASK_PAUSE[] PROGMEM_N1 = "// action:pause"; //// -const char MSG_OCTOPRINT_PAUSED[] PROGMEM_N1 = "// action:paused"; //// -const char MSG_OCTOPRINT_ASK_RESUME[] PROGMEM_N1 = "// action:resume"; //// -const char MSG_OCTOPRINT_RESUMED[] PROGMEM_N1 = "// action:resumed"; //// -const char MSG_OCTOPRINT_CANCEL[] PROGMEM_N1 = "// action:cancel"; //// -const char MSG_OCTOPRINT_READY[] PROGMEM_N1 = "// action:ready"; //// -const char MSG_OCTOPRINT_NOT_READY[] PROGMEM_N1 = "// action:not_ready"; //// -const char MSG_OCTOPRINT_START[] PROGMEM_N1 = "// action:start"; //// -const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[] PROGMEM_N1 = "// action:uvlo_recovery_ready"; //// +const char MSG_HOST_ACTION_ASK_PAUSE[] PROGMEM_N1 = "//action:pause"; //// +const char MSG_HOST_ACTION_PAUSED[] PROGMEM_N1 = "//action:paused"; //// +const char MSG_HOST_ACTION_ASK_RESUME[] PROGMEM_N1 = "//action:resume"; //// +const char MSG_HOST_ACTION_RESUMED[] PROGMEM_N1 = "//action:resumed"; //// +const char MSG_HOST_ACTION_CANCEL[] PROGMEM_N1 = "//action:cancel"; //// +const char MSG_HOST_ACTION_READY[] PROGMEM_N1 = "//action:ready"; //// +const char MSG_HOST_ACTION_NOT_READY[] PROGMEM_N1 = "//action:not_ready"; //// +const char MSG_HOST_ACTION_START[] PROGMEM_N1 = "//action:start"; //// +const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[] PROGMEM_N1 = "//action:uvlo_recovery_ready"; //// #ifdef HOST_SHUTDOWN const char MSG_HOST_ACTION_SHUTDOWN[] PROGMEM_N1 = "//action:shutdown"; //// #endif //HOST_SHUTOWN diff --git a/Firmware/messages.h b/Firmware/messages.h index 76f4e507d..c9d7b74b1 100644 --- a/Firmware/messages.h +++ b/Firmware/messages.h @@ -232,15 +232,15 @@ extern const char MSG_ERR_STOPPED[]; extern const char MSG_ENDSTOP_HIT[]; extern const char MSG_EJECT_FROM_MMU[]; extern const char MSG_CUT_FILAMENT[]; -extern const char MSG_OCTOPRINT_ASK_PAUSE[]; -extern const char MSG_OCTOPRINT_PAUSED[]; -extern const char MSG_OCTOPRINT_ASK_RESUME[]; -extern const char MSG_OCTOPRINT_RESUMED[]; -extern const char MSG_OCTOPRINT_CANCEL[]; -extern const char MSG_OCTOPRINT_READY[]; -extern const char MSG_OCTOPRINT_NOT_READY[]; -extern const char MSG_OCTOPRINT_START[]; -extern const char MSG_OCTOPRINT_UVLO_RECOVERY_READY[]; +extern const char MSG_HOST_ACTION_ASK_PAUSE[]; +extern const char MSG_HOST_ACTION_PAUSED[]; +extern const char MSG_HOST_ACTION_ASK_RESUME[]; +extern const char MSG_HOST_ACTION_RESUMED[]; +extern const char MSG_HOST_ACTION_CANCEL[]; +extern const char MSG_HOST_ACTION_READY[]; +extern const char MSG_HOST_ACTION_NOT_READY[]; +extern const char MSG_HOST_ACTION_START[]; +extern const char MSG_HOST_ACTION_UVLO_RECOVERY_READY[]; #ifdef HOST_SHUTDOWN extern const char MSG_HOST_ACTION_SHUTDOWN[]; #endif //HOST_SHUTOWN diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index abfc3a97b..ed12ccc2d 100644 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -1033,7 +1033,7 @@ void lcd_pause_print() { stop_and_save_print_to_ram(0.0, -default_retraction); - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_PAUSED); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_PAUSED); // Indicate that the printer is paused did_pause_print = true; @@ -1048,7 +1048,7 @@ void lcd_pause_print() //! @brief Send host action "pause" void lcd_pause_usb_print() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_ASK_PAUSE); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_PAUSE); } static void lcd_move_menu_axis(); @@ -5033,7 +5033,7 @@ void lcd_resume_print() if (print_job_timer.isPaused()) print_job_timer.start(); refresh_cmd_timeout(); - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_RESUMED); //resume octoprint + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_RESUMED); custom_message_type = CustomMsg::Status; } @@ -5044,7 +5044,7 @@ void lcd_resume_usb_print() if (!resume_print_checks()) return; // resume the usb host - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_ASK_RESUME); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_ASK_RESUME); } static void change_sheet() @@ -5151,10 +5151,10 @@ static void lcd_sheet_menu() static void lcd_printer_ready_state_toggle() { if (GetPrinterState() == PrinterState::IsReady) { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_NOT_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_NOT_READY); } else { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_READY); + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_READY); } } @@ -5714,7 +5714,7 @@ void print_stop(bool interactive) card.sdprinting = false; card.closefile(); } else { - SERIAL_ECHOLNRPGM(MSG_OCTOPRINT_CANCEL); // for Octoprint + SERIAL_ECHOLNRPGM(MSG_HOST_ACTION_CANCEL); } #ifdef MESH_BED_LEVELING @@ -7510,6 +7510,6 @@ void lcd_reprint_from_eeprom() { //! @brief Send host action "start" void lcd_send_action_start() { - SERIAL_PROTOCOLLNRPGM(MSG_OCTOPRINT_START); + SERIAL_PROTOCOLLNRPGM(MSG_HOST_ACTION_START); lcd_return_to_status(); } diff --git a/Firmware/xyzcal.cpp b/Firmware/xyzcal.cpp index 96130d2c9..12c0f67b4 100644 --- a/Firmware/xyzcal.cpp +++ b/Firmware/xyzcal.cpp @@ -568,7 +568,7 @@ void __attribute__((noinline)) xyzcal_scan_pixels_32x32_Zhop(int16_t cx, int16_t xyzcal_lineXYZ_to((d & 1) ? (cx + 992) : (cx - 992), cy - 992 + r * 64, _Z, delay_us, 0); sm4_set_dir(X_AXIS, d); //@size=242 - DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep OctoPrint connection alive + DBG(_n("%d\n"), 64 - (r * 2 + d)); ///< to keep host connection alive lcd_set_cursor(4,3); lcd_printf_P(PSTR("Countdown: %d "),64 - (r * 2 + d)); ////MSG_COUNTDOWN c=12