G-code queue singleton, front injection (#14236)
This commit is contained in:
@@ -107,15 +107,15 @@ void lcd_z_offset_edit_setup(const float &initial) {
|
||||
* UBL Build Custom Mesh Command
|
||||
*/
|
||||
void _lcd_ubl_build_custom_mesh() {
|
||||
char UBL_LCD_GCODE[20];
|
||||
enqueue_and_echo_commands_P(PSTR("G28"));
|
||||
char ubl_lcd_gcode[20];
|
||||
queue.inject_P(PSTR("G28"));
|
||||
#if HAS_HEATED_BED
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("M190 S%i"), custom_bed_temp);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("M190 S%i"), custom_bed_temp);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
#endif
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("M109 S%i"), custom_hotend_temp);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
enqueue_and_echo_commands_P(PSTR("G29 P1"));
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("M109 S%i"), custom_hotend_temp);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
queue.inject_P(PSTR("G29 P1"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -141,11 +141,11 @@ void _lcd_ubl_custom_mesh() {
|
||||
* UBL Adjust Mesh Height Command
|
||||
*/
|
||||
void _lcd_ubl_adjust_height_cmd() {
|
||||
char UBL_LCD_GCODE[16];
|
||||
char ubl_lcd_gcode[16];
|
||||
const int ind = ubl_height_amount > 0 ? 9 : 10;
|
||||
strcpy_P(UBL_LCD_GCODE, PSTR("G29 P6 C -"));
|
||||
sprintf_P(&UBL_LCD_GCODE[ind], PSTR(".%i"), ABS(ubl_height_amount));
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
strcpy_P(ubl_lcd_gcode, PSTR("G29 P6 C -"));
|
||||
sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount));
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +187,7 @@ void _lcd_ubl_edit_mesh() {
|
||||
* UBL Validate Custom Mesh Command
|
||||
*/
|
||||
void _lcd_ubl_validate_custom_mesh() {
|
||||
char UBL_LCD_GCODE[24];
|
||||
char ubl_lcd_gcode[24];
|
||||
const int temp =
|
||||
#if HAS_HEATED_BED
|
||||
custom_bed_temp
|
||||
@@ -195,9 +195,9 @@ void _lcd_ubl_validate_custom_mesh() {
|
||||
0
|
||||
#endif
|
||||
;
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp);
|
||||
lcd_enqueue_commands_P(PSTR("G28"));
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G26 C B%i H%i P"), temp, custom_hotend_temp);
|
||||
lcd_enqueue_one_now_P(PSTR("G28"));
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -228,9 +228,9 @@ void _lcd_ubl_validate_mesh() {
|
||||
* UBL Grid Leveling Command
|
||||
*/
|
||||
void _lcd_ubl_grid_level_cmd() {
|
||||
char UBL_LCD_GCODE[12];
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("G29 J%i"), side_points);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
char ubl_lcd_gcode[12];
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 J%i"), side_points);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -269,9 +269,9 @@ void _lcd_ubl_mesh_leveling() {
|
||||
* UBL Fill-in Amount Mesh Command
|
||||
*/
|
||||
void _lcd_ubl_fillin_amount_cmd() {
|
||||
char UBL_LCD_GCODE[18];
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("G29 P3 R C.%i"), ubl_fillin_amount);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
char ubl_lcd_gcode[18];
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 P3 R C.%i"), ubl_fillin_amount);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -361,22 +361,22 @@ void _lcd_ubl_build_mesh() {
|
||||
* UBL Load Mesh Command
|
||||
*/
|
||||
void _lcd_ubl_load_mesh_cmd() {
|
||||
char UBL_LCD_GCODE[25];
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("G29 L%i"), ubl_storage_slot);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
char ubl_lcd_gcode[25];
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 L%i"), ubl_storage_slot);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("M117 " MSG_MESH_LOADED), ubl_storage_slot);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
* UBL Save Mesh Command
|
||||
*/
|
||||
void _lcd_ubl_save_mesh_cmd() {
|
||||
char UBL_LCD_GCODE[25];
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("G29 S%i"), ubl_storage_slot);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
sprintf_P(UBL_LCD_GCODE, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
char ubl_lcd_gcode[25];
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("G29 S%i"), ubl_storage_slot);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
sprintf_P(ubl_lcd_gcode, PSTR("M117 " MSG_MESH_SAVED), ubl_storage_slot);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -420,11 +420,11 @@ void _lcd_ubl_map_homing() {
|
||||
* UBL LCD "radar" map point editing
|
||||
*/
|
||||
void _lcd_ubl_map_lcd_edit_cmd() {
|
||||
char UBL_LCD_GCODE[50], str[10], str2[10];
|
||||
char ubl_lcd_gcode[50], str[10], str2[10];
|
||||
dtostrf(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]), 0, 2, str);
|
||||
dtostrf(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]), 0, 2, str2);
|
||||
snprintf_P(UBL_LCD_GCODE, sizeof(UBL_LCD_GCODE), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts);
|
||||
lcd_enqueue_command(UBL_LCD_GCODE);
|
||||
snprintf_P(ubl_lcd_gcode, sizeof(ubl_lcd_gcode), PSTR("G29 P4 X%s Y%s R%i"), str, str2, n_edit_pts);
|
||||
lcd_enqueue_one_now(ubl_lcd_gcode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -529,7 +529,7 @@ void _lcd_ubl_output_map_lcd() {
|
||||
void _lcd_ubl_output_map_lcd_cmd() {
|
||||
if (!all_axes_known()) {
|
||||
set_all_unhomed();
|
||||
enqueue_and_echo_commands_P(PSTR("G28"));
|
||||
queue.inject_P(PSTR("G28"));
|
||||
}
|
||||
ui.goto_screen(_lcd_ubl_map_homing);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user