aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster/fsm-adc.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-09-14 03:15:50 -0600
committerSelene ToyKeeper2020-09-14 03:15:50 -0600
commitb8fd5ee8cc6a04a2c214f80c51269a68802309d8 (patch)
tree34d8006cf13d977b5726554d421089e8dd7aeede /spaghetti-monster/fsm-adc.h
parentreorganized code in fsm-events.* to put things in a more coherent order (diff)
parentsteps.py: fixed python3 floating-point error (diff)
downloadanduril-b8fd5ee8cc6a04a2c214f80c51269a68802309d8.tar.gz
anduril-b8fd5ee8cc6a04a2c214f80c51269a68802309d8.tar.bz2
anduril-b8fd5ee8cc6a04a2c214f80c51269a68802309d8.zip
merged upstream fsm branch to get fix for laggy voltage readings on FW3A
(and other build targets which don't use sleep ticks during standby)
Diffstat (limited to 'spaghetti-monster/fsm-adc.h')
-rw-r--r--spaghetti-monster/fsm-adc.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-adc.h b/spaghetti-monster/fsm-adc.h
index 56583bb..fc24712 100644
--- a/spaghetti-monster/fsm-adc.h
+++ b/spaghetti-monster/fsm-adc.h
@@ -21,6 +21,12 @@
#define FSM_ADC_H
+#if defined(USE_LVP) || defined(USE_THERMAL_REGULATION)
+// use raw value instead of lowpassed value for the next N measurements
+// (2 = 1 for voltage + 1 for temperature)
+volatile uint8_t adc_reset = 2;
+#endif
+
#ifdef USE_LVP
// default 5 seconds between low-voltage warning events
#ifndef VOLTAGE_WARNING_SECONDS
@@ -90,7 +96,6 @@ void battcheck();
int16_t temperature;
uint8_t therm_ceil = DEFAULT_THERM_CEIL;
int8_t therm_cal_offset = 0;
-volatile uint8_t reset_thermal_history = 1;
static inline void ADC_temperature_handler();
#endif // ifdef USE_THERMAL_REGULATION