Skip to content

Commit

Permalink
Saving few bytes by removing spaces in //action: host commands. Tha…
Browse files Browse the repository at this point in the history
…nks 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
  • Loading branch information
3d-gussner committed Dec 27, 2023
1 parent 95c342c commit 3973310
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,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 &&
Expand Down Expand Up @@ -5998,7 +5998,7 @@ SERIAL_PROTOCOLPGM("\n\n");
// 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;
Expand Down
18 changes: 9 additions & 9 deletions Firmware/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,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"; ////
const char MSG_FANCHECK_HOTEND[] PROGMEM_N1 = "Err:HOTEND FAN ERROR"; ////c=20
const char MSG_FANCHECK_PRINT[] PROGMEM_N1 = "Err:PRINT FAN ERROR"; ////c=20
const char MSG_M112_KILL[] PROGMEM_N1 = "M112 called. Emergency Stop."; ////c=20
Expand Down
18 changes: 9 additions & 9 deletions Firmware/messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,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[];
extern const char MSG_FANCHECK_HOTEND[];
extern const char MSG_FANCHECK_PRINT[];
extern const char MSG_M112_KILL[];
Expand Down
16 changes: 8 additions & 8 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,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);

print_job_timer.pause();

Expand All @@ -1032,7 +1032,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();
Expand Down Expand Up @@ -5012,7 +5012,7 @@ void lcd_resume_print()
restore_print_from_ram_and_continue(default_retraction);
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;
}

Expand All @@ -5023,7 +5023,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()
Expand Down Expand Up @@ -5130,10 +5130,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);
}
}

Expand Down Expand Up @@ -5680,7 +5680,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
Expand Down Expand Up @@ -7507,6 +7507,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();
}
2 changes: 1 addition & 1 deletion Firmware/xyzcal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3973310

Please sign in to comment.