From a68560963d9dd7a16982bc67d5b5ef100a51c8a6 Mon Sep 17 00:00:00 2001 From: Selene ToyKeeper Date: Mon, 5 Aug 2019 21:34:37 -0600 Subject: fixed weird ramp behavior on D1S v2 (by trusting the compiler more) --- spaghetti-monster/fsm-ramping.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'spaghetti-monster/fsm-ramping.h') 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 -- cgit v1.2.3