Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Marlin/src/HAL/HAL_STM32F1/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ uint8 adc_pins[] = {
#if HAS_TEMP_4
TEMP_4_PIN,
#endif
#if HAS_TEMP_BED
#if HAS_HEATED_BED
TEMP_BED_PIN,
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
Expand All @@ -104,7 +104,7 @@ enum TEMP_PINS : char {
#if HAS_TEMP_4
TEMP_4,
#endif
#if HAS_TEMP_BED
#if HAS_HEATED_BED
TEMP_BED,
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
Expand Down Expand Up @@ -211,7 +211,7 @@ void HAL_adc_start_conversion(const uint8_t adc_pin) {
#if HAS_TEMP_4
case TEMP_4_PIN: pin_index = TEMP_4; break;
#endif
#if HAS_TEMP_BED
#if HAS_HEATED_BED
case TEMP_BED_PIN: pin_index = TEMP_BED; break;
#endif
#if ENABLED(FILAMENT_WIDTH_SENSOR)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/feature/leds/tempstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void handle_status_leds(void) {
if (ELAPSED(millis(), next_status_led_update_ms)) {
next_status_led_update_ms += 500; // Update every 0.5s
float max_temp = 0.0;
#if HAS_TEMP_BED
#if HAS_HEATED_BED
max_temp = MAX3(max_temp, thermalManager.degTargetBed(), thermalManager.degBed());
#endif
HOTEND_LOOP()
Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/feature/power_loss_recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ static char sd_filename[MAXPATHNAMELENGTH];
SERIAL_PROTOCOLPAIR("leveling: ", int(job_recovery_info.leveling));
SERIAL_PROTOCOLLNPAIR(" fade: ", int(job_recovery_info.fade));
#endif
SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
#if HAS_HEATED_BED
SERIAL_PROTOCOLLNPAIR("target_temperature_bed: ", job_recovery_info.target_temperature_bed);
#endif
SERIAL_PROTOCOLLNPAIR("cmd_queue_index_r: ", job_recovery_info.cmd_queue_index_r);
SERIAL_PROTOCOLLNPAIR("commands_in_queue: ", job_recovery_info.commands_in_queue);
if (recovery)
Expand Down Expand Up @@ -196,7 +198,9 @@ void save_job_recovery_info() {
COPY(job_recovery_info.current_position, current_position);
job_recovery_info.feedrate = feedrate_mm_s;
COPY(job_recovery_info.target_temperature, thermalManager.target_temperature);
job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
#if HAS_HEATED_BED
job_recovery_info.target_temperature_bed = thermalManager.target_temperature_bed;
#endif
COPY(job_recovery_info.fanSpeeds, fanSpeeds);

#if HAS_LEVELING
Expand Down
5 changes: 4 additions & 1 deletion Marlin/src/feature/power_loss_recovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ typedef struct {
// Machine state
float current_position[NUM_AXIS], feedrate;
int16_t target_temperature[HOTENDS],
target_temperature_bed,
fanSpeeds[FAN_COUNT];

#if HAS_HEATED_BED
int16_t target_temperature_bed;
#endif

#if HAS_LEVELING
bool leveling;
float fade;
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ inline bool look_for_lines_to_connect() {
*/
inline bool turn_on_heaters() {
millis_t next = millis() + 5000UL;
#if HAS_TEMP_BED
#if HAS_HEATED_BED
#if ENABLED(ULTRA_LCD)
if (g26_bed_temp > 25) {
lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
Expand Down Expand Up @@ -839,7 +839,7 @@ void GcodeSuite::G26() {
#endif

if (!g26_keep_heaters_on) {
#if HAS_TEMP_BED
#if HAS_HEATED_BED
thermalManager.setTargetBed(0);
#endif
thermalManager.setTargetHotend(0, 0);
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ void GcodeSuite::process_parsed_command(
case 113: M113(); break; // M113: Set Host Keepalive interval
#endif

#if HAS_HEATER_BED && HAS_TEMP_BED
#if HAS_HEATED_BED
case 140: M140(); break; // M140: Set bed temperature
case 190: M190(); break; // M190: Wait for bed temperature to reach target
#endif
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ class GcodeSuite {
#endif
#endif

#if HAS_HEATER_BED && HAS_TEMP_BED
#if HAS_HEATED_BED
static void M140();
static void M190();
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/temperature/M140_M190.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "../../inc/MarlinConfig.h"

#if HAS_HEATER_BED && HAS_TEMP_BED
#if HAS_HEATED_BED

#include "../gcode.h"
#include "../../module/temperature.h"
Expand Down Expand Up @@ -177,4 +177,4 @@ void GcodeSuite::M190() {
#endif
}

#endif // HAS_HEATER_BED && HAS_TEMP_BED
#endif // HAS_HEATED_BED
8 changes: 5 additions & 3 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,6 @@
#define HAS_TEMP_HOTEND (HAS_TEMP_0 || ENABLED(HEATER_0_USES_MAX6675))
#define HAS_TEMP_BED (PIN_EXISTS(TEMP_BED) && TEMP_SENSOR_BED != 0 && TEMP_SENSOR_BED > -2)
#define HAS_TEMP_CHAMBER (PIN_EXISTS(TEMP_CHAMBER) && TEMP_SENSOR_CHAMBER != 0 && TEMP_SENSOR_CHAMBER > -2)
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_TEMP_BED || HAS_TEMP_CHAMBER)

// Heaters
#define HAS_HEATER_0 (PIN_EXISTS(HEATER_0))
Expand All @@ -774,8 +773,11 @@
#define HAS_HEATER_4 (PIN_EXISTS(HEATER_4))
#define HAS_HEATER_BED (PIN_EXISTS(HEATER_BED))

#define HAS_HEATED_BED (HAS_TEMP_BED && HAS_HEATER_BED)
#define HAS_TEMP_SENSOR (HAS_TEMP_HOTEND || HAS_HEATED_BED || HAS_TEMP_CHAMBER)

// Thermal protection
#define HAS_THERMALLY_PROTECTED_BED (ENABLED(THERMAL_PROTECTION_BED) && HAS_TEMP_BED && HAS_HEATER_BED)
#define HAS_THERMALLY_PROTECTED_BED (HAS_HEATED_BED && ENABLED(THERMAL_PROTECTION_BED))
#define WATCH_HOTENDS (ENABLED(THERMAL_PROTECTION_HOTENDS) && WATCH_TEMP_PERIOD > 0)
#define WATCH_THE_BED (HAS_THERMALLY_PROTECTED_BED && WATCH_BED_TEMP_PERIOD > 0)

Expand Down Expand Up @@ -897,7 +899,7 @@
/**
* Heated bed requires settings
*/
#if HAS_HEATER_BED
#if HAS_HEATED_BED
#ifndef MAX_BED_POWER
#define MAX_BED_POWER 255
#endif
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/dogm/dogm_bitmaps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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)

Expand Down
40 changes: 28 additions & 12 deletions Marlin/src/lcd/dogm/status_screen_DOGM.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,40 +45,56 @@ 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;
#endif

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);
}
}
}

Expand Down Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions Marlin/src/lcd/dogm/status_screen_lite_ST7920.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -680,15 +680,15 @@ 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;
const uint16_t checksum = blink ^ feedrate_perc ^ fan_speed ^ extruder_1_target
#if EXTRUDERS == 2
^ extruder_2_target
#endif
#if HAS_HEATER_BED
#if HAS_HEATED_BED
^ bed_target
#endif
;
Expand All @@ -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
Expand All @@ -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);
Expand All @@ -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
Expand Down
Loading