Skip to content

Commit

Permalink
whole degree accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 23, 2021
1 parent 5944b09 commit 61b27cd
Show file tree
Hide file tree
Showing 25 changed files with 111 additions and 103 deletions.
6 changes: 3 additions & 3 deletions Marlin/src/feature/leds/tempstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ void handle_status_leds() {
static millis_t next_status_led_update_ms = 0;
if (ELAPSED(millis(), next_status_led_update_ms)) {
next_status_led_update_ms += 500; // Update every 0.5s
celsius_float_t max_temp = TERN0(HAS_HEATED_BED, _MAX(thermalManager.degTargetBed(), thermalManager.degBed()));
celsius_t max_temp = TERN0(HAS_HEATED_BED, _MAX(thermalManager.degTargetBed(), thermalManager.wholeDegBed()));
HOTEND_LOOP()
max_temp = _MAX(max_temp, thermalManager.degHotend(e), thermalManager.degTargetHotend(e));
const int8_t new_red = (max_temp > 55.0) ? HIGH : (max_temp < 54.0 || old_red < 0) ? LOW : old_red;
max_temp = _MAX(max_temp, thermalManager.wholeDegHotend(e), thermalManager.degTargetHotend(e));
const int8_t new_red = (max_temp > 55) ? HIGH : (max_temp < 54 || old_red < 0) ? LOW : old_red;
if (new_red != old_red) {
old_red = new_red;
#if PIN_EXISTS(STAT_LED_RED)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static bool ensure_safe_temperature(const bool wait=true, const PauseMode mode=P

// Allow interruption by Emergency Parser M108
wait_for_heatup = TERN1(PREVENT_COLD_EXTRUSION, !thermalManager.allow_cold_extrude);
while (wait_for_heatup && ABS(thermalManager.degHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > (TEMP_WINDOW))
while (wait_for_heatup && ABS(thermalManager.wholeDegHotend(active_extruder) - thermalManager.degTargetHotend(active_extruder)) > (TEMP_WINDOW))
idle();
wait_for_heatup = false;

Expand Down
12 changes: 6 additions & 6 deletions Marlin/src/feature/probe_temp_comp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ bool ProbeTempComp::set_offset(const TempSensorID tsi, const uint8_t idx, const

void ProbeTempComp::print_offsets() {
LOOP_L_N(s, TSI_COUNT) {
celsius_float_t temp = cali_info[s].start_temp;
celsius_float_t temp = static_cast<celsius_float_t>(cali_info[s].start_temp);
for (int16_t i = -1; i < cali_info[s].measurements; ++i) {
SERIAL_ECHOPGM_P(s == TSI_BED ? PSTR("Bed") :
#if ENABLED(USE_TEMP_EXT_COMPENSATION)
Expand Down Expand Up @@ -114,7 +114,7 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
}

const uint8_t measurements = cali_info[tsi].measurements;
const celsius_float_t start_temp = cali_info[tsi].start_temp,
const celsius_float_t start_temp = static_cast<celsius_float_t>(cali_info[tsi].start_temp),
res_temp = cali_info[tsi].temp_res;
int16_t * const data = sensor_z_offsets[tsi];

Expand All @@ -126,7 +126,7 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
SERIAL_ECHOPGM("Applying linear extrapolation");
calib_idx--;
for (; calib_idx < measurements; ++calib_idx) {
const float temp = start_temp + float(calib_idx) * res_temp;
const celsius_float_t temp = start_temp + float(calib_idx) * res_temp;
data[calib_idx] = static_cast<int16_t>(k * temp + d);
}
}
Expand Down Expand Up @@ -160,13 +160,13 @@ bool ProbeTempComp::finish_calibration(const TempSensorID tsi) {
}

void ProbeTempComp::compensate_measurement(const TempSensorID tsi, const_celsius_float_t temp, float &meas_z) {
if (WITHIN(temp, cali_info[tsi].start_temp, cali_info[tsi].end_temp))
if (WITHIN(temp, static_cast<celsius_float_t>(cali_info[tsi].start_temp), static_cast<celsius_float_t>(cali_info[tsi].end_temp)))
meas_z -= get_offset_for_temperature(tsi, temp);
}

float ProbeTempComp::get_offset_for_temperature(const TempSensorID tsi, const_celsius_float_t temp) {
const uint8_t measurements = cali_info[tsi].measurements;
const celsius_float_t start_temp = cali_info[tsi].start_temp,
const celsius_float_t start_temp = static_cast<celsius_float_t>(cali_info[tsi].start_temp),
res_temp = cali_info[tsi].temp_res;
const int16_t * const data = sensor_z_offsets[tsi];

Expand Down Expand Up @@ -207,7 +207,7 @@ bool ProbeTempComp::linear_regression(const TempSensorID tsi, float &k, float &d

if (!WITHIN(calib_idx, 2, cali_info[tsi].measurements)) return false;

const celsius_float_t start_temp = cali_info[tsi].start_temp,
const celsius_float_t start_temp = static_cast<celsius_float_t>(cali_info[tsi].start_temp),
res_temp = cali_info[tsi].temp_res;
const int16_t * const data = sensor_z_offsets[tsi];

Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/feature/probe_temp_comp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ enum TempSensorID : uint8_t {
};

typedef struct {
uint8_t measurements; // Max. number of measurements to be stored (35 - 80°C)
celsius_float_t temp_res, // Resolution in °C between measurements
start_temp, // Base measurement; z-offset == 0
end_temp;
uint8_t measurements; // Max. number of measurements to be stored (35 - 80°C)
celsius_float_t temp_res; // Resolution in °C between measurements
celsius_t start_temp, // Base measurement; z-offset == 0
end_temp;
} temp_calib_t;

/**
Expand Down
18 changes: 9 additions & 9 deletions Marlin/src/gcode/calibrate/G76_M192_M871.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ void GcodeSuite::G76() {
return (timeout && ELAPSED(ms, timeout));
};

auto wait_for_temps = [&](const celsius_float_t tb, const celsius_float_t tp, millis_t &ntr, const millis_t timeout=0) {
auto wait_for_temps = [&](const celsius_t tb, const celsius_t tp, millis_t &ntr, const millis_t timeout=0) {
say_waiting_for(); SERIAL_ECHOLNPGM("bed and probe temperature.");
while (fabs(thermalManager.degBed() - tb) > 0.1f || thermalManager.degProbe() > tp)
while (thermalManager.wholeDegBed() != tb || thermalManager.wholeDegProbe() > tp)
if (report_temps(ntr, timeout)) return true;
return false;
};

auto g76_probe = [](const TempSensorID sid, uint16_t &targ, const xy_pos_t &nozpos) {
auto g76_probe = [](const TempSensorID sid, celsius_t &targ, const xy_pos_t &nozpos) {
do_z_clearance(5.0); // Raise nozzle before probing
const float measured_z = probe.probe_at_point(nozpos, PROBE_PT_STOW, 0, false); // verbose=0, probe_relative=false
if (isnan(measured_z))
Expand Down Expand Up @@ -170,17 +170,17 @@ void GcodeSuite::G76() {
// Report temperatures every second and handle heating timeouts
millis_t next_temp_report = millis() + 1000;

auto report_targets = [&](const uint16_t tb, const uint16_t tp) {
auto report_targets = [&](const celsius_t tb, const celsius_t tp) {
SERIAL_ECHOLNPAIR("Target Bed:", tb, " Probe:", tp);
};

if (do_bed_cal) {

celsius_float_t target_bed = cali_info_init[TSI_BED].start_temp,
target_probe = static_cast<celsius_float_t>(temp_comp.bed_calib_probe_temp);
celsius_t target_bed = static_cast<celsius_t>(cali_info_init[TSI_BED].start_temp),
target_probe = temp_comp.bed_calib_probe_temp;

say_waiting_for(); SERIAL_ECHOLNPGM(" cooling.");
while (thermalManager.degBed() > target_bed || thermalManager.degProbe() > target_probe)
while (thermalManager.wholeDegBed() > target_bed || thermalManager.wholeDegProbe() > target_probe)
report_temps(next_temp_report);

// Disable leveling so it won't mess with us
Expand All @@ -204,7 +204,7 @@ void GcodeSuite::G76() {
do_blocking_move_to(noz_pos_xyz);
say_waiting_for_probe_heating();
SERIAL_EOL();
while (thermalManager.degProbe() < target_probe)
while (thermalManager.wholeDegProbe() < target_probe)
report_temps(next_temp_report);

const float measured_z = g76_probe(TSI_BED, target_bed, noz_pos_xyz);
Expand Down Expand Up @@ -239,7 +239,7 @@ void GcodeSuite::G76() {
const celsius_t target_bed = temp_comp.probe_calib_bed_temp;
thermalManager.setTargetBed(target_bed);

uint16_t target_probe = cali_info_init[TSI_PROBE].start_temp;
celsius_t target_probe = static_cast<celsius_t>(cali_info_init[TSI_PROBE].start_temp);

report_targets(target_bed, target_probe);

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/lcd/HD44780/marlinui_HD44780.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr
const celsius_t t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else
const celsius_t t1 = thermalManager.degHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
const celsius_t t1 = thermalManager.wholeDegHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
#endif

if (prefix >= 0) lcd_put_wchar(prefix);
Expand Down Expand Up @@ -557,7 +557,7 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char pr

#if HAS_COOLER
FORCE_INLINE void _draw_cooler_status(const char prefix, const bool blink) {
const float t1 = thermalManager.degCooler(), t2 = thermalManager.degTargetCooler();
const float t1 = thermalManager.wholeDegCooler(), t2 = thermalManager.degTargetCooler();

if (prefix >= 0) lcd_put_wchar(prefix);

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ FORCE_INLINE void _draw_heater_status(const heater_id_t heater_id, const char *p
uint8_t pic_hot_bits;
#if HAS_HEATED_BED
const bool isBed = heater_id < 0;
const celsius_t t1 = (isBed ? thermalManager.degBed() : thermalManager.degHotend(heater_id)),
const celsius_t t1 = (isBed ? thermalManager.wholeDegBed() : thermalManager.wholeDegHotend(heater_id)),
t2 = (isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater_id));
#else
const celsius_t t1 = thermalManager.degHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
const celsius_t t1 = thermalManager.wholeDegHotend(heater_id), t2 = thermalManager.degTargetHotend(heater_id);
#endif

#if HOTENDS < 2
Expand Down Expand Up @@ -803,7 +803,7 @@ void MarlinUI::draw_status_screen() {
if (!PanelDetected) return;
lcd.setCursor((LCD_WIDTH - 14) / 2, row + 1);
lcd.write(LCD_STR_THERMOMETER[0]); lcd_put_u8str_P(PSTR(" E")); lcd.write('1' + extruder); lcd.write(' ');
lcd.print(i16tostr3rj(thermalManager.degHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/');
lcd.print(i16tostr3rj(thermalManager.wholeDegHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]); lcd.write('/');
lcd.print(i16tostr3rj(thermalManager.degTargetHotend(extruder))); lcd.write(LCD_STR_DEGREE[0]);
lcd.print_line();
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/dogm/marlinui_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ 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(i16tostr3rj(thermalManager.degHotend(extruder)));
lcd_put_u8str(i16tostr3rj(thermalManager.wholeDegHotend(extruder)));
lcd_put_wchar('/');

if (get_blink() || !thermalManager.heater_idle[extruder].timed_out)
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/dogm/status_screen_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co

const uint8_t tx = STATUS_HOTEND_TEXT_X(heater_id);

const celsius_t temp = thermalManager.degHotend(heater_id),
const celsius_t temp = thermalManager.wholeDegHotend(heater_id),
target = thermalManager.degTargetHotend(heater_id);

#if DISABLED(STATUS_HOTEND_ANIM)
Expand Down Expand Up @@ -310,7 +310,7 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co

const uint8_t tx = STATUS_BED_TEXT_X;

const celsius_t temp = thermalManager.degBed(),
const celsius_t temp = thermalManager.wholeDegBed(),
target = thermalManager.degTargetBed();

#if ENABLED(STATUS_HEAT_PERCENT) || DISABLED(STATUS_BED_ANIM)
Expand Down Expand Up @@ -380,14 +380,14 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
_draw_centered_temp(thermalManager.degTargetChamber(), STATUS_CHAMBER_TEXT_X, 7);
#endif
if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1))
_draw_centered_temp(thermalManager.degChamber(), STATUS_CHAMBER_TEXT_X, 28);
_draw_centered_temp(thermalManager.wholeDegChamber(), STATUS_CHAMBER_TEXT_X, 28);
}
#endif

#if DO_DRAW_COOLER
FORCE_INLINE void _draw_cooler_status() {
if (PAGE_CONTAINS(28 - INFO_FONT_ASCENT, 28 - 1))
_draw_centered_temp(thermalManager.degCooler(), STATUS_COOLER_TEXT_X, 28);
_draw_centered_temp(thermalManager.wholeDegCooler(), STATUS_COOLER_TEXT_X, 28);
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,14 +721,14 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
const duration_t elapsed = print_job_timer.duration();
duration_t remaining = TERN0(USE_M73_REMAINING_TIME, ui.get_remaining_time());
const uint16_t feedrate_perc = feedrate_percentage;
const celsius_t extruder_1_temp = thermalManager.degHotend(0),
const celsius_t extruder_1_temp = thermalManager.wholeDegHotend(0),
extruder_1_target = thermalManager.degTargetHotend(0);
#if HAS_MULTI_HOTEND
const celsius_t extruder_2_temp = thermalManager.degHotend(1),
const celsius_t extruder_2_temp = thermalManager.wholeDegHotend(1),
extruder_2_target = thermalManager.degTargetHotend(1);
#endif
#if HAS_HEATED_BED
const celsius_t bed_temp = thermalManager.degBed(),
const celsius_t bed_temp = thermalManager.wholeDegBed(),
bed_target = thermalManager.degTargetBed();
#endif

Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/dwin/e3v2/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ void _draw_xyz_position(const bool force) {
void update_variable() {
#if HAS_HOTEND
static celsius_t _hotendtemp = 0, _hotendtarget = 0;
const celsius_t hc = thermalManager.degHotend(0),
const celsius_t hc = thermalManager.wholeDegHotend(0),
ht = thermalManager.degTargetHotend(0);
const bool _new_hotend_temp = _hotendtemp != hc,
_new_hotend_target = _hotendtarget != ht;
Expand All @@ -1592,7 +1592,7 @@ void update_variable() {
#endif
#if HAS_HEATED_BED
static celsius_t _bedtemp = 0, _bedtarget = 0;
const celsius_t bc = thermalManager.degBed(),
const celsius_t bc = thermalManager.wholeDegBed(),
bt = thermalManager.degTargetBed();
const bool _new_bed_temp = _bedtemp != bc,
_new_bed_target = _bedtarget != bt;
Expand Down Expand Up @@ -1880,7 +1880,7 @@ void Draw_Status_Area(const bool with_update) {

#if HAS_HOTEND
DWIN_ICON_Show(ICON, ICON_HotendTemp, 10, 383);
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 384, thermalManager.degHotend(0));
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 384, thermalManager.wholeDegHotend(0));
DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 384, F("/"));
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 25 + 4 * STAT_CHR_W + 6, 384, thermalManager.degTargetHotend(0));

Expand All @@ -1891,7 +1891,7 @@ void Draw_Status_Area(const bool with_update) {

#if HAS_HEATED_BED
DWIN_ICON_Show(ICON, ICON_BedTemp, 10, 416);
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 417, thermalManager.degBed());
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 28, 417, thermalManager.wholeDegBed());
DWIN_Draw_String(false, false, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 25 + 3 * STAT_CHR_W + 5, 417, F("/"));
DWIN_Draw_IntValue(true, true, 0, DWIN_FONT_STAT, Color_White, Color_Bg_Black, 3, 25 + 4 * STAT_CHR_W + 6, 417, thermalManager.degTargetBed());
#endif
Expand Down Expand Up @@ -2709,7 +2709,7 @@ void HMI_AxisMove() {
case 4: // Extruder
// window tips
#ifdef PREVENT_COLD_EXTRUSION
if (thermalManager.degHotend(0) < (EXTRUDE_MINTEMP)) {
if (thermalManager.wholeDegHotend(0) < (EXTRUDE_MINTEMP)) {
HMI_flag.ETempTooLow_flag = true;
Popup_Window_ETempTooLow();
DWIN_UpdateLCD();
Expand Down
6 changes: 3 additions & 3 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ void lv_draw_dialog(uint8_t type) {

void filament_sprayer_temp() {
char buf[20] = {0};
sprintf(buf, preheat_menu.value_state, thermalManager.degHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
sprintf(buf, preheat_menu.value_state, thermalManager.wholeDegHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));

strcpy(public_buf_l, uiCfg.extruderIndex < 1 ? extrude_menu.ext1 : extrude_menu.ext2);
strcat_P(public_buf_l, PSTR(": "));
Expand Down Expand Up @@ -522,7 +522,7 @@ void filament_dialog_handle() {
}

if (uiCfg.filament_load_heat_flg) {
const celsius_t diff = thermalManager.degHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
const celsius_t diff = thermalManager.wholeDegHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
if (abs(diff) < 2 || diff > 0) {
uiCfg.filament_load_heat_flg = false;
lv_clear_dialog();
Expand All @@ -538,7 +538,7 @@ void filament_dialog_handle() {
}

if (uiCfg.filament_unload_heat_flg) {
const celsius_t diff = thermalManager.degHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
const celsius_t diff = thermalManager.wholeDegHotend(uiCfg.extruderIndex) - gCfgItems.filament_limit_temp;
if (abs(diff) < 2 || diff > 0) {
uiCfg.filament_unload_heat_flg = false;
lv_clear_dialog();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/mks_ui/draw_extrusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void disp_ext_speed() {

void disp_hotend_temp() {
char buf[20] = {0};
sprintf(buf, extrude_menu.temp_value, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
sprintf(buf, extrude_menu.temp_value, thermalManager.wholeDegHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));
strcpy(public_buf_l, extrude_menu.temper_text);
strcat(public_buf_l, buf);
lv_label_set_text(tempText, public_buf_l);
Expand Down
10 changes: 5 additions & 5 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_filament_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
switch (obj->mks_obj_id) {
case ID_FILAMNT_IN:
uiCfg.filament_load_heat_flg = true;
if (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex)) <= 1
|| gCfgItems.filament_limit_temp <= thermalManager.degHotend(uiCfg.extruderIndex)) {
if (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
|| gCfgItems.filament_limit_temp <= thermalManager.wholeDegHotend(uiCfg.extruderIndex)) {
lv_clear_filament_change();
lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_LOAD_COMPLETED);
}
Expand All @@ -67,8 +67,8 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
case ID_FILAMNT_OUT:
uiCfg.filament_unload_heat_flg = true;
if (thermalManager.degTargetHotend(uiCfg.extruderIndex)
&& (abs((int)(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.degHotend(uiCfg.extruderIndex))) <= 1
|| thermalManager.degHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temp)
&& (abs(thermalManager.degTargetHotend(uiCfg.extruderIndex) - thermalManager.wholeDegHotend(uiCfg.extruderIndex)) <= 1
|| thermalManager.wholeDegHotend(uiCfg.extruderIndex) >= gCfgItems.filament_limit_temp)
) {
lv_clear_filament_change();
lv_draw_dialog(DIALOG_TYPE_FILAMENT_HEAT_UNLOAD_COMPLETED);
Expand Down Expand Up @@ -154,7 +154,7 @@ void disp_filament_temp() {
public_buf_l[0] = '\0';

strcat(public_buf_l, uiCfg.extruderIndex < 1 ? preheat_menu.ext1 : preheat_menu.ext2);
sprintf(buf, preheat_menu.value_state, (int)thermalManager.degHotend(uiCfg.extruderIndex), (int)thermalManager.degTargetHotend(uiCfg.extruderIndex));
sprintf(buf, preheat_menu.value_state, thermalManager.wholeDegHotend(uiCfg.extruderIndex), thermalManager.degTargetHotend(uiCfg.extruderIndex));

strcat_P(public_buf_l, PSTR(": "));
strcat(public_buf_l, buf);
Expand Down
Loading

0 comments on commit 61b27cd

Please sign in to comment.