aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schubert2026-04-02 21:53:09 +0200
committerChristian Schubert2026-04-02 21:53:09 +0200
commitd2b281ccbd8b1b49050bdf44e7573b954869567f (patch)
treea1f66b0c6e33a76ea9ced59efbe614c248ef39a6
parentadjust timing/comments (diff)
downloadanduril-d2b281ccbd8b1b49050bdf44e7573b954869567f.tar.gz
anduril-d2b281ccbd8b1b49050bdf44e7573b954869567f.tar.bz2
anduril-d2b281ccbd8b1b49050bdf44e7573b954869567f.zip
detect_weak_battery() on powerup
-rw-r--r--ui/simple/simple.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/simple/simple.c b/ui/simple/simple.c
index 125ce2d..12184df 100644
--- a/ui/simple/simple.c
+++ b/ui/simple/simple.c
@@ -201,6 +201,10 @@ void low_voltage(void) {
}
void setup(void) {
+ #ifdef USE_WEAK_BATTERY_PROTECTION
+ detect_weak_battery();
+ #endif
+
if (load_eeprom()) {
if (eeprom[0] < NUM_LEVELS)
current_level_idx = eeprom[0];
@@ -208,6 +212,20 @@ void setup(void) {
push_state(off_state, 0);
}
+#ifndef BLINK_BRIGHTNESS
+#define BLINK_BRIGHTNESS (MAX_LEVEL/6)
+#endif
+
+void blink_once() {
+ uint8_t brightness = actual_level;
+ uint8_t bump = brightness + BLINK_BRIGHTNESS;
+ if (bump > MAX_LEVEL) bump = BLIP_LEVEL;
+
+ set_level(bump);
+ delay_4ms(BLINK_ONCE_TIME/4);
+ set_level(brightness);
+}
+
void loop(void) {
StatePtr state = current_state;
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.