ADAPTIVE_FAN_SLOWING extension to hotend thermal protection (#12853)
This commit is contained in:
committed by
Scott Lahteine
parent
459f4fef60
commit
082f6a27de
@@ -291,7 +291,7 @@ void MarlinUI::draw_status_screen() {
|
||||
static uint8_t fan_frame;
|
||||
if (old_blink != blink) {
|
||||
old_blink = blink;
|
||||
if (!fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0;
|
||||
if (!thermalManager.fan_speed[0] || ++fan_frame >= STATUS_FAN_FRAMES) fan_frame = 0;
|
||||
}
|
||||
#endif
|
||||
if (PAGE_CONTAINS(STATUS_FAN_Y, STATUS_FAN_Y + STATUS_FAN_HEIGHT - 1))
|
||||
@@ -305,7 +305,7 @@ void MarlinUI::draw_status_screen() {
|
||||
fan_frame == 3 ? status_fan3_bmp :
|
||||
#endif
|
||||
#elif STATUS_FAN_FRAMES > 1
|
||||
blink && fan_speed[0] ? status_fan1_bmp :
|
||||
blink && thermalManager.fan_speed[0] ? status_fan1_bmp :
|
||||
#endif
|
||||
status_fan0_bmp
|
||||
);
|
||||
@@ -328,11 +328,18 @@ void MarlinUI::draw_status_screen() {
|
||||
// Fan, if a bitmap was provided
|
||||
#if DO_DRAW_FAN
|
||||
if (PAGE_CONTAINS(STATUS_FAN_TEXT_Y - INFO_FONT_ASCENT, STATUS_FAN_TEXT_Y - 1)) {
|
||||
const int per = ((int(fan_speed[0]) + 1) * 100) / 256;
|
||||
if (per) {
|
||||
char c = '%';
|
||||
uint16_t spd = thermalManager.fan_speed[0];
|
||||
if (spd) {
|
||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||
if (!blink && thermalManager.fan_speed_scaler[0] < 128) {
|
||||
spd = (spd * thermalManager.fan_speed_scaler[0]) >> 7;
|
||||
c = '*';
|
||||
}
|
||||
#endif
|
||||
lcd_moveto(STATUS_FAN_TEXT_X, STATUS_FAN_TEXT_Y);
|
||||
lcd_put_u8str(itostr3(per));
|
||||
lcd_put_wchar('%');
|
||||
lcd_put_u8str(itostr3(thermalManager.fanPercent(spd)));
|
||||
lcd_put_wchar(c);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@@ -707,7 +707,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
|
||||
// them only during blinks we gain a bit of stability.
|
||||
const bool blink = ui.get_blink();
|
||||
const uint16_t feedrate_perc = feedrate_percentage;
|
||||
const uint8_t fs = (((uint16_t)fan_speed[0] + 1) * 100) / 256;
|
||||
const uint16_t fs = (thermalManager.fan_speed[0] * uint16_t(thermalManager.fan_speed_scaler[0])) >> 7;
|
||||
const int16_t extruder_1_target = thermalManager.degTargetHotend(0);
|
||||
#if HOTENDS > 1
|
||||
const int16_t extruder_2_target = thermalManager.degTargetHotend(1);
|
||||
@@ -734,7 +734,6 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||
const bool blink = ui.get_blink();
|
||||
const duration_t elapsed = print_job_timer.duration();
|
||||
const uint16_t feedrate_perc = feedrate_percentage;
|
||||
const uint8_t fs = (((uint16_t)fan_speed[0] + 1) * 100) / 256;
|
||||
const int16_t extruder_1_temp = thermalManager.degHotend(0),
|
||||
extruder_1_target = thermalManager.degTargetHotend(0);
|
||||
#if HOTENDS > 1
|
||||
@@ -753,12 +752,20 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
|
||||
#if HAS_HEATED_BED
|
||||
draw_bed_temp(bed_temp, bed_target, forceUpdate);
|
||||
#endif
|
||||
draw_fan_speed(fs);
|
||||
|
||||
uint16_t spd = thermalManager.fan_speed[0];
|
||||
|
||||
#if ENABLED(ADAPTIVE_FAN_SLOWING)
|
||||
if (!blink && thermalManager.fan_speed_scaler[0] < 128)
|
||||
spd = (spd * thermalManager.fan_speed_scaler[0]) >> 7;
|
||||
#endif
|
||||
|
||||
draw_fan_speed(thermalManager.fanPercent(spd));
|
||||
draw_print_time(elapsed);
|
||||
draw_feedrate_percentage(feedrate_perc);
|
||||
|
||||
// Update the fan and bed animations
|
||||
if (fs) draw_fan_icon(blink);
|
||||
if (spd) draw_fan_icon(blink);
|
||||
#if HAS_HEATED_BED
|
||||
draw_heat_icon(bed_target > 0 && blink, bed_target > 0);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user