Prevent bed temperature being set too high

2.0.x
Scott Lahteine 8 years ago
parent 493f0b0c62
commit b0eae68f57

@ -67,8 +67,11 @@ float Temperature::current_temperature[HOTENDS] = { 0.0 },
Temperature::current_temperature_bed = 0.0;
int16_t Temperature::current_temperature_raw[HOTENDS] = { 0 },
Temperature::target_temperature[HOTENDS] = { 0 },
Temperature::current_temperature_bed_raw = 0,
Temperature::target_temperature_bed = 0;
Temperature::current_temperature_bed_raw = 0;
#if HAS_HEATER_BED
int16_t Temperature::target_temperature_bed = 0;
#endif
#if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT)
float Temperature::redundant_temperature = 0.0;

@ -92,6 +92,10 @@ enum ADCSensorState {
#define ACTUAL_ADC_SAMPLES max(int(MIN_ADC_ISR_LOOPS), int(SensorsReady))
#if !HAS_HEATER_BED
constexpr int16_t target_temperature_bed = 0;
#endif
class Temperature {
public:
@ -100,8 +104,11 @@ class Temperature {
current_temperature_bed;
static int16_t current_temperature_raw[HOTENDS],
target_temperature[HOTENDS],
current_temperature_bed_raw,
target_temperature_bed;
current_temperature_bed_raw;
#if HAS_HEATER_BED
static int16_t target_temperature_bed;
#endif
static volatile bool in_temp_isr;
@ -382,10 +389,18 @@ class Temperature {
}
static void setTargetBed(const int16_t celsius) {
target_temperature_bed = celsius;
#if HAS_HEATER_BED
target_temperature_bed =
#ifdef BED_MAXTEMP
min(celsius, BED_MAXTEMP)
#else
celsius
#endif
;
#if WATCH_THE_BED
start_watching_bed();
#endif
#endif
}
static bool isHeatingHotend(uint8_t e) {

Loading…
Cancel
Save