Fix WS2812 timmings
authorNathael Pajani <nathael.pajani@ed3l.fr>
Thu, 24 Sep 2020 11:10:37 +0000 (13:10 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:05 +0000 (17:03 +0100)
extdrv/ws2812.c

index a9c5b0b..615031f 100644 (file)
@@ -78,8 +78,6 @@ static void ws2812_bit_sender(struct ws2812_conf* ws2812)
                        nop();
                        nop();
                        nop();
-                       nop();
-                       nop();
                        /* "low" time : 800ns */
                        gpio_port->clear = gpio_bit;
                        nop();
@@ -89,9 +87,8 @@ static void ws2812_bit_sender(struct ws2812_conf* ws2812)
                        nop();
                        nop();
                        nop();
-                       nop();
                } else {
-                       /* "high" time : 700ns */
+                       /* "high" time : 800ns */
                        gpio_port->set = gpio_bit;
                        nop();
                        nop();
@@ -109,10 +106,11 @@ static void ws2812_bit_sender(struct ws2812_conf* ws2812)
                        nop();
                        nop();
                        nop();
+                       nop();
+                       nop();
                        /* "low" time : 600ns */
                        gpio_port->clear = gpio_bit;
                        nop();
-                       nop();
                }
 
                /* Move to the next bit */