diff options
| author | Selene ToyKeeper | 2026-03-14 16:52:44 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2026-03-14 16:52:44 -0600 |
| commit | e7ef591138edc625815b1208ce1e012370621e04 (patch) | |
| tree | 1ce34ca52773118462ade5009f8efdbe08d9897d /arch | |
| parent | added &hank-kr1aa build for new Emisar / Noctigon KR1AA (diff) | |
| parent | calibrated for latest TS26 sample (diff) | |
| download | anduril-e7ef591138edc625815b1208ce1e012370621e04.tar.gz anduril-e7ef591138edc625815b1208ce1e012370621e04.tar.bz2 anduril-e7ef591138edc625815b1208ce1e012370621e04.zip | |
I guess the hardware is shipping now? So, time to release.
I never heard back about some calibration details, particularly about
whether the floor level is reliable on many items or just mine...
but I guess it must have been fine if it's shipping.
* wurkkos-ts26:
calibrated for latest TS26 sample
wurkkos-ts26: increase default floor to 5/150 to reduce flicker (by request)
renamed wurkkos-ts25-boost to wurkkos-ts26
wurkkos ts25-boost: calibrated for 20250210 prototype
ts25-boost: calibrated for new prototype - battery voltage readings - RGB button aux - less moon flicker (but brighter, less efficient moon) - reduced blink brightness (old brightness was so high it was throwing off battery readings)
ts25-boost: reduced visible PWM, made party strobe less blurry
wurkkos-ts25-boost: calibrated the battery voltage measurements
attiny1616 mcu_vdivider_raw2cooked: factor in the offset, not just slope
added wurkkos-ts25-boost (early version made from spec, no clue if it works)
# Conflicts:
# MODELS
Diffstat (limited to '')
| -rw-r--r-- | arch/attiny1616.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/attiny1616.c b/arch/attiny1616.c index 02e64b1..5d46111 100644 --- a/arch/attiny1616.c +++ b/arch/attiny1616.c @@ -129,14 +129,15 @@ inline uint16_t mcu_vdd_raw2fine(uint16_t measurement) { #ifdef USE_VOLTAGE_DIVIDER inline uint8_t mcu_vdivider_raw2cooked(uint16_t measurement) { - // In : 4095 * Vdiv / 1.1V + // In : (4095 * Vdiv / 1.1V) << 4 // Out: uint8_t: Vbat * 50 // Vdiv = Vbat / 4.3 (typically) // 1.1 = ADC Vref const uint16_t adc_per_volt = (((uint16_t)ADC_44 << 4) - ((uint16_t)ADC_22 << 4)) / (dV * (44-22)); - uint8_t result = measurement / adc_per_volt; + const uint16_t adc_offset = (ADC_22 - (ADC_44 - ADC_22)) << 4; + uint8_t result = (measurement - adc_offset) / adc_per_volt; return result; } #endif |
