ADAPTIVE_FAN_SLOWING extension to hotend thermal protection (#12853)

This commit is contained in:
InsanityAutomation
2019-01-12 01:41:48 -05:00
committed by Scott Lahteine
parent 459f4fef60
commit 082f6a27de
88 changed files with 405 additions and 161 deletions

View File

@@ -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