aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2020-04-21 13:03:11 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-04-21 13:12:56 -0400
commitc5e79857407d385f868cdaac444e8e36ab2e03a6 (patch)
tree69425938583caa13baa961b147167ef363ab6c77 /src
parent9e8c4770eda8d09c865ed7fc7296df57a713597c (diff)
downloadkutter-c5e79857407d385f868cdaac444e8e36ab2e03a6.tar.gz
kutter-c5e79857407d385f868cdaac444e8e36ab2e03a6.tar.xz
kutter-c5e79857407d385f868cdaac444e8e36ab2e03a6.zip
neopixel: Make sure there is a minimum low duration after a long pulse
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src')
-rw-r--r--src/neopixel.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/neopixel.c b/src/neopixel.c
index f7e961fc..d5aab685 100644
--- a/src/neopixel.c
+++ b/src/neopixel.c
@@ -53,10 +53,7 @@ neopixel_get_time(void)
return TCNT1;
}
-static inline void
-neopixel_delay(neopixel_time_t start, neopixel_time_t ticks)
-{
-}
+#define neopixel_delay(start, ticks) (void)(ticks)
#else
@@ -139,6 +136,8 @@ send_data(struct neopixel_s *n, uint8_t *data, uint_fast8_t data_len)
irq_disable();
gpio_out_toggle_noirq(pin);
irq_enable();
+
+ neopixel_delay(neopixel_get_time(), PULSE_SHORT_TICKS);
} else {
// Short pulse
neopixel_delay(last_start, BIT_MIN_TICKS);