From 97b7a6e84c06be988b5145d7fdd8dfc70e5d6d11 Mon Sep 17 00:00:00 2001 From: Chris Lewis Date: Sat, 18 Aug 2018 22:35:59 +1000 Subject: [PATCH] Experimental LED support (untested) --- quantum/quantum.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 64e364a245..dda8ea8a99 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -1194,7 +1194,10 @@ static inline uint16_t scale_backlight(uint16_t v) { */ ISR(TIMER1_OVF_vect) { - uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + uint16_t interval = momentum_enabled() + ? match_momentum(1, 10) + : (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. breathing_counter = (breathing_counter + 1) % (breathing_period * 244); uint8_t index = breathing_counter / interval % BREATHING_STEPS;