aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-08-26 02:36:10 -0600
committerSelene ToyKeeper2017-08-26 02:36:10 -0600
commit0fe75816cb002c442be774a420bc0563344dd4c6 (patch)
treeb91c48c1b25e39501c44c56219ad4ce5b3b181de
parentMade 4bar and 8bar battcheck styles work. (diff)
downloadanduril-0fe75816cb002c442be774a420bc0563344dd4c6.tar.gz
anduril-0fe75816cb002c442be774a420bc0563344dd4c6.tar.bz2
anduril-0fe75816cb002c442be774a420bc0563344dd4c6.zip
Added a temperature check mode to ramping-ui, mostly for testing purposes.
-rw-r--r--spaghetti-monster/ramping-ui.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/spaghetti-monster/ramping-ui.c b/spaghetti-monster/ramping-ui.c
index 003f3de..2369686 100644
--- a/spaghetti-monster/ramping-ui.c
+++ b/spaghetti-monster/ramping-ui.c
@@ -36,6 +36,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg);
uint8_t strobe_state(EventPtr event, uint16_t arg);
#ifdef USE_BATTCHECK
uint8_t battcheck_state(EventPtr event, uint16_t arg);
+uint8_t tempcheck_state(EventPtr event, uint16_t arg);
#endif
// brightness control
@@ -287,6 +288,20 @@ uint8_t battcheck_state(EventPtr event, uint16_t arg) {
set_state(off_state, 0);
return MISCHIEF_MANAGED;
}
+ // 2 clicks: tempcheck mode
+ else if (event == EV_2clicks) {
+ set_state(tempcheck_state, 0);
+ return MISCHIEF_MANAGED;
+ }
+ return EVENT_NOT_HANDLED;
+}
+
+uint8_t tempcheck_state(EventPtr event, uint16_t arg) {
+ // 1 click: off
+ if (event == EV_1click) {
+ set_state(off_state, 0);
+ return MISCHIEF_MANAGED;
+ }
return EVENT_NOT_HANDLED;
}
#endif
@@ -338,5 +353,9 @@ void loop() {
else if (current_state == battcheck_state) {
battcheck();
}
+ else if (current_state == tempcheck_state) {
+ blink_num(projected_temperature>>2);
+ nice_delay_ms(1000);
+ }
#endif
}
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.