Fix the XIAO battery reading: busy-wait for the divider to settle

At CONFIG_FREERTOS_HZ=100 pdMS_TO_TICKS(5) is zero ticks, so the switched divider
had not settled when the ADC was read and battery_mv came out as 0. Wait 5 ms with
esp_rom_delay_us and configure GPIO26 with gpio_config. The XIAO on COM10 now
reads 4153-4156 mV on a charging cell.
This commit is contained in:
Ashin Walpola
2026-11-11 14:17:38 +01:00
parent 6f99154b23
commit c78b66341b
3 changed files with 16 additions and 3 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ because nothing was transmitting nearby and no phone ran the updated app:
- [ ] Unsigned CAM from the phone (Sign outgoing messages off) is heard by a second ESP32-C5 receiver (`obu-firmware/test/pcap_gn_tally.py` on its capture).
- [ ] Signed CAM with the demo chain: tickets=1 and `signed` counts up in STATUS, `obu-firmware/test/verify_signed_pcap.py` accepts the capture.
- [ ] BLE: pairing with passkey 123456, bond survives a reconnect (80 KB NVS), TX while connected (TX BLE guard).
- [ ] Battery: with a cell on the BAT pads, `battery` in STATUS matches a multimeter; the shutdown rule is untested on hardware.
- [ ] Battery: reads 4153-4156 mV on the charging cell (COM10, 2026-11-11, after the settle-time fix); still to compare with a multimeter on the cell, and the shutdown rule is untested on hardware.
### MAPEM decoder and traffic lights per lane (added 2026-10-28)