🎨 Apply F() to G-code suite and queue

This commit is contained in:
Scott Lahteine
2021-09-25 21:11:31 -05:00
committed by Scott Lahteine
parent 2b9ae0cc33
commit 46c53f6730
39 changed files with 136 additions and 134 deletions

View File

@ -2352,7 +2352,7 @@ void HMI_PauseOrStop() {
if (select_print.now == PRINT_PAUSE_RESUME) {
if (HMI_flag.select_flag) {
HMI_flag.pause_action = true;
queue.inject_P(PSTR("M25"));
queue.inject(F("M25"));
}
Goto_PrintProcess();
}
@ -2711,7 +2711,7 @@ void HMI_Prepare() {
#endif
break;
case PREPARE_CASE_DISA: queue.inject_P(PSTR("M84")); break;
case PREPARE_CASE_DISA: queue.inject(F("M84")); break;
case PREPARE_CASE_HOME: // Homing
checkkey = Last_Prepare;
@ -2729,7 +2729,7 @@ void HMI_Prepare() {
EncoderRate.enabled = true;
#else
// Apply workspace offset, making the current position 0,0,0
queue.inject_P(PSTR("G92 X0 Y0 Z0"));
queue.inject(F("G92 X0 Y0 Z0"));
HMI_AudioFeedback();
#endif
break;
@ -2944,7 +2944,7 @@ void HMI_Control() {
void HMI_Leveling() {
Popup_Window_Leveling();
DWIN_UpdateLCD();
queue.inject_P(PSTR("G28O\nG29"));
queue.inject(F("G28O\nG29"));
}
#endif
@ -3803,7 +3803,7 @@ void HMI_Tune() {
EncoderRate.enabled = true;
#else
// Apply workspace offset, making the current position 0,0,0
queue.inject_P(PSTR("G92 X0 Y0 Z0"));
queue.inject(F("G92 X0 Y0 Z0"));
HMI_AudioFeedback();
#endif
break;
@ -4112,7 +4112,7 @@ void EachMomentUpdate() {
TERN_(HAS_HEATED_BED, resume_bed_temp = thermalManager.degTargetBed());
thermalManager.disable_all_heaters();
#endif
queue.inject_P(PSTR("G1 F1200 X0 Y0"));
queue.inject(F("G1 F1200 X0 Y0"));
}
if (card.isPrinting() && checkkey == PrintProcess) { // print process
@ -4182,7 +4182,7 @@ void EachMomentUpdate() {
if (encoder_diffState == ENCODER_DIFF_ENTER) {
recovery_flag = false;
if (HMI_flag.select_flag) break;
TERN_(POWER_LOSS_RECOVERY, queue.inject_P(PSTR("M1000C")));
TERN_(POWER_LOSS_RECOVERY, queue.inject(F("M1000C")));
HMI_StartFrame(true);
return;
}
@ -4195,7 +4195,7 @@ void EachMomentUpdate() {
select_print.set(0);
HMI_ValueStruct.show_mode = 0;
queue.inject_P(PSTR("M1000"));
queue.inject(F("M1000"));
Goto_PrintProcess();
Draw_Status_Area(true);
}

View File

@ -1157,7 +1157,7 @@ void HMI_MainMenu() {
case PAGE_INFO_LEVELING:
#if HAS_ONESTEP_LEVELING
queue.inject_P(PSTR("G28XYO\nG28Z\nG29")); // TODO: 'G29' should be homing when needed. Does it make sense for every LCD to do this differently?
queue.inject(F("G28XYO\nG28Z\nG29")); // TODO: 'G29' should be homing when needed. Does it make sense for every LCD to do this differently?
#else
checkkey = Info;
Draw_Info_Menu();
@ -1376,7 +1376,7 @@ void HMI_PauseOrStop() {
if (HMI_flag.select_flag) {
HMI_flag.pause_action = true;
ICON_Resume();
queue.inject_P(PSTR("M25"));
queue.inject(F("M25"));
}
else {
// cancel pause
@ -1510,7 +1510,7 @@ void EachMomentUpdate() {
TERN_(HAS_FAN, resume_fan = thermalManager.fan_speed[0]);
#endif
IF_DISABLED(ADVANCED_PAUSE_FEATURE, thermalManager.disable_all_heaters());
IF_DISABLED(PARK_HEAD_ON_PAUSE, queue.inject_P(PSTR("G1 F1200 X0 Y0")));
IF_DISABLED(PARK_HEAD_ON_PAUSE, queue.inject(F("G1 F1200 X0 Y0")));
}
if (checkkey == PrintProcess) { // print process
@ -1588,7 +1588,7 @@ void EachMomentUpdate() {
if (encoder_diffState == ENCODER_DIFF_ENTER) {
recovery_flag = false;
if (HMI_flag.select_flag) break;
TERN_(POWER_LOSS_RECOVERY, queue.inject_P(PSTR("M1000C")));
TERN_(POWER_LOSS_RECOVERY, queue.inject(F("M1000C")));
return HMI_StartFrame(true);
}
else
@ -1600,7 +1600,7 @@ void EachMomentUpdate() {
}
select_print.set(PRINT_SETUP);
queue.inject_P(PSTR("M1000"));
queue.inject(F("M1000"));
sdprint = true;
Goto_PrintProcess();
Draw_Status_Area(true);
@ -2088,13 +2088,13 @@ void Goto_InfoMenu(){
Draw_Info_Menu();
}
void DisableMotors() { queue.inject_P(PSTR("M84")); }
void DisableMotors() { queue.inject(F("M84")); }
void AutoHome() { queue.inject_P(G28_STR); }
void SetHome() {
// Apply workspace offset, making the current position 0,0,0
queue.inject_P(PSTR("G92 X0 Y0 Z0"));
queue.inject(F("G92 X0 Y0 Z0"));
HMI_AudioFeedback();
}
@ -2241,7 +2241,7 @@ void Goto_LockScreen() { DWIN_LockScreen(true); }
void SetProbeOffsetZ() { SetPFloatOnClick(-10, 10, 2); }
void ProbeTest() {
ui.set_status_P(GET_TEXT(MSG_M48_TEST));
queue.inject_P(PSTR("G28O\nM48 P10"));
queue.inject(F("G28O\nM48 P10"));
}
#endif
@ -2321,23 +2321,23 @@ void SetSpeed() { SetPIntOnClick(MIN_PRINT_SPEED, MAX_PRINT_SPEED); }
void ChangeFilament() {
HMI_SaveProcessID(NothingToDo);
queue.inject_P(PSTR("M600 B2"));
queue.inject(F("M600 B2"));
}
void ParkHead(){
ui.set_status_P(GET_TEXT(MSG_FILAMENT_PARK_ENABLED));
queue.inject_P(PSTR("G28O\nG27"));
queue.inject(F("G28O\nG27"));
}
#if ENABLED(FILAMENT_LOAD_UNLOAD_GCODES)
void UnloadFilament(){
ui.set_status_P(GET_TEXT(MSG_FILAMENTUNLOAD));
queue.inject_P(PSTR("M702 Z20"));
queue.inject(F("M702 Z20"));
}
void LoadFilament(){
ui.set_status_P(GET_TEXT(MSG_FILAMENTLOAD));
queue.inject_P(PSTR("M701 Z20"));
queue.inject(F("M701 Z20"));
}
#endif
@ -2436,7 +2436,7 @@ void LevBedC () { LevBed(4); }
void ManualMeshSave(){
ui.set_status_P(GET_TEXT(MSG_UBL_STORAGE_MESH_MENU));
queue.inject_P(PSTR("M211 S1\nM500"));
queue.inject(F("M211 S1\nM500"));
}
#endif // MESH_BED_LEVELING

View File

@ -1055,7 +1055,7 @@ void CrealityDWINClass::Menu_Item_Handler(uint8_t menu, uint8_t item, bool draw/
if (draw)
Draw_Menu_Item(row, ICON_CloseMotor, F("Disable Stepper"));
else
queue.inject_P(PSTR("M84"));
queue.inject(F("M84"));
break;
case PREPARE_HOME:
if (draw)
@ -4499,7 +4499,7 @@ void CrealityDWINClass::Print_Screen_Control() {
#endif
TERN_(HAS_FAN, thermalManager.fan_speed[0] = pausefan);
planner.synchronize();
TERN_(SDSUPPORT, queue.inject_P(PSTR("M24")));
TERN_(SDSUPPORT, queue.inject(F("M24")));
#endif
}
else {
@ -4541,10 +4541,10 @@ void CrealityDWINClass::Popup_Control() {
if (IS_SD_PRINTING()) card.pauseSDPrint();
#endif
planner.synchronize();
queue.inject_P(PSTR("M125"));
queue.inject(F("M125"));
planner.synchronize();
#else
queue.inject_P(PSTR("M25"));
queue.inject(F("M25"));
TERN_(HAS_HOTEND, pausetemp = thermalManager.temp_hotend[0].target);
TERN_(HAS_HEATED_BED, pausebed = thermalManager.temp_bed.target);
TERN_(HAS_FAN, pausefan = thermalManager.fan_speed[0]);
@ -4574,9 +4574,9 @@ void CrealityDWINClass::Popup_Control() {
break;
case Resume:
if (selection == 0)
queue.inject_P(PSTR("M1000"));
queue.inject(F("M1000"));
else {
queue.inject_P(PSTR("M1000 C"));
queue.inject(F("M1000 C"));
Draw_Main_Menu();
}
break;
@ -5008,7 +5008,7 @@ void CrealityDWINClass::Load_Settings(const char *buff) {
static bool init = true;
if (init) {
init = false;
queue.inject_P(PSTR("M1000 S"));
queue.inject(F("M1000 S"));
}
#endif
}