aboutsummaryrefslogtreecommitdiff
path: root/fsm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--fsm/chan-aux.c2
-rw-r--r--fsm/chan-rgbaux.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/fsm/chan-aux.c b/fsm/chan-aux.c
index e04e6a2..239316a 100644
--- a/fsm/chan-aux.c
+++ b/fsm/chan-aux.c
@@ -4,7 +4,7 @@
#pragma once
void set_level_aux(uint8_t level) {
- indicator_led(!(!(level)) << 1); // high (or off)
+ indicator_led((!(!(level)) << 1) + 1); // high (level > 0) or low
}
bool gradual_tick_null(uint8_t gt) { return true; } // do nothing
diff --git a/fsm/chan-rgbaux.c b/fsm/chan-rgbaux.c
index 19d18a6..a66c29e 100644
--- a/fsm/chan-rgbaux.c
+++ b/fsm/chan-rgbaux.c
@@ -4,31 +4,31 @@
#pragma once
void set_level_auxred(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b000010); // red, high (or off)
+ rgb_led_set(0b000001 << !(!(level))); // red, high (level > 0) or low
}
void set_level_auxyel(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b001010); // red+green, high (or off)
+ rgb_led_set(0b000101 << !(!(level))); // red+green, high (level > 0) or low
}
void set_level_auxgrn(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b001000); // green, high (or off)
+ rgb_led_set(0b000100 << !(!(level))); // green, high (level > 0) or low
}
void set_level_auxcyn(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b101000); // green+blue, high (or off)
+ rgb_led_set(0b010100 << !(!(level))); // green+blue, high (level > 0) or low
}
void set_level_auxblu(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b100000); // blue, high (or off)
+ rgb_led_set(0b010000 << !(!(level))); // blue, high (level > 0) or low
}
void set_level_auxprp(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b100010); // red+blue, high (or off)
+ rgb_led_set(0b010001 << !(!(level))); // red+blue, high (level > 0) or low
}
void set_level_auxwht(uint8_t level) {
- rgb_led_set(!(!(level)) * 0b101010); // red+green+blue, high (or off)
+ rgb_led_set(0b010101 << !(!(level))); // red+green+blue, high (level > 0) or low
}
bool gradual_tick_null(uint8_t gt) { return true; } // do nothing
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.