🐛 Fix STATUS_COMBINE_HEATERS compile (#22405)
This commit is contained in:
parent
0e9eb5f6ce
commit
8283f1577a
@ -264,29 +264,33 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
|
|||||||
#define HOTEND_BITMAP(N,S) status_hotend_a_bmp
|
#define HOTEND_BITMAP(N,S) status_hotend_a_bmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) {
|
#if DISABLED(STATUS_COMBINE_HEATERS)
|
||||||
|
|
||||||
#define BAR_TALL (STATUS_HEATERS_HEIGHT - 2)
|
if (PAGE_CONTAINS(STATUS_HEATERS_Y, STATUS_HEATERS_BOT)) {
|
||||||
|
|
||||||
const float prop = target - 20,
|
#define BAR_TALL (STATUS_HEATERS_HEIGHT - 2)
|
||||||
perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0;
|
|
||||||
uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
|
|
||||||
NOMORE(tall, BAR_TALL);
|
|
||||||
|
|
||||||
// Draw hotend bitmap, either whole or split by the heating percent
|
const float prop = target - 20,
|
||||||
const uint8_t hx = STATUS_HOTEND_X(heater_id),
|
perc = prop > 0 && temp >= 20 ? (temp - 20) / prop : 0;
|
||||||
bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
|
uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
|
||||||
#if ENABLED(STATUS_HEAT_PERCENT)
|
NOMORE(tall, BAR_TALL);
|
||||||
if (isHeat && tall <= BAR_TALL) {
|
|
||||||
const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall;
|
|
||||||
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), false));
|
|
||||||
u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), true) + ph * bw);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
|
|
||||||
|
|
||||||
} // PAGE_CONTAINS
|
// Draw hotend bitmap, either whole or split by the heating percent
|
||||||
|
const uint8_t hx = STATUS_HOTEND_X(heater_id),
|
||||||
|
bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
|
||||||
|
#if ENABLED(STATUS_HEAT_PERCENT)
|
||||||
|
if (isHeat && tall <= BAR_TALL) {
|
||||||
|
const uint8_t ph = STATUS_HEATERS_HEIGHT - 1 - tall;
|
||||||
|
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, ph, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), false));
|
||||||
|
u8g.drawBitmapP(hx, STATUS_HEATERS_Y + ph, bw, tall + 1, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), true) + ph * bw);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
|
||||||
|
|
||||||
|
} // PAGE_CONTAINS
|
||||||
|
|
||||||
|
#endif // !STATUS_COMBINE_HEATERS
|
||||||
|
|
||||||
if (PAGE_UNDER(7)) {
|
if (PAGE_UNDER(7)) {
|
||||||
#if HEATER_IDLE_HANDLER
|
#if HEATER_IDLE_HANDLER
|
||||||
|
Loading…
Reference in New Issue
Block a user