Additional numtostr functions

This commit is contained in:
Scott Lahteine
2020-03-08 19:42:18 -05:00
parent 0f39386d9b
commit 13118dbd8d
7 changed files with 105 additions and 73 deletions

View File

@ -107,7 +107,7 @@
#define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
FORCE_INLINE void _draw_centered_temp(const int16_t temp, const uint8_t tx, const uint8_t ty) {
const char *str = i16tostr3(temp);
const char *str = i16tostr3rj(temp);
const uint8_t len = str[0] != ' ' ? 3 : str[1] != ' ' ? 2 : 1;
lcd_put_u8str(tx - len * (INFO_FONT_WIDTH) / 2 + 1, ty, &str[3-len]);
lcd_put_wchar(LCD_STR_DEGREE[0]);
@ -406,7 +406,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(FILAMENT_LCD_DISPLAY)
strcpy(wstring, ftostr12ns(filwidth.measured_mm));
strcpy(mstring, i16tostr3(planner.volumetric_percent(parser.volumetric_enabled)));
strcpy(mstring, i16tostr3rj(planner.volumetric_percent(parser.volumetric_enabled)));
#endif
// Progress / elapsed / estimation updates and string formatting to avoid float math on each LCD draw
@ -438,7 +438,7 @@ void MarlinUI::draw_status_screen() {
#if ENABLED(PRINT_PROGRESS_SHOW_DECIMALS)
permyriadtostr4(progress)
#else
ui8tostr3(progress / (PROGRESS_SCALE))
ui8tostr3rj(progress / (PROGRESS_SCALE))
#endif
));
}
@ -571,7 +571,7 @@ void MarlinUI::draw_status_screen() {
// Laser / Spindle
#if DO_DRAW_CUTTER
if (cutter.power && PAGE_CONTAINS(STATUS_CUTTER_TEXT_Y - INFO_FONT_ASCENT, STATUS_CUTTER_TEXT_Y - 1)) {
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, i16tostr3(cutter.powerPercent(cutter.power)));
lcd_put_u8str(STATUS_CUTTER_TEXT_X, STATUS_CUTTER_TEXT_Y, i16tostr3rj(cutter.powerPercent(cutter.power)));
lcd_put_wchar('%');
}
#endif
@ -598,7 +598,7 @@ void MarlinUI::draw_status_screen() {
c = '*';
}
#endif
lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3(thermalManager.fanPercent(spd)));
lcd_put_u8str(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y, i16tostr3rj(thermalManager.fanPercent(spd)));
lcd_put_wchar(c);
}
}
@ -768,7 +768,7 @@ void MarlinUI::draw_status_screen() {
lcd_put_wchar(3, EXTRAS_2_BASELINE, LCD_STR_FEEDRATE[0]);
set_font(FONT_STATUSMENU);
lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3(feedrate_percentage));
lcd_put_u8str(12, EXTRAS_2_BASELINE, i16tostr3rj(feedrate_percentage));
lcd_put_wchar('%');
//

View File

@ -324,11 +324,11 @@ void MarlinUI::clear_lcd() { } // Automatically cleared by Picture Loop
lcd_put_wchar(LCD_PIXEL_WIDTH - 11 * (MENU_FONT_WIDTH), row_y2, 'E');
lcd_put_wchar((char)('1' + extruder));
lcd_put_wchar(' ');
lcd_put_u8str(i16tostr3(thermalManager.degHotend(extruder)));
lcd_put_u8str(i16tostr3rj(thermalManager.degHotend(extruder)));
lcd_put_wchar('/');
if (get_blink() || !thermalManager.hotend_idle[extruder].timed_out)
lcd_put_u8str(i16tostr3(thermalManager.degTargetHotend(extruder)));
lcd_put_u8str(i16tostr3rj(thermalManager.degTargetHotend(extruder)));
}
#endif // ADVANCED_PAUSE_FEATURE