Fix: Unsupported use of %f in printf (#21001)

This commit is contained in:
MKS-Sean 2021-02-08 10:36:57 +08:00 committed by GitHub
parent 6dcb77f7b5
commit 57e4b82b66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 137 additions and 95 deletions

View file

@ -109,15 +109,15 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
void lv_draw_acceleration_settings() { void lv_draw_acceleration_settings() {
scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle); scr = lv_screen_create(ACCELERATION_UI, machine_menu.AccelerationConfTitle);
char str_1[16];
if (!uiCfg.para_ui_page) { if (!uiCfg.para_ui_page) {
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.acceleration); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.acceleration, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_PRINT, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.PrintAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_ACCE_PRINT, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.retract_acceleration); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.retract_acceleration, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_RETRA, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.RetractAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_ACCE_RETRA, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.travel_acceleration); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.travel_acceleration, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.TravelAcceleration, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_ACCE_TRAVEL, 2, public_buf_l);
sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); sprintf_P(public_buf_l, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]);

View file

@ -65,15 +65,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
} }
void lv_draw_auto_level_offset_settings() { void lv_draw_auto_level_offset_settings() {
char str_1[16];
scr = lv_screen_create(NOZZLE_PROBE_OFFSET_UI, machine_menu.OffsetConfTitle); scr = lv_screen_create(NOZZLE_PROBE_OFFSET_UI, machine_menu.OffsetConfTitle);
sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.x, 0)); sprintf_P(public_buf_l, PSTR("%s"), TERN(HAS_PROBE_XY_OFFSET, dtostrf(probe.offset.x, 1, 1, str_1) , 0));
lv_screen_menu_item_1_edit(scr, machine_menu.Xoffset, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_OFFSET_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Xoffset, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_OFFSET_X, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), TERN(HAS_PROBE_XY_OFFSET, probe.offset.y, 0)); sprintf_P(public_buf_l, PSTR("%s"), TERN(HAS_PROBE_XY_OFFSET, dtostrf(probe.offset.y, 1, 1, str_1) , 0));
lv_screen_menu_item_1_edit(scr, machine_menu.Yoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_OFFSET_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Yoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_OFFSET_Y, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), probe.offset.z); sprintf_P(public_buf_l, PSTR("%s"), TERN(HAS_PROBE_XY_OFFSET, dtostrf(probe.offset.z, 1, 1, str_1) , 0));
lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Zoffset, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_OFFSET_Z, 2, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_OFFSET_RETURN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_OFFSET_RETURN, true);

View file

@ -60,34 +60,35 @@ static uint8_t has_adjust_z = 0;
static void event_handler(lv_obj_t *obj, lv_event_t event) { static void event_handler(lv_obj_t *obj, lv_event_t event) {
if (event != LV_EVENT_RELEASED) return; if (event != LV_EVENT_RELEASED) return;
char baby_buf[30] = { 0 }; char baby_buf[30] = { 0 };
char str_1[16];
switch (obj->mks_obj_id) { switch (obj->mks_obj_id) {
case ID_BABY_STEP_X_P: case ID_BABY_STEP_X_P:
sprintf_P(baby_buf, PSTR("M290 X%.3f"), babystep_dist); sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
case ID_BABY_STEP_X_N: case ID_BABY_STEP_X_N:
sprintf_P(baby_buf, PSTR("M290 X%.3f"), -babystep_dist); sprintf_P(baby_buf, PSTR("M290 X%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
case ID_BABY_STEP_Y_P: case ID_BABY_STEP_Y_P:
sprintf_P(baby_buf, PSTR("M290 Y%.3f"), babystep_dist); sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
case ID_BABY_STEP_Y_N: case ID_BABY_STEP_Y_N:
sprintf_P(baby_buf, PSTR("M290 Y%.3f"), -babystep_dist); sprintf_P(baby_buf, PSTR("M290 Y%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
case ID_BABY_STEP_Z_P: case ID_BABY_STEP_Z_P:
sprintf_P(baby_buf, PSTR("M290 Z%.3f"), babystep_dist); sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
case ID_BABY_STEP_Z_N: case ID_BABY_STEP_Z_N:
sprintf_P(baby_buf, PSTR("M290 Z%.3f"), -babystep_dist); sprintf_P(baby_buf, PSTR("M290 Z%s"), dtostrf(-babystep_dist, 1, 3, str_1));
gcode.process_subcommands_now_P(PSTR(baby_buf)); gcode.process_subcommands_now_P(PSTR(baby_buf));
has_adjust_z = 1; has_adjust_z = 1;
break; break;
@ -161,7 +162,12 @@ void disp_baby_step_dist() {
void disp_z_offset_value() { void disp_z_offset_value() {
char buf[20]; char buf[20];
sprintf_P(buf, PSTR("offset Z: %.3f"), (float)TERN(HAS_BED_PROBE, probe.offset.z, 0)); #if HAS_BED_PROBE
char str_1[16];
sprintf_P(buf, PSTR("Offset Z: %s mm"), dtostrf(probe.offset.z, 1, 3, str_1));
#else
strcpy_P(buf, PSTR("Offset Z: 0 mm"));
#endif
lv_label_set_text(zOffsetText, buf); lv_label_set_text(zOffsetText, buf);
} }

View file

@ -71,18 +71,19 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
} }
void lv_draw_jerk_settings() { void lv_draw_jerk_settings() {
char str_1[16];
scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle); scr = lv_screen_create(JERK_UI, machine_menu.JerkConfTitle);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[X_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.max_jerk[X_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.X_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_JERK_X, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.max_jerk[Y_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Y_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_JERK_Y, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.max_jerk[Z_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Z_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_JERK_Z, 2, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.max_jerk[E_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.max_jerk[E_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E_Jerk, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_JERK_E, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_JERK_RETURN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_JERK_RETURN, true);

View file

@ -80,25 +80,26 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
} }
void lv_draw_max_feedrate_settings() { void lv_draw_max_feedrate_settings() {
char str_1[16];
scr = lv_screen_create(MAXFEEDRATE_UI, machine_menu.MaxFeedRateConfTitle); scr = lv_screen_create(MAXFEEDRATE_UI, machine_menu.MaxFeedRateConfTitle);
if (!uiCfg.para_ui_page) { if (!uiCfg.para_ui_page) {
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[X_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.XMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.XMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_X, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[Y_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.YMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FEED_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.YMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_FEED_Y, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[Z_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.ZMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_FEED_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.ZMaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_FEED_Z, 2, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[E_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E0MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_FEED_E0, 3, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E0MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_FEED_E0, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_DOWN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_DOWN, true);
} }
else { else {
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E1MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_E1, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E1MaxFeedRate, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_FEED_E1, 0, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_UP, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_FEED_UP, true);

View file

@ -52,6 +52,7 @@ enum {
}; };
static void event_handler(lv_obj_t *obj, lv_event_t event) { static void event_handler(lv_obj_t *obj, lv_event_t event) {
char str_1[16];
if (event != LV_EVENT_RELEASED) return; if (event != LV_EVENT_RELEASED) return;
if (queue.length <= (BUFSIZE - 3)) { if (queue.length <= (BUFSIZE - 3)) {
bool do_inject = true; bool do_inject = true;
@ -63,7 +64,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
default: do_inject = false; default: do_inject = false;
} }
if (do_inject) { if (do_inject) {
sprintf_P(public_buf_l, PSTR("G91\nG1 %c%3.1f F%d\nG90"), cur_label, dist, uiCfg.moveSpeed); sprintf_P(public_buf_l, PSTR("G91\nG1 %c%s F%d\nG90"), cur_label, dtostrf(dist, 1, 3, str_1), uiCfg.moveSpeed);
queue.inject(public_buf_l); queue.inject(public_buf_l);
} }
} }
@ -125,7 +126,8 @@ void lv_draw_move_motor() {
} }
void disp_cur_pos() { void disp_cur_pos() {
sprintf_P(public_buf_l, PSTR("%c:%3.1fmm"), cur_label, cur_pos); char str_1[16];
sprintf_P(public_buf_l, PSTR("%c:%s mm"), cur_label, dtostrf(cur_pos, 1, 1, str_1));
if (labelP) lv_label_set_text(labelP, public_buf_l); if (labelP) lv_label_set_text(labelP, public_buf_l);
} }

View file

@ -73,19 +73,20 @@ enum {
static void disp_key_value() { static void disp_key_value() {
char *temp; char *temp;
char str_1[16];
#if HAS_TRINAMIC_CONFIG #if HAS_TRINAMIC_CONFIG
float milliamps; float milliamps;
#endif #endif
switch (value) { switch (value) {
case PrintAcceleration: case PrintAcceleration:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.acceleration); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.acceleration, 1, 1, str_1));
break; break;
case RetractAcceleration: case RetractAcceleration:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.retract_acceleration); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.retract_acceleration, 1, 1, str_1));
break; break;
case TravelAcceleration: case TravelAcceleration:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.travel_acceleration); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.travel_acceleration, 1, 1, str_1));
break; break;
case XAcceleration: case XAcceleration:
sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]); sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[X_AXIS]);
@ -103,105 +104,104 @@ static void disp_key_value() {
sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]); sprintf_P(public_buf_m, PSTR("%d"), (int)planner.settings.max_acceleration_mm_per_s2[E_AXIS_N(1)]);
break; break;
case XMaxFeedRate: case XMaxFeedRate:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[X_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[X_AXIS], 1, 1, str_1));
break; break;
case YMaxFeedRate: case YMaxFeedRate:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Y_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[Y_AXIS], 1, 1, str_1));
break; break;
case ZMaxFeedRate: case ZMaxFeedRate:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[Z_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[Z_AXIS], 1, 1, str_1));
break; break;
case E0MaxFeedRate: case E0MaxFeedRate:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[E_AXIS], 1, 1, str_1));
break; break;
case E1MaxFeedRate: case E1MaxFeedRate:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.max_feedrate_mm_s[E_AXIS_N(1)]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.max_feedrate_mm_s[E_AXIS_N(1)], 1, 1, str_1));
break; break;
case XJerk: case XJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[X_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.max_jerk[X_AXIS], 1, 1, str_1));
#endif #endif
break; break;
case YJerk: case YJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[Y_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.max_jerk[Y_AXIS], 1, 1, str_1));
#endif #endif
break; break;
case ZJerk: case ZJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[Z_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.max_jerk[Z_AXIS], 1, 1, str_1));
#endif #endif
break; break;
case EJerk: case EJerk:
#if HAS_CLASSIC_JERK #if HAS_CLASSIC_JERK
sprintf_P(public_buf_m, PSTR("%.1f"), planner.max_jerk[E_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.max_jerk[E_AXIS], 1, 1, str_1));
#endif #endif
break; break;
case Xstep: case Xstep:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[X_AXIS], 1, 1, str_1));
break; break;
case Ystep: case Ystep:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[Y_AXIS], 1, 1, str_1));
break; break;
case Zstep: case Zstep:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[Z_AXIS], 1, 1, str_1));
break; break;
case E0step: case E0step:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[E_AXIS], 1, 1, str_1));
break; break;
case E1step: case E1step:
sprintf_P(public_buf_m, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[E_AXIS_N(1)], 1, 1, str_1));
break; break;
case Xcurrent: case Xcurrent:
#if AXIS_IS_TMC(X) #if AXIS_IS_TMC(X)
milliamps = stepperX.getMilliamps(); milliamps = stepperX.getMilliamps();
sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
#endif #endif
break; break;
case Ycurrent: case Ycurrent:
#if AXIS_IS_TMC(Y) #if AXIS_IS_TMC(Y)
milliamps = stepperY.getMilliamps(); milliamps = stepperY.getMilliamps();
sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
#endif #endif
break; break;
case Zcurrent: case Zcurrent:
#if AXIS_IS_TMC(Z) #if AXIS_IS_TMC(Z)
milliamps = stepperZ.getMilliamps(); milliamps = stepperZ.getMilliamps();
sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
#endif #endif
break; break;
case E0current: case E0current:
#if AXIS_IS_TMC(E0) #if AXIS_IS_TMC(E0)
milliamps = stepperE0.getMilliamps(); milliamps = stepperE0.getMilliamps();
sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
#endif #endif
break; break;
case E1current: case E1current:
#if AXIS_IS_TMC(E1) #if AXIS_IS_TMC(E1)
milliamps = stepperE1.getMilliamps(); milliamps = stepperE1.getMilliamps();
sprintf_P(public_buf_m, PSTR("%.1f"), milliamps); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
#endif #endif
break; break;
case pause_pos_x: case pause_pos_x:
sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosX); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(gCfgItems.pausePosX, 1, 1, str_1));
break; break;
case pause_pos_y: case pause_pos_y:
sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosY); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(gCfgItems.pausePosY, 1, 1, str_1));
break; break;
case pause_pos_z: case pause_pos_z:
sprintf_P(public_buf_m, PSTR("%.1f"), gCfgItems.pausePosZ); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(gCfgItems.pausePosZ, 1, 1, str_1));
break; break;
case level_pos_x1: case level_pos_x1:
sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[0][0]); sprintf_P(public_buf_m, PSTR("%d"), (int)gCfgItems.levelingPos[0][0]);
@ -236,16 +236,16 @@ static void disp_key_value() {
#if HAS_BED_PROBE #if HAS_BED_PROBE
case x_offset: case x_offset:
#if HAS_PROBE_XY_OFFSET #if HAS_PROBE_XY_OFFSET
sprintf_P(public_buf_m, PSTR("%.1f"), probe.offset.x); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(probe.offset.x, 1, 3, str_1));
#endif #endif
break; break;
case y_offset: case y_offset:
#if HAS_PROBE_XY_OFFSET #if HAS_PROBE_XY_OFFSET
sprintf_P(public_buf_m, PSTR("%.1f"), probe.offset.y); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(probe.offset.y, 1, 3, str_1));
#endif #endif
break; break;
case z_offset: case z_offset:
sprintf_P(public_buf_m, PSTR("%.1f"), probe.offset.z); sprintf_P(public_buf_m, PSTR("%s"), dtostrf(probe.offset.z, 1, 3, str_1));
break; break;
#endif #endif
case load_length: case load_length:

View file

@ -60,15 +60,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
} }
void lv_draw_pause_position() { void lv_draw_pause_position() {
char str_1[16];
scr = lv_screen_create(PAUSE_POS_UI, machine_menu.PausePosText); scr = lv_screen_create(PAUSE_POS_UI, machine_menu.PausePosText);
sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosX); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(gCfgItems.pausePosX, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.xPos, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.xPos, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_PAUSE_X, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosY); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(gCfgItems.pausePosY, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.yPos, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PAUSE_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.yPos, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_PAUSE_Y, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), gCfgItems.pausePosZ); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(gCfgItems.pausePosZ, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.zPos, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PAUSE_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.zPos, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_PAUSE_Z, 2, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_PAUSE_RETURN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", common_menu.text_back, PARA_UI_BACL_POS_X, PARA_UI_BACL_POS_Y, event_handler, ID_PAUSE_RETURN, true);

View file

@ -56,7 +56,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_0_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
} }
} }
#if DISABLED(SINGLENOZZLE) && HAS_MULTI_EXTRUDER #if HAS_MULTI_HOTEND
else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) { else if ((int)thermalManager.temp_hotend[uiCfg.curSprayerChoose].target > (HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1))) {
thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1); thermalManager.temp_hotend[uiCfg.curSprayerChoose].target = (float)HEATER_1_MAXTEMP - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1);
} }

View file

@ -235,7 +235,8 @@ void disp_print_time() {
} }
void disp_fan_Zpos() { void disp_fan_Zpos() {
sprintf_P(public_buf_l, PSTR("%.3f"), current_position[Z_AXIS]); char str_1[16];
sprintf_P(public_buf_l, PSTR("%s"), dtostrf(current_position[Z_AXIS], 1, 3, str_1));
lv_label_set_text(labelZpos, public_buf_l); lv_label_set_text(labelZpos, public_buf_l);
} }

View file

@ -79,25 +79,26 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
} }
void lv_draw_step_settings() { void lv_draw_step_settings() {
char str_1[16];
scr = lv_screen_create(STEPS_UI, machine_menu.StepsConfTitle); scr = lv_screen_create(STEPS_UI, machine_menu.StepsConfTitle);
if (!uiCfg.para_ui_page) { if (!uiCfg.para_ui_page) {
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[X_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[X_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.X_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.X_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_X, 0, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Y_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[Y_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_STEP_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Y_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_STEP_Y, 1, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[Z_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[Z_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_STEP_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Z_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_STEP_Z, 2, public_buf_l);
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[E_AXIS], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_STEP_E0, 3, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E0_Steps, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_STEP_E0, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_DOWN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_DOWN, true);
} }
else { else {
sprintf_P(public_buf_l, PSTR("%.1f"), planner.settings.axis_steps_per_mm[E_AXIS_N(1)]); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(planner.settings.axis_steps_per_mm[E_AXIS_N(1)], 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_E1, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E1_Steps, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_STEP_E1, 0, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_UP, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_STEP_UP, true);

View file

@ -95,13 +95,14 @@ void lv_draw_tmc_current_settings() {
scr = lv_screen_create(TMC_CURRENT_UI, machine_menu.TmcCurrentConfTitle); scr = lv_screen_create(TMC_CURRENT_UI, machine_menu.TmcCurrentConfTitle);
float milliamps; float milliamps;
char str_1[16];
if (!uiCfg.para_ui_page) { if (!uiCfg.para_ui_page) {
#if AXIS_IS_TMC(X) #if AXIS_IS_TMC(X)
milliamps = stepperX.getMilliamps(); milliamps = stepperX.getMilliamps();
#else #else
milliamps = -1; milliamps = -1;
#endif #endif
sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.X_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_X, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.X_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_X, 0, public_buf_l);
#if AXIS_IS_TMC(Y) #if AXIS_IS_TMC(Y)
@ -109,7 +110,7 @@ void lv_draw_tmc_current_settings() {
#else #else
milliamps = -1; milliamps = -1;
#endif #endif
sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Y_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_TMC_CURRENT_Y, 1, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Y_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 2, event_handler, ID_TMC_CURRENT_Y, 1, public_buf_l);
#if AXIS_IS_TMC(Z) #if AXIS_IS_TMC(Z)
@ -117,7 +118,7 @@ void lv_draw_tmc_current_settings() {
#else #else
milliamps = -1; milliamps = -1;
#endif #endif
sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.Z_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_TMC_CURRENT_Z, 2, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.Z_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 3, event_handler, ID_TMC_CURRENT_Z, 2, public_buf_l);
#if AXIS_IS_TMC(E0) #if AXIS_IS_TMC(E0)
@ -125,7 +126,7 @@ void lv_draw_tmc_current_settings() {
#else #else
milliamps = -1; milliamps = -1;
#endif #endif
sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E0_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_TMC_CURRENT_E0, 3, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E0_Current, PARA_UI_POS_X, PARA_UI_POS_Y * 4, event_handler, ID_TMC_CURRENT_E0, 3, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_DOWN, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.next, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_DOWN, true);
@ -136,7 +137,7 @@ void lv_draw_tmc_current_settings() {
#else #else
milliamps = -1; milliamps = -1;
#endif #endif
sprintf_P(public_buf_l, PSTR("%.1f"), milliamps); sprintf_P(public_buf_l, PSTR("%s"), dtostrf(milliamps, 1, 1, str_1));
lv_screen_menu_item_1_edit(scr, machine_menu.E1_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_E1, 0, public_buf_l); lv_screen_menu_item_1_edit(scr, machine_menu.E1_Current, PARA_UI_POS_X, PARA_UI_POS_Y, event_handler, ID_TMC_CURRENT_E1, 0, public_buf_l);
lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_UP, true); lv_big_button_create(scr, "F:/bmp_back70x40.bin", machine_menu.previous, PARA_UI_TURN_PAGE_POS_X, PARA_UI_TURN_PAGE_POS_Y, event_handler, ID_TMC_CURRENT_UP, true);

View file

@ -42,6 +42,7 @@ extern uint32_t To_pre_view;
extern bool flash_preview_begin, default_preview_flg, gcode_preview_over; extern bool flash_preview_begin, default_preview_flg, gcode_preview_over;
void printer_state_polling() { void printer_state_polling() {
char str_1[16];
if (uiCfg.print_state == PAUSING) { if (uiCfg.print_state == PAUSING) {
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED) if (!planner.has_blocks_queued() && card.getIndex() > MIN_FILE_PRINTED)
@ -59,11 +60,11 @@ void printer_state_polling() {
uiCfg.current_z_position_bak = current_position.z; uiCfg.current_z_position_bak = current_position.z;
if (gCfgItems.pausePosZ != (float)-1) { if (gCfgItems.pausePosZ != (float)-1) {
sprintf_P(public_buf_l, PSTR("G91\nG1 Z%.1f\nG90"), gCfgItems.pausePosZ); sprintf_P(public_buf_l, PSTR("G91\nG1 Z%s\nG90"), dtostrf(gCfgItems.pausePosZ, 1, 1, str_1));
gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now(public_buf_l);
} }
if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) { if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) {
sprintf_P(public_buf_l, PSTR("G1 X%.1f Y%.1f"), gCfgItems.pausePosX, gCfgItems.pausePosY); sprintf_P(public_buf_l, PSTR("G1 X%s Y%s"), dtostrf(gCfgItems.pausePosX, 1, 1, str_1), dtostrf(gCfgItems.pausePosY, 1, 1, str_1));
gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now(public_buf_l);
} }
uiCfg.print_state = PAUSED; uiCfg.print_state = PAUSED;
@ -83,12 +84,12 @@ void printer_state_polling() {
if (uiCfg.print_state == RESUMING) { if (uiCfg.print_state == RESUMING) {
if (IS_SD_PAUSED()) { if (IS_SD_PAUSED()) {
if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) { if (gCfgItems.pausePosX != (float)-1 && gCfgItems.pausePosY != (float)-1) {
sprintf_P(public_buf_m, PSTR("G1 X%.1f Y%.1f"), uiCfg.current_x_position_bak, uiCfg.current_y_position_bak); sprintf_P(public_buf_m, PSTR("G1 X%s Y%s"), dtostrf(uiCfg.current_x_position_bak, 1, 1, str_1), dtostrf(uiCfg.current_y_position_bak, 1, 1, str_1));
gcode.process_subcommands_now(public_buf_m); gcode.process_subcommands_now(public_buf_m);
} }
if (gCfgItems.pausePosZ != (float)-1) { if (gCfgItems.pausePosZ != (float)-1) {
ZERO(public_buf_m); ZERO(public_buf_m);
sprintf_P(public_buf_m, PSTR("G1 Z%.1f"), uiCfg.current_z_position_bak); sprintf_P(public_buf_m, PSTR("G1 Z%s"), dtostrf(uiCfg.current_z_position_bak, 1, 1, str_1));
gcode.process_subcommands_now(public_buf_m); gcode.process_subcommands_now(public_buf_m);
} }
gcode.process_subcommands_now_P(M24_STR); gcode.process_subcommands_now_P(M24_STR);
@ -126,7 +127,7 @@ void printer_state_polling() {
gcode.process_subcommands_now(public_buf_m); gcode.process_subcommands_now(public_buf_m);
if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) { if (gCfgItems.pause_reprint && gCfgItems.pausePosZ != -1.0f) {
sprintf_P(public_buf_l, PSTR("G91\nG1 Z-%.1f\nG90"), gCfgItems.pausePosZ); sprintf_P(public_buf_l, PSTR("G91\nG1 Z-%s\nG90"), dtostrf(gCfgItems.pausePosZ, 1, 1, str_2));
gcode.process_subcommands_now(public_buf_l); gcode.process_subcommands_now(public_buf_l);
} }
#endif #endif

View file

@ -874,38 +874,64 @@ static void wifi_gcode_exec(uint8_t *cmd_line) {
} }
} }
break; break;
case 105: case 105:
case 991: case 991:
ZERO(tempBuf); ZERO(tempBuf);
if (cmd_value == 105) { if (cmd_value == 105) {
SEND_OK_TO_WIFI;
sprintf_P((char *)tempBuf, PSTR("T:%.1f /%.1f B:%.1f /%.1f T0:%.1f /%.1f T1:%.1f /%.1f @:0 B@:0\r\n"),
(float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, SEND_OK_TO_WIFI;
char *outBuf = (char *)tempBuf;
char str_1[16], tbuf[34];
dtostrf(thermalManager.temp_hotend[0].celsius, 1, 1, tbuf);
strcat_P(tbuf, PSTR(" /"));
strcat(tbuf, dtostrf(thermalManager.temp_hotend[0].target, 1, 1, str_1));
const int tlen = strlen(tbuf);
sprintf_P(outBuf, PSTR("T:%s"), tbuf);
outBuf += 2 + tlen;
strcpy_P(outBuf, PSTR(" B:"));
outBuf += 3;
#if HAS_HEATED_BED #if HAS_HEATED_BED
(float)thermalManager.temp_bed.celsius, (float)thermalManager.temp_bed.target, strcpy(outBuf, dtostrf(thermalManager.temp_bed.celsius, 1, 1, str_1));
strcat_P(outBuf, PSTR(" /"));
strcat(outBuf, dtostrf(thermalManager.temp_bed.target, 1, 1, str_1));
#else #else
0.0f, 0.0f, strcpy_P(outBuf, PSTR("0 /0"));
#endif #endif
(float)thermalManager.temp_hotend[0].celsius, (float)thermalManager.temp_hotend[0].target, outBuf += 4;
#if DISABLED(SINGLENOZZLE) && HAS_MULTI_EXTRUDER
(float)thermalManager.temp_hotend[1].celsius, (float)thermalManager.temp_hotend[1].target strcat_P(outBuf, PSTR(" T0:"));
strcat(outBuf, tbuf);
outBuf += 4 + tlen;
strcat_P(outBuf, PSTR(" T1:"));
outBuf += 4;
#if HAS_MULTI_HOTEND
strcat(outBuf, dtostrf(thermalManager.temp_hotend[1].celsius, 1, 1, str_1));
strcat_P(outBuf, PSTR(" /"));
strcat(outBuf, dtostrf(thermalManager.temp_hotend[1].target, 1, 1, str_1));
#else #else
0.0f, 0.0f strcat_P(outBuf, PSTR("0 /0"));
#endif #endif
); outBuf += 4;
strcat_P(outBuf, PSTR(" @:0 B@:0\r\n"));
} }
else { else {
sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"), sprintf_P((char *)tempBuf, PSTR("T:%d /%d B:%d /%d T0:%d /%d T1:%d /%d @:0 B@:0\r\n"),
(int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target,
(int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, #if HAS_HEATED_BED
#if HAS_HEATED_BED (int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target,
(int)thermalManager.temp_bed.celsius, (int)thermalManager.temp_bed.target, #else
#else 0, 0,
0, 0, #endif
#endif (int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target,
(int)thermalManager.temp_hotend[0].celsius, (int)thermalManager.temp_hotend[0].target, #if HAS_MULTI_HOTEND
#if DISABLED(SINGLENOZZLE) && HAS_MULTI_EXTRUDER
(int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target (int)thermalManager.temp_hotend[1].celsius, (int)thermalManager.temp_hotend[1].target
#else #else
0, 0 0, 0

View file

@ -3093,7 +3093,7 @@ void Temperature::tick() {
#endif #endif
, H_CHAMBER , H_CHAMBER
); );
#endif // HAS_TEMP_CHAMBER #endif
#if HAS_TEMP_PROBE #if HAS_TEMP_PROBE
print_heater_state(degProbe(), 0 print_heater_state(degProbe(), 0
#if ENABLED(SHOW_TEMP_ADC_VALUES) #if ENABLED(SHOW_TEMP_ADC_VALUES)
@ -3101,7 +3101,7 @@ void Temperature::tick() {
#endif #endif
, H_PROBE , H_PROBE
); );
#endif // HAS_TEMP_PROBE #endif
#if HAS_MULTI_HOTEND #if HAS_MULTI_HOTEND
HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e) HOTEND_LOOP() print_heater_state(degHotend(e), degTargetHotend(e)
#if ENABLED(SHOW_TEMP_ADC_VALUES) #if ENABLED(SHOW_TEMP_ADC_VALUES)