diff options
| author | Selene ToyKeeper | 2019-11-24 16:21:40 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-11-24 16:21:40 -0700 |
| commit | 30510a7948815f3092b8a2eff3321ad85ed5c480 (patch) | |
| tree | 4a1b68628c779bf4092a64ae027917529d03e158 /spaghetti-monster/fsm-adc.h | |
| parent | merged changes from fsm branch, including version check and stuck-button safety (diff) | |
| parent | added -fwhole-program gcc flag, suggested by Agro. Signficantly reduces ROM ... (diff) | |
| download | anduril-30510a7948815f3092b8a2eff3321ad85ed5c480.tar.gz anduril-30510a7948815f3092b8a2eff3321ad85ed5c480.tar.bz2 anduril-30510a7948815f3092b8a2eff3321ad85ed5c480.zip | |
merged from upstream fsm branch to get a whole bunch of kernel-level improvements
Diffstat (limited to 'spaghetti-monster/fsm-adc.h')
| -rw-r--r-- | spaghetti-monster/fsm-adc.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spaghetti-monster/fsm-adc.h b/spaghetti-monster/fsm-adc.h index 274fb4d..6e39750 100644 --- a/spaghetti-monster/fsm-adc.h +++ b/spaghetti-monster/fsm-adc.h @@ -38,9 +38,18 @@ #define VOLTAGE_FUDGE_FACTOR 5 #endif #endif + +volatile uint8_t irq_adc = 0; // ADC interrupt happened? +volatile uint8_t irq_adc_stable = 0; // have we passed the 1st junk value yet? +uint8_t adc_channel = 0; // 0=voltage, 1=temperature +uint16_t adc_values[2]; // last ADC measurements (0=voltage, 1=temperature) +uint8_t adcint_enable = 0; // is the current ADC result needed? +void ADC_inner(); // do the actual ADC-related calculations + +static inline void ADC_voltage_handler(); volatile uint8_t voltage = 0; -volatile uint8_t adcint_enable; // kludge, because adc auto-retrigger won't turn off void low_voltage(); + #ifdef USE_BATTCHECK void battcheck(); #ifdef BATTCHECK_VpT @@ -50,7 +59,7 @@ void battcheck(); #define USE_BLINK_DIGIT #endif #endif -#endif +#endif // ifdef USE_LVP #ifdef USE_THERMAL_REGULATION @@ -79,7 +88,8 @@ int8_t therm_cal_offset = 0; //void low_temperature(); //void high_temperature(); volatile uint8_t reset_thermal_history = 1; -#endif +static inline void ADC_temperature_handler(); +#endif // ifdef USE_THERMAL_REGULATION inline void ADC_on(); |
