🎨 Apply F() to G-code suite and queue
This commit is contained in:
committed by
Scott Lahteine
parent
2b9ae0cc33
commit
46c53f6730
@ -557,7 +557,7 @@ void menu_advanced_settings() {
|
||||
//
|
||||
// Set Home Offsets
|
||||
//
|
||||
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject_P(PSTR("M428")); ui.return_to_status(); });
|
||||
ACTION_ITEM(MSG_SET_HOME_OFFSETS, []{ queue.inject(F("M428")); ui.return_to_status(); });
|
||||
#endif
|
||||
|
||||
// M203 / M205 - Feedrate items
|
||||
|
@ -212,7 +212,7 @@ static void _lcd_level_bed_corners_get_next_position() {
|
||||
void _lcd_draw_level_prompt() {
|
||||
if (!ui.should_draw()) return;
|
||||
MenuItem_confirm::confirm_screen(
|
||||
[]{ queue.inject_P(TERN(HAS_LEVELING, PSTR("G29N"), G28_STR)); ui.return_to_status(); }
|
||||
[]{ queue.inject(TERN(HAS_LEVELING, F("G29N"), FPSTR(G28_STR))); ui.return_to_status(); }
|
||||
, []{ ui.goto_previous_screen_no_defer(); }
|
||||
, GET_TEXT(MSG_BED_TRAMMING_IN_RANGE)
|
||||
, (const char*)nullptr, PSTR("?")
|
||||
|
@ -103,9 +103,9 @@
|
||||
ui.wait_for_move = true;
|
||||
ui.goto_screen(_lcd_level_bed_done);
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
queue.inject_P(PSTR("G29S2"));
|
||||
queue.inject(F("G29S2"));
|
||||
#elif ENABLED(PROBE_MANUALLY)
|
||||
queue.inject_P(PSTR("G29V1"));
|
||||
queue.inject(F("G29V1"));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@ -155,9 +155,9 @@
|
||||
// G29 Records Z, moves, and signals when it pauses
|
||||
ui.wait_for_move = true;
|
||||
#if ENABLED(MESH_BED_LEVELING)
|
||||
queue.inject_P(manual_probe_index ? PSTR("G29S2") : PSTR("G29S1"));
|
||||
queue.inject(manual_probe_index ? F("G29S2") : F("G29S1"));
|
||||
#elif ENABLED(PROBE_MANUALLY)
|
||||
queue.inject_P(PSTR("G29V1"));
|
||||
queue.inject(F("G29V1"));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -341,8 +341,8 @@ void menu_advanced_settings();
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_CONFIG)
|
||||
|
||||
void _lcd_custom_menus_configuration_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
void _lcd_custom_menus_configuration_gcode(FSTR_P const fstr) {
|
||||
queue.inject(fstr);
|
||||
TERN_(CUSTOM_MENU_CONFIG_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback());
|
||||
TERN_(CUSTOM_MENU_CONFIG_SCRIPT_RETURN, ui.return_to_status());
|
||||
}
|
||||
@ -358,7 +358,7 @@ void menu_advanced_settings();
|
||||
#else
|
||||
#define _DONE_SCRIPT ""
|
||||
#endif
|
||||
#define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(PSTR(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define GCODE_LAMBDA_CONF(N) []{ _lcd_custom_menus_configuration_gcode(F(CONFIG_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_CONF(N) ACTION_ITEM_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_CONF(N));
|
||||
#define _CUSTOM_ITEM_CONF_CONFIRM(N) \
|
||||
SUBMENU_P(PSTR(CONFIG_MENU_ITEM_##N##_DESC), []{ \
|
||||
|
@ -209,7 +209,7 @@ void menu_change_filament() {
|
||||
#else
|
||||
|
||||
if (thermalManager.targetHotEnoughToExtrude(active_extruder))
|
||||
queue.inject_P(PSTR("M600B0"));
|
||||
queue.inject(F("M600B0"));
|
||||
else
|
||||
ui.goto_screen([]{ _menu_temp_filament_op(PAUSE_MODE_CHANGE_FILAMENT, 0); });
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#include "menu.h"
|
||||
#include "../marlinui.h"
|
||||
#include "../../gcode/queue.h" // for inject_P
|
||||
#include "../../gcode/queue.h" // for inject
|
||||
|
||||
#include "../../inc/MarlinConfigPre.h"
|
||||
|
||||
@ -64,8 +64,8 @@ class MenuItem_gcode : public MenuItem_button {
|
||||
FORCE_INLINE static void draw(const bool sel, const uint8_t row, PGM_P const pstr, ...) {
|
||||
_draw(sel, row, pstr, '>', ' ');
|
||||
}
|
||||
static void action(PGM_P const, PGM_P const pgcode) { queue.inject_P(pgcode); }
|
||||
static inline void action(PGM_P const pstr, const uint8_t, const char * const pgcode) { action(pstr, pgcode); }
|
||||
static void action(PGM_P const, PGM_P const pgcode) { queue.inject(FPSTR(pgcode)); }
|
||||
static inline void action(PGM_P const pstr, const uint8_t, PGM_P const pgcode) { action(pstr, pgcode); }
|
||||
};
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
static void lcd_power_loss_recovery_resume() {
|
||||
ui.return_to_status();
|
||||
queue.inject_P(PSTR("M1000"));
|
||||
queue.inject(F("M1000"));
|
||||
}
|
||||
|
||||
void lcd_power_loss_recovery_cancel() {
|
||||
|
@ -106,8 +106,8 @@ void menu_configuration();
|
||||
|
||||
#if ENABLED(CUSTOM_MENU_MAIN)
|
||||
|
||||
void _lcd_custom_menu_main_gcode(PGM_P const cmd) {
|
||||
queue.inject_P(cmd);
|
||||
void _lcd_custom_menu_main_gcode(FSTR_P const fstr) {
|
||||
queue.inject(fstr);
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_AUDIBLE_FEEDBACK, ui.completion_feedback());
|
||||
TERN_(CUSTOM_MENU_MAIN_SCRIPT_RETURN, ui.return_to_status());
|
||||
}
|
||||
@ -123,7 +123,7 @@ void menu_configuration();
|
||||
#else
|
||||
#define _DONE_SCRIPT ""
|
||||
#endif
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(PSTR(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define GCODE_LAMBDA_MAIN(N) []{ _lcd_custom_menu_main_gcode(F(MAIN_MENU_ITEM_##N##_GCODE _DONE_SCRIPT)); }
|
||||
#define _CUSTOM_ITEM_MAIN(N) ACTION_ITEM_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), GCODE_LAMBDA_MAIN(N));
|
||||
#define _CUSTOM_ITEM_MAIN_CONFIRM(N) \
|
||||
SUBMENU_P(PSTR(MAIN_MENU_ITEM_##N##_DESC), []{ \
|
||||
|
@ -111,7 +111,7 @@ void probe_offset_wizard_menu() {
|
||||
// If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z
|
||||
#if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z)
|
||||
set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction
|
||||
queue.inject_P(PSTR("G28Z"));
|
||||
queue.inject(F("G28Z"));
|
||||
#else // Otherwise do a Z clearance move like after Homing
|
||||
z_clearance_move();
|
||||
#endif
|
||||
|
@ -96,7 +96,7 @@ void goto_tramming_wizard() {
|
||||
|
||||
// Inject G28, wait for homing to complete,
|
||||
set_all_unhomed();
|
||||
queue.inject_P(TERN(CAN_SET_LEVELING_AFTER_G28, PSTR("G28L0"), G28_STR));
|
||||
queue.inject(TERN(CAN_SET_LEVELING_AFTER_G28, F("G28L0"), FPSTR(G28_STR)));
|
||||
|
||||
ui.goto_screen([]{
|
||||
_lcd_draw_homing();
|
||||
|
Reference in New Issue
Block a user