From d8f58fcbd5f35d9d2140a4bcaa6589e1c2962198 Mon Sep 17 00:00:00 2001 From: Gabriel Hart Date: Tue, 12 Jan 2021 13:12:57 -0600 Subject: Add Sofirn SP10S (adapter) and dual-voltage logic --- spaghetti-monster/fsm-adc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spaghetti-monster/fsm-adc.c') diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index 2818731..975d12e 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -341,7 +341,11 @@ static inline void ADC_voltage_handler() { if (lvp_timer) { lvp_timer --; } else { // it has been long enough since the last warning + #ifdef DUAL_VOLTAGE_FLOOR + if (((voltage < VOLTAGE_LOW) && (voltage > DUAL_VOLTAGE_FLOOR)) || (voltage < DUAL_VOLTAGE_LOW_LOW)) { + #else if (voltage < VOLTAGE_LOW) { + #endif // send out a warning emit(EV_voltage_low, 0); // reset rate-limit counter -- cgit v1.2.3