aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2019-08-05 21:34:37 -0600
committerSelene ToyKeeper2019-08-05 21:34:37 -0600
commita68560963d9dd7a16982bc67d5b5ef100a51c8a6 (patch)
tree3b995a6bbe8f6779ec92d7d82d66b06c3ed4a790
parentanduril: allow RGB LEDs to stay on (in voltage mode) while main LEDs are on (diff)
downloadanduril-a68560963d9dd7a16982bc67d5b5ef100a51c8a6.tar.gz
anduril-a68560963d9dd7a16982bc67d5b5ef100a51c8a6.tar.bz2
anduril-a68560963d9dd7a16982bc67d5b5ef100a51c8a6.zip
fixed weird ramp behavior on D1S v2 (by trusting the compiler more)
-rw-r--r--spaghetti-monster/fsm-ramping.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/spaghetti-monster/fsm-ramping.h b/spaghetti-monster/fsm-ramping.h
index 7233474..24c19c0 100644
--- a/spaghetti-monster/fsm-ramping.h
+++ b/spaghetti-monster/fsm-ramping.h
@@ -47,7 +47,10 @@ void gradual_tick();
#define PWM_GET(x,y) pgm_read_byte(x+y)
#else
#define PWM_DATATYPE uint16_t
-#define PWM_GET(x,y) pgm_read_word(x+(2*y))
+// pointer plus 2*y bytes
+//#define PWM_GET(x,y) pgm_read_word(x+(2*y))
+// nope, the compiler was already doing the math correctly
+#define PWM_GET(x,y) pgm_read_word(x+y)
#endif
// use UI-defined ramp tables if they exist
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.