Add HAS_HEATED_BED conditional (#10495)

This commit is contained in:
Scott Lahteine
2018-04-23 17:13:01 -05:00
committed by GitHub
parent 10a25f733e
commit cb46cb8480
19 changed files with 303 additions and 260 deletions

View File

@ -21,7 +21,7 @@
*/
/**
* Standard Marlin Boot Screen bitmaps
* Standard Marlin Boot and Status Screen bitmaps
*
* Use the Marlin Bitmap Converter to make your own:
* http://marlinfw.org/tools/u8glib/converter.html
@ -136,7 +136,7 @@
// STATUS_SCREEN_HOTEND_TEXT_X(i) to modify draw locations.
#include "../../../_Statusscreen.h"
#elif HAS_TEMP_BED
#elif HAS_HEATED_BED
#define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 64))
#define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 64))
@ -321,7 +321,7 @@
};
#endif // HOTENDS
#else // !HAS_TEMP_BED
#else // !HAS_HEATED_BED
#define STATUS_SCREEN_X ( 8 + (HOTENDS ? 0 : 96))
#define STATUS_SCREENWIDTH (120 - (HOTENDS ? 0 : 96))
@ -507,7 +507,7 @@
#endif // HOTENDS
#endif // !HAS_TEMP_BED
#endif // !HAS_HEATED_BED
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY) || ENABLED(MESH_EDIT_GFX_OVERLAY)

View File

@ -45,7 +45,7 @@ FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, cons
UNUSED(blink);
#endif
#if HAS_TEMP_BED
#if HAS_HEATED_BED
const bool isBed = heater < 0;
#else
constexpr bool isBed = false;
@ -53,32 +53,48 @@ FORCE_INLINE void _draw_heater_status(const uint8_t x, const int8_t heater, cons
if (PAGE_UNDER(7)) {
#if HEATER_IDLE_HANDLER
const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
#if HAS_TEMP_BED
thermalManager.is_bed_idle()
#else
false
const bool is_idle = (
#if HAS_HEATED_BED
isBed ? thermalManager.is_bed_idle() :
#endif
thermalManager.is_heater_idle(heater)
);
if (blink || !is_idle)
#endif
_draw_centered_temp((isBed ? thermalManager.degTargetBed() : thermalManager.degTargetHotend(heater)) + 0.5, x, 7); }
_draw_centered_temp(0.5 + (
#if HAS_HEATED_BED
isBed ? thermalManager.degTargetBed() :
#endif
thermalManager.degTargetHotend(heater)
), x, 7
);
}
if (PAGE_CONTAINS(21, 28))
_draw_centered_temp((isBed ? thermalManager.degBed() : thermalManager.degHotend(heater)) + 0.5, x, 28);
_draw_centered_temp(0.5 + (
#if HAS_HEATED_BED
isBed ? thermalManager.degBed() :
#endif
thermalManager.degHotend(heater)
), x, 28
);
if (PAGE_CONTAINS(17, 20)) {
const uint8_t h = isBed ? 7 : HEAT_INDICATOR_X,
y = isBed ? 18 : 17;
if (isBed ? thermalManager.isHeatingBed() : thermalManager.isHeatingHotend(heater)) {
if (
#if HAS_HEATED_BED
isBed ? thermalManager.isHeatingBed() :
#endif
thermalManager.isHeatingHotend(heater)
) {
u8g.setColorIndex(0); // white on black
u8g.drawBox(x + h, y, 2, 2);
u8g.setColorIndex(1); // black on white
}
else {
else
u8g.drawBox(x + h, y, 2, 2);
}
}
}
@ -199,7 +215,7 @@ static void lcd_implementation_status_screen() {
HOTEND_LOOP() _draw_heater_status(STATUS_SCREEN_HOTEND_TEXT_X(e), e, blink);
// Heated bed
#if HOTENDS < 4 && HAS_TEMP_BED
#if HOTENDS < 4 && HAS_HEATED_BED
_draw_heater_status(STATUS_SCREEN_BED_TEXT_X, -1, blink);
#endif

View File

@ -525,12 +525,12 @@ void ST7920_Lite_Status_Screen::draw_heat_icon(const bool whichIcon, const bool
static struct {
bool E1_show_target : 1;
bool E2_show_target : 1;
#if HAS_HEATER_BED
#if HAS_HEATED_BED
bool bed_show_target : 1;
#endif
} display_state = {
true, true
#if HAS_HEATER_BED
#if HAS_HEATED_BED
, true
#endif
};
@ -569,7 +569,7 @@ void ST7920_Lite_Status_Screen::draw_extruder_2_temp(const int16_t temp, const i
display_state.E2_show_target = show_target;
}
#if HAS_HEATER_BED
#if HAS_HEATED_BED
void ST7920_Lite_Status_Screen::draw_bed_temp(const int16_t temp, const int16_t target, bool forceUpdate) {
const bool show_target = target && FAR(temp, target);
draw_temps(2
@ -680,7 +680,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
#if EXTRUDERS == 2
const int16_t extruder_2_target = thermalManager.degTargetHotend(1);
#endif
#if HAS_HEATER_BED
#if HAS_HEATED_BED
const int16_t bed_target = thermalManager.degTargetBed();
#endif
static uint16_t last_checksum = 0;
@ -688,7 +688,7 @@ bool ST7920_Lite_Status_Screen::indicators_changed() {
#if EXTRUDERS == 2
^ extruder_2_target
#endif
#if HAS_HEATER_BED
#if HAS_HEATED_BED
^ bed_target
#endif
;
@ -709,7 +709,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
const int16_t extruder_2_temp = thermalManager.degHotend(1),
extruder_2_target = thermalManager.degTargetHotend(1);
#endif
#if HAS_HEATER_BED
#if HAS_HEATED_BED
const int16_t bed_temp = thermalManager.degBed(),
bed_target = thermalManager.degTargetBed();
#endif
@ -718,7 +718,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
#if EXTRUDERS == 2
draw_extruder_2_temp(extruder_2_temp, extruder_2_target, forceUpdate);
#endif
#if HAS_HEATER_BED
#if HAS_HEATED_BED
draw_bed_temp(bed_temp, bed_target, forceUpdate);
#endif
draw_fan_speed(fan_speed);
@ -727,7 +727,7 @@ void ST7920_Lite_Status_Screen::update_indicators(const bool forceUpdate) {
// Update the fan and bed animations
if (fan_speed > 0) draw_fan_icon(blink);
#if HAS_HEATER_BED
#if HAS_HEATED_BED
if (bed_target > 0)
draw_heat_icon(blink, true);
else