Browse Source

🐛 Fix heater display options/compile (#22185)

vanilla_fb_2.0.x
ellensp 3 years ago
committed by Scott Lahteine
parent
commit
25e7e2fce0
  1. 2
      Marlin/Configuration_adv.h
  2. 4
      Marlin/src/inc/SanityCheck.h
  3. 35
      Marlin/src/lcd/dogm/status/hotend.h
  4. 40
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

2
Marlin/Configuration_adv.h

@ -1594,7 +1594,7 @@
*/
//#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones
//#define STATUS_HOTEND_NUMBERLESS // Use plain hotend icons instead of numbered ones (with 2+ hotends)
#define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM)
#define STATUS_HOTEND_INVERTED // Show solid nozzle bitmaps when heating (Requires STATUS_HOTEND_ANIM for numbered hotends)
#define STATUS_HOTEND_ANIM // Use a second bitmap to indicate hotend heating
#define STATUS_BED_ANIM // Use a second bitmap to indicate bed heating
#define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating

4
Marlin/src/inc/SanityCheck.h

@ -1039,6 +1039,10 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
#endif
#if ENABLED(STATUS_HOTEND_INVERTED) && NONE(STATUS_HOTEND_NUMBERLESS, STATUS_HOTEND_ANIM)
#error "With multiple hotends STATUS_HOTEND_INVERTED requires STATUS_HOTEND_ANIM or STATUS_HOTEND_NUMBERLESS."
#endif
#if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
#ifndef TOOLCHANGE_FS_LENGTH
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."

35
Marlin/src/lcd/dogm/status/hotend.h

@ -39,20 +39,33 @@
#define STATUS_HOTEND1_WIDTH 16
#if STATUS_HOTEND_BITMAPS == 1 || ENABLED(STATUS_HOTEND_NUMBERLESS)
#if STATUS_HOTEND_BITMAPS == 1 || defined(STATUS_HOTEND_NUMBERLESS)
const unsigned char status_hotend_a_bmp[] PROGMEM = {
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00011111,B11100000,
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
#if defined(STATUS_HOTEND_INVERTED) && !defined(STATUS_HOTEND_ANIM)
B00100000,B00010000,
B00100000,B00010000,
B00100000,B00010000,
B00010000,B00100000,
B00010000,B00100000,
B00100000,B00010000,
B00100000,B00010000,
B00110000,B00110000,
B00001000,B01000000,
B00000100,B10000000,
#else
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00011111,B11100000,
B00011111,B11100000,
B00111111,B11110000,
B00111111,B11110000,
B00111111,B11110000,
B00001111,B11000000,
B00000111,B10000000,
#endif
B00000011,B00000000
};

40
Marlin/src/lcd/dogm/status_screen_DOGM.cpp

@ -236,18 +236,12 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
#define HOTEND_DOT false
#endif
#if ANIM_HOTEND && BOTH(STATUS_HOTEND_INVERTED, STATUS_HOTEND_NUMBERLESS)
#define OFF_BMP(N) status_hotend_b_bmp
#define ON_BMP(N) status_hotend_a_bmp
#elif ANIM_HOTEND && DISABLED(STATUS_HOTEND_INVERTED) && ENABLED(STATUS_HOTEND_NUMBERLESS)
#define OFF_BMP(N) status_hotend_a_bmp
#define ON_BMP(N) status_hotend_b_bmp
#elif BOTH(ANIM_HOTEND, STATUS_HOTEND_INVERTED)
#define OFF_BMP(N) status_hotend##N##_b_bmp
#define ON_BMP(N) status_hotend##N##_a_bmp
#if ENABLED(STATUS_HOTEND_NUMBERLESS)
#define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_b_bmp, status_hotend_a_bmp)
#define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_a_bmp, status_hotend_b_bmp)
#else
#define OFF_BMP(N) status_hotend##N##_a_bmp
#define ON_BMP(N) status_hotend##N##_b_bmp
#define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_b_bmp, status_hotend##N##_a_bmp)
#define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_a_bmp, status_hotend##N##_b_bmp)
#endif
#if STATUS_HOTEND_BITMAPS > 1
@ -275,20 +269,18 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
NOMORE(tall, BAR_TALL);
#if ANIM_HOTEND
// 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));
// 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

Loading…
Cancel
Save