diff options
| author | Selene ToyKeeper | 2023-11-19 01:56:17 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-11-19 01:56:17 -0700 |
| commit | 76db685f66baa7787ad94ce91585e7cba8b94cfb (patch) | |
| tree | 29499c612872908c7232984655aa65bcb70d3056 /fsm/adc.h | |
| parent | added dac-scale.py: short script to calculate avrdd DAC+Vref values from leve... (diff) | |
| download | anduril-76db685f66baa7787ad94ce91585e7cba8b94cfb.tar.gz anduril-76db685f66baa7787ad94ce91585e7cba8b94cfb.tar.bz2 anduril-76db685f66baa7787ad94ce91585e7cba8b94cfb.zip | |
started refactoring fsm/adc.*, but need a checkpoint before continuing
Diffstat (limited to '')
| -rw-r--r-- | fsm/adc.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -32,6 +32,9 @@ volatile uint8_t adc_reset = 2; #endif #endif + +void adc_voltage_mode(); + #ifdef TICK_DURING_STANDBY volatile uint8_t adc_active_now = 0; // sleep LVP needs a different sleep mode #endif @@ -103,14 +106,16 @@ static inline void ADC_temperature_handler(); //inline void ADC_on(); -#define ADC_on mcu_adc_on +#define ADC_on adc_voltage_mode //inline void ADC_off(); #define ADC_off mcu_adc_off //inline void ADC_start_measurement(); #define ADC_start_measurement mcu_adc_start_measurement -#ifdef TICK_DURING_STANDBY - //inline void adc_sleep_mode(); - #define adc_sleep_mode mcu_adc_sleep_mode -#endif +// needs a special sleep mode to get accurate measurements quickly +// ... full power-down ends up using more power overall, and causes +// some weird issues when the MCU doesn't stay awake enough cycles +// to complete a reading +//inline void adc_sleep_mode(); +#define adc_sleep_mode mcu_adc_sleep_mode |
