aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/anduril/anduril.c1
-rw-r--r--ui/anduril/aux-leds.c34
-rw-r--r--ui/anduril/config-default.h4
3 files changed, 22 insertions, 17 deletions
diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c
index c434518..1cdb8d0 100644
--- a/ui/anduril/anduril.c
+++ b/ui/anduril/anduril.c
@@ -316,6 +316,7 @@ void loop() {
#ifdef USE_BATTCHECK
else if (state == battcheck_state) {
+ nice_delay_ms(1000); // wait a moment for a more accurate reading
battcheck();
#ifdef USE_SIMPLE_UI
// in simple mode, turn off after one readout
diff --git a/ui/anduril/aux-leds.c b/ui/anduril/aux-leds.c
index dce8d26..fd184fc 100644
--- a/ui/anduril/aux-leds.c
+++ b/ui/anduril/aux-leds.c
@@ -58,27 +58,27 @@ void indicator_led_update(uint8_t mode, uint8_t tick) {
uint8_t voltage_to_rgb() {
static const uint8_t levels[] = {
// voltage, color
- 0, 0, // black
+ 0, 0, // black
#ifdef DUAL_VOLTAGE_FLOOR
// AA / NiMH voltages
- 9, 1, // R
- 10, 2, // R+G
- 11, 3, // G
- 12, 4, // G+B
- 13, 5, // B
- 14, 6, // R + B
- 16, 7, // R+G+B
- 20, 0, // black
+ 4* 9, 1, // R
+ 4*10, 2, // R+G
+ 4*11, 3, // G
+ 4*12, 4, // G+B
+ 4*13, 5, // B
+ 4*14, 6, // R + B
+ 4*16, 7, // R+G+B
+ 4*20, 0, // black
#endif
// li-ion voltages
- 29, 1, // R
- 33, 2, // R+G
- 35, 3, // G
- 37, 4, // G+B
- 39, 5, // B
- 41, 6, // R + B
- 44, 7, // R+G+B // skip; looks too similar to G+B
- 255, 7, // R+G+B
+ 4*29, 1, // R
+ 4*33, 2, // R+G
+ 4*35, 3, // G
+ 4*37, 4, // G+B
+ 4*39, 5, // B
+ 4*41, 6, // R + B
+ 4*44, 7, // R+G+B // skip; looks too similar to G+B
+ 255, 7, // R+G+B
};
uint8_t volts = voltage;
//if (volts < VOLTAGE_LOW) return 0;
diff --git a/ui/anduril/config-default.h b/ui/anduril/config-default.h
index cd25b52..1b34e8c 100644
--- a/ui/anduril/config-default.h
+++ b/ui/anduril/config-default.h
@@ -143,6 +143,10 @@
#define BATTCHECK_VpT
//#define BATTCHECK_8bars // FIXME: breaks build
//#define BATTCHECK_4bars // FIXME: breaks build
+#if ROM_SIZE > 10000
+ // battcheck displays 1.25V instead of 1.2V
+ #define USE_EXTRA_BATTCHECK_DIGIT
+#endif
// allow the user to calibrate the voltage readings?
// (adjust in 0.05V increments from -0.30V to +0.30V)
// (1 = -0.30V, 2 = -0.25V, ... 7 = 0V, ... 13 = +0.30V)