aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-05-14 19:09:02 -0600
committerSelene ToyKeeper2020-05-14 19:09:02 -0600
commitea1e6af54193a119c96af313c99fac25af917cb8 (patch)
treea4adccdbdc94c4be8a1ef36fe5696d9bee3c6efb
parentgave Werner's UI a simple Makefile (diff)
downloadanduril-ea1e6af54193a119c96af313c99fac25af917cb8.tar.gz
anduril-ea1e6af54193a119c96af313c99fac25af917cb8.tar.bz2
anduril-ea1e6af54193a119c96af313c99fac25af917cb8.zip
fixed compile error when all strobe modes are disabled
-rw-r--r--spaghetti-monster/anduril/anduril.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/spaghetti-monster/anduril/anduril.c b/spaghetti-monster/anduril/anduril.c
index a23b2e1..167c14d 100644
--- a/spaghetti-monster/anduril/anduril.c
+++ b/spaghetti-monster/anduril/anduril.c
@@ -1854,9 +1854,11 @@ uint8_t momentary_state(Event event, uint16_t arg) {
// TODO: momentary strobe here? (for light painting)
// init strobe mode, if relevant
+ #ifdef USE_STROBE_STATE
if ((event == EV_enter_state) && (momentary_mode == 1)) {
strobe_state(event, arg);
}
+ #endif
// light up when the button is pressed; go dark otherwise
// button is being held
@@ -1882,6 +1884,7 @@ uint8_t momentary_state(Event event, uint16_t arg) {
// disconnected for several seconds, so we want to be awake when that
// happens to speed up the process)
else if (event == EV_tick) {
+ #ifdef USE_STROBE_STATE
if (momentary_active) {
// 0 = ramping, 1 = strobes
if (momentary_mode == 1) {
@@ -1889,6 +1892,7 @@ uint8_t momentary_state(Event event, uint16_t arg) {
}
}
else {
+ #endif
if (arg > TICKS_PER_SECOND*5) { // sleep after 5 seconds
go_to_standby = 1; // sleep while light is off
// turn off lighted button
@@ -1898,7 +1902,9 @@ uint8_t momentary_state(Event event, uint16_t arg) {
rgb_led_update(0, 0);
#endif
}
+ #ifdef USE_STROBE_STATE
}
+ #endif
return MISCHIEF_MANAGED;
}
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.