aboutsummaryrefslogtreecommitdiff
path: root/arch/avr32dd20.c
diff options
context:
space:
mode:
authorSelene ToyKeeper2024-03-29 08:21:24 -0600
committerSelene ToyKeeper2024-03-29 08:21:24 -0600
commit849bc5951b27f3f6296d28e8f62f2077e811e2ad (patch)
tree96939f9b03267c410bb211427f5ca346dc75df04 /arch/avr32dd20.c
parentd3aa weak battery test: blink 3x instead of 2x, and omit number readout (diff)
parentuse smooth steps in lockout mode, if enabled (diff)
downloadanduril-849bc5951b27f3f6296d28e8f62f2077e811e2ad.tar.gz
anduril-849bc5951b27f3f6296d28e8f62f2077e811e2ad.tar.bz2
anduril-849bc5951b27f3f6296d28e8f62f2077e811e2ad.zip
Merge branch 'trunk' into emisar-d3aa
FIXME: The d3aa's voltage calculator needs to be fixed after this merge. * trunk: use smooth steps in lockout mode, if enabled fixed Tactical Mode's strobes when Momentary Mode not enabled increased voltage precision from 0.025V to 0.02V (so 0 to 255 now goes from 0.00V to 5.10V) fixed inaccurate comment (thanks to xikteny for spotting it) Allow manually running GitHub actions workflows Bugfix: Prevent switching channel modes when in tactical mode Bugfix: Tactical mode has a dependency on momentary mode
Diffstat (limited to 'arch/avr32dd20.c')
-rw-r--r--arch/avr32dd20.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/avr32dd20.c b/arch/avr32dd20.c
index 2ac3526..3ada2ee 100644
--- a/arch/avr32dd20.c
+++ b/arch/avr32dd20.c
@@ -141,10 +141,10 @@ inline uint16_t mcu_adc_result() {
inline uint8_t mcu_vdd_raw2cooked(uint16_t measurement) {
// In : 65535 * (Vbat / 10) / 1.024V
- // Out: uint8_t: Vbat * 40
+ // Out: uint8_t: Vbat * 50
// (add 80 to round up near a boundary)
- uint8_t vbat40 = (uint16_t)(measurement + 80) / 160;
- return vbat40;
+ uint8_t vbat50 = (uint16_t)(measurement + 64) / 128;
+ return vbat50;
}
#if 0