aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/anduril/aux-leds.c39
-rw-r--r--ui/anduril/tactical-mode.c5
2 files changed, 23 insertions, 21 deletions
diff --git a/ui/anduril/aux-leds.c b/ui/anduril/aux-leds.c
index fd184fc..7356666 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
- 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
+ 9*dV, 1, // R
+ 10*dV, 2, // R+G
+ 11*dV, 3, // G
+ 12*dV, 4, // G+B
+ 13*dV, 5, // B
+ 14*dV, 6, // R + B
+ 16*dV, 7, // R+G+B
+ 20*dV, 0, // black
#endif
// li-ion voltages
- 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
+ 29*dV, 1, // R
+ 33*dV, 2, // R+G
+ 35*dV, 3, // G
+ 37*dV, 4, // G+B
+ 39*dV, 5, // B
+ 41*dV, 6, // R + B
+ 44*dV, 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;
@@ -151,11 +151,8 @@ void rgb_led_update(uint8_t mode, uint16_t arg) {
else { // voltage
// show actual voltage while asleep...
if (go_to_standby) {
- actual_color = voltage_to_rgb();
// choose a color based on battery voltage
- //if (volts >= 38) actual_color = pgm_read_byte(colors + 4);
- //else if (volts >= 33) actual_color = pgm_read_byte(colors + 2);
- //else actual_color = pgm_read_byte(colors + 0);
+ actual_color = voltage_to_rgb();
}
// ... but during preview, cycle colors quickly
else {
diff --git a/ui/anduril/tactical-mode.c b/ui/anduril/tactical-mode.c
index 5acd902..002f917 100644
--- a/ui/anduril/tactical-mode.c
+++ b/ui/anduril/tactical-mode.c
@@ -68,6 +68,11 @@ uint8_t tactical_state(Event event, uint16_t arg) {
return lockout_state(event, arg);
}
+ // handle 3C here to prevent changing channel modes unintentionally
+ if (event == EV_3clicks) {
+ return EVENT_HANDLED;
+ }
+
// 6 clicks: exit and turn off
else if (event == EV_6clicks) {
blink_once();