aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
authorSelene ToyKeeper2017-08-24 03:20:06 -0600
committerSelene ToyKeeper2017-08-24 03:20:06 -0600
commitaa7e15ca8e13867b4edcbb1cbde2bca496fc764f (patch)
tree448ca6b6820201ac7ca400052e795e5a5efd4bcd /spaghetti-monster
parentDon't send underheat warnings when LVP is active. The signals conflict. (diff)
downloadanduril-aa7e15ca8e13867b4edcbb1cbde2bca496fc764f.tar.gz
anduril-aa7e15ca8e13867b4edcbb1cbde2bca496fc764f.tar.bz2
anduril-aa7e15ca8e13867b4edcbb1cbde2bca496fc764f.zip
Fixed repeating blinks at ends of ramp -- only blinks once now.
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/ramping-ui.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/spaghetti-monster/ramping-ui.c b/spaghetti-monster/ramping-ui.c
index c85804d..6eeb3b0 100644
--- a/spaghetti-monster/ramping-ui.c
+++ b/spaghetti-monster/ramping-ui.c
@@ -149,6 +149,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
}
// hold: change brightness (brighter)
else if (event == EV_click1_hold) {
+ // ramp slower in discrete mode
if (arg % ramp_step_size != 0) {
return 0;
}
@@ -159,8 +160,10 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#ifdef USE_THERMAL_REGULATION
target_level = memorized_level;
#endif
- // FIXME: only blink once
- if ((memorized_level == MAX_1x7135) || (memorized_level == MAX_LEVEL)) {
+ // only blink once for each threshold
+ if ((memorized_level != actual_level)
+ && ((memorized_level == MAX_1x7135)
+ || (memorized_level == MAX_LEVEL))) {
set_level(0);
delay_ms(7);
}
@@ -169,6 +172,7 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
}
// click-release-hold: change brightness (dimmer)
else if (event == EV_click2_hold) {
+ // ramp slower in discrete mode
if (arg % ramp_step_size != 0) {
return 0;
}
@@ -180,8 +184,10 @@ uint8_t steady_state(EventPtr event, uint16_t arg) {
#ifdef USE_THERMAL_REGULATION
target_level = memorized_level;
#endif
- // FIXME: only blink once
- if ((memorized_level == MAX_1x7135) || (memorized_level == 1)) {
+ // only blink once for each threshold
+ if ((memorized_level != actual_level)
+ && ((memorized_level == MAX_1x7135)
+ || (memorized_level == 1))) {
set_level(0);
delay_ms(7);
}
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.