diff options
| author | Selene ToyKeeper | 2024-09-22 16:46:40 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2024-09-22 16:46:40 -0600 |
| commit | 89ea4e6f8ac15d3cb12d5562df9681c9d650b5f8 (patch) | |
| tree | 502399ddb1b11bdcdc33388958dba6b200bef379 /ui | |
| parent | Merge branch 'pr90-SammysHP-wurkkos-ts10-lowfet' into trunk (diff) | |
| download | anduril-89ea4e6f8ac15d3cb12d5562df9681c9d650b5f8.tar.gz anduril-89ea4e6f8ac15d3cb12d5562df9681c9d650b5f8.tar.bz2 anduril-89ea4e6f8ac15d3cb12d5562df9681c9d650b5f8.zip | |
cherry-picked hank-lume-x1 code from https://github.com/loneoceans/anduril/commit/d83ebb75dab8c462b7efa841bccc00a136ff15a2
The [PR](https://github.com/ToyKeeper/anduril/pull/37) has a lot of other
stuff in it, so I'm just picking out the parts needed for this particular
light, and leaving the rest for later.
Will need further edits before merging into trunk.
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/anduril/anduril.c | 11 | ||||
| -rw-r--r-- | ui/anduril/momentary-mode.c | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/ui/anduril/anduril.c b/ui/anduril/anduril.c index a7e4199..c4bd99f 100644 --- a/ui/anduril/anduril.c +++ b/ui/anduril/anduril.c @@ -341,7 +341,18 @@ void loop() { #ifdef USE_THERMAL_REGULATION // TODO: blink out therm_ceil during thermal_config_state? else if (state == tempcheck_state) { + // temperature is type int16_t + // but blink_num is uint8_t, so -10 will blink as 246 + #ifdef USE_LONG_BLINK_FOR_NEGATIVE_SIGN + if (temperature < 0){ + blink_negative(); + blink_num(-temperature); + } + else {blink_num(temperature);} + #endif + #ifndef USE_LONG_BLINK_FOR_NEGATIVE_SIGN blink_num(temperature); + #endif nice_delay_ms(1000); } #endif diff --git a/ui/anduril/momentary-mode.c b/ui/anduril/momentary-mode.c index 327302a..31a9411 100644 --- a/ui/anduril/momentary-mode.c +++ b/ui/anduril/momentary-mode.c @@ -7,6 +7,12 @@ #include "anduril/momentary-mode.h" uint8_t momentary_state(Event event, uint16_t arg) { + + // enable OTG mode, if defined + #ifdef USE_OTG_IN_MOMENTARY + POWER_BANK_EN_PORT |= POWER_BANK_EN_PIN; + #endif + // init strobe mode, if relevant #ifdef USE_STROBE_STATE if ((event == EV_enter_state) && (momentary_mode != 0)) { |
