From 39b30b41f92978a3e05a8de0a416279fb35b35b1 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Fri, 25 Aug 2017 02:14:31 -0600 Subject: Added battcheck mode to ramping-ui. It's bigger than I had hoped. :( Added fsm-misc.*, which currently only has interruptible blink functions in it. (for blinking out numbers and such) --- spaghetti-monster/fsm-adc.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'spaghetti-monster/fsm-adc.c') diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index 9a6e2e7..70e3bb3 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -263,4 +263,28 @@ ISR(ADC_vect) { #endif } +#ifdef USE_BATTCHECK +#ifdef BATTCHECK_4bars +PROGMEM const uint8_t voltage_blinks[] = { + 30, 35, 38, 40, 42, 99, +}; +#endif +#ifdef BATTCHECK_8bars +PROGMEM const uint8_t voltage_blinks[] = { + 30, 33, 35, 37, 38, 39 40, 41, 42, 99, +}; +#endif +void battcheck() { + #ifdef BATTCHECK_VpT + blink_num(voltage); + #else + uint8_t i; + for(i=0; + voltage >= pgm_read_byte(voltage_blinks + i); + i++) {} + blink_num(i); + #endif +} +#endif + #endif -- cgit v1.2.3