🐛 Fix heater display options/compile (#22185)

This commit is contained in:
ellensp 2021-06-22 08:09:21 +12:00 committed by Scott Lahteine
parent a0f7f0e9e2
commit 25e7e2fce0
4 changed files with 45 additions and 36 deletions

View file

@ -1594,7 +1594,7 @@
*/ */
//#define STATUS_COMBINE_HEATERS // Use combined heater images instead of separate ones //#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_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_HOTEND_ANIM // Use a second bitmap to indicate hotend heating
#define STATUS_BED_ANIM // Use a second bitmap to indicate bed 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 #define STATUS_CHAMBER_ANIM // Use a second bitmap to indicate chamber heating

View file

@ -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." #error "EXTRUDERS must be 1 with HEATERS_PARALLEL."
#endif #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) #if ENABLED(TOOLCHANGE_FILAMENT_SWAP)
#ifndef TOOLCHANGE_FS_LENGTH #ifndef TOOLCHANGE_FS_LENGTH
#error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH." #error "TOOLCHANGE_FILAMENT_SWAP requires TOOLCHANGE_FS_LENGTH."

View file

@ -39,10 +39,22 @@
#define STATUS_HOTEND1_WIDTH 16 #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 = { const unsigned char status_hotend_a_bmp[] PROGMEM = {
B00011111,B11100000, B00011111,B11100000,
#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, B00111111,B11110000,
B00111111,B11110000, B00111111,B11110000,
@ -53,6 +65,7 @@
B00111111,B11110000, B00111111,B11110000,
B00001111,B11000000, B00001111,B11000000,
B00000111,B10000000, B00000111,B10000000,
#endif
B00000011,B00000000 B00000011,B00000000
}; };

View file

@ -236,18 +236,12 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
#define HOTEND_DOT false #define HOTEND_DOT false
#endif #endif
#if ANIM_HOTEND && BOTH(STATUS_HOTEND_INVERTED, STATUS_HOTEND_NUMBERLESS) #if ENABLED(STATUS_HOTEND_NUMBERLESS)
#define OFF_BMP(N) status_hotend_b_bmp #define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_b_bmp, status_hotend_a_bmp)
#define ON_BMP(N) status_hotend_a_bmp #define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend_a_bmp, status_hotend_b_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
#else #else
#define OFF_BMP(N) status_hotend##N##_a_bmp #define OFF_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_b_bmp, status_hotend##N##_a_bmp)
#define ON_BMP(N) status_hotend##N##_b_bmp #define ON_BMP(N) TERN(STATUS_HOTEND_INVERTED, status_hotend##N##_a_bmp, status_hotend##N##_b_bmp)
#endif #endif
#if STATUS_HOTEND_BITMAPS > 1 #if STATUS_HOTEND_BITMAPS > 1
@ -275,7 +269,6 @@ 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); uint8_t tall = uint8_t(perc * BAR_TALL + 0.5f);
NOMORE(tall, BAR_TALL); NOMORE(tall, BAR_TALL);
#if ANIM_HOTEND
// Draw hotend bitmap, either whole or split by the heating percent // Draw hotend bitmap, either whole or split by the heating percent
const uint8_t hx = STATUS_HOTEND_X(heater_id), const uint8_t hx = STATUS_HOTEND_X(heater_id),
bw = STATUS_HOTEND_BYTEWIDTH(heater_id); bw = STATUS_HOTEND_BYTEWIDTH(heater_id);
@ -288,7 +281,6 @@ FORCE_INLINE void _draw_centered_temp(const celsius_t temp, const uint8_t tx, co
else else
#endif #endif
u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat)); u8g.drawBitmapP(hx, STATUS_HEATERS_Y, bw, STATUS_HEATERS_HEIGHT, HOTEND_BITMAP(TERN(HAS_MMU, active_extruder, heater_id), isHeat));
#endif
} // PAGE_CONTAINS } // PAGE_CONTAINS