|
@@ -186,8 +186,14 @@ class PrintJobRecovery {
|
186
|
186
|
|
187
|
187
|
#if PIN_EXISTS(POWER_LOSS)
|
188
|
188
|
static inline void outage() {
|
189
|
|
- if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE)
|
190
|
|
- _outage();
|
|
189
|
+ static constexpr uint8_t OUTAGE_THRESHOLD = 3;
|
|
190
|
+ static uint8_t outage_counter = 0;
|
|
191
|
+ if (enabled && READ(POWER_LOSS_PIN) == POWER_LOSS_STATE) {
|
|
192
|
+ outage_counter++;
|
|
193
|
+ if (outage_counter >= OUTAGE_THRESHOLD) _outage();
|
|
194
|
+ }
|
|
195
|
+ else
|
|
196
|
+ outage_counter = 0;
|
191
|
197
|
}
|
192
|
198
|
#endif
|
193
|
199
|
|