|
|
@ -746,9 +746,28 @@ int16_t Temperature::getHeaterPower(const heater_ind_t heater_id) {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Temperature Error Handlers
|
|
|
|
// Temperature Error Handlers
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inline void loud_kill(PGM_P const lcd_msg) {
|
|
|
|
|
|
|
|
Running = false;
|
|
|
|
|
|
|
|
#if HAS_BUZZER && PIN_EXISTS(BEEPER)
|
|
|
|
|
|
|
|
for (uint8_t i = 20; i--;) {
|
|
|
|
|
|
|
|
WRITE(BEEPER_PIN, HIGH); delay(25);
|
|
|
|
|
|
|
|
WRITE(BEEPER_PIN, LOW); delay(80);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
WRITE(BEEPER_PIN, HIGH);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
kill(lcd_msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) {
|
|
|
|
void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg, PGM_P const lcd_msg) {
|
|
|
|
static bool killed = false;
|
|
|
|
|
|
|
|
if (IsRunning()) {
|
|
|
|
static uint8_t killed = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsRunning()
|
|
|
|
|
|
|
|
#if BOGUS_TEMPERATURE_GRACE_PERIOD
|
|
|
|
|
|
|
|
&& killed == 2
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
) {
|
|
|
|
SERIAL_ERROR_START();
|
|
|
|
SERIAL_ERROR_START();
|
|
|
|
serialprintPGM(serial_msg);
|
|
|
|
serialprintPGM(serial_msg);
|
|
|
|
SERIAL_ECHOPGM(MSG_STOPPED_HEATER);
|
|
|
|
SERIAL_ECHOPGM(MSG_STOPPED_HEATER);
|
|
|
@ -760,27 +779,28 @@ void Temperature::_temp_error(const heater_ind_t heater, PGM_P const serial_msg,
|
|
|
|
SERIAL_EOL();
|
|
|
|
SERIAL_EOL();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(BOGUS_TEMPERATURE_FAILSAFE_OVERRIDE)
|
|
|
|
disable_all_heaters(); // always disable (even for bogus temp)
|
|
|
|
if (!killed) {
|
|
|
|
|
|
|
|
Running = false;
|
|
|
|
|
|
|
|
killed = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
disable_all_heaters();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BUZZER && PIN_EXISTS(BEEPER)
|
|
|
|
#if BOGUS_TEMPERATURE_GRACE_PERIOD
|
|
|
|
for (uint8_t i = 20; i--;) {
|
|
|
|
const millis_t ms = millis();
|
|
|
|
WRITE(BEEPER_PIN, HIGH); delay(25);
|
|
|
|
static millis_t expire_ms;
|
|
|
|
WRITE(BEEPER_PIN, LOW); delay(80);
|
|
|
|
switch (killed) {
|
|
|
|
}
|
|
|
|
case 0:
|
|
|
|
WRITE(BEEPER_PIN, HIGH);
|
|
|
|
expire_ms = ms + BOGUS_TEMPERATURE_GRACE_PERIOD;
|
|
|
|
#endif
|
|
|
|
++killed;
|
|
|
|
|
|
|
|
break;
|
|
|
|
kill(lcd_msg);
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
if (ELAPSED(ms, expire_ms)) ++killed;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
loud_kill(lcd_msg);
|
|
|
|
|
|
|
|
++killed;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
#elif defined(BOGUS_TEMPERATURE_GRACE_PERIOD)
|
|
|
|
disable_all_heaters(); // paranoia
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
UNUSED(killed);
|
|
|
|
UNUSED(killed);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
if (!killed) { killed = 1; loud_kill(lcd_msg); }
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|