8000 Retune neopixel timings on SAMD51. They were too slow. · adafruit/circuitpython@b0dd645 · GitHub
[go: up one dir, main page]

Skip to content

Commit b0dd645

Browse files
committed
Retune neopixel timings on SAMD51. They were too slow.
Fixes #1083
1 parent f5fab35 commit b0dd645

File tree

1 file changed

+4
-4
lines changed
  • ports/atmel-samd/common-hal/neopixel_write

1 file changed

+4
-4
lines changed

ports/atmel-samd/common-hal/neopixel_write/__init__.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
111111
#ifdef SAMD51
112112
delay_cycles(3);
113113
#endif
114-
if(p & bitMask) {
114+
if((p & bitMask) != 0) {
115115
// This is the high delay unique to a one bit.
116116
// For the SK6812 its 0.3us
117117
#ifdef SAMD21
118118
asm("nop; nop; nop; nop; nop; nop; nop;");
119119
#endif
120120
#ifdef SAMD51
121-
delay_cycles(11);
121+
delay_cycles(3);
122122
#endif
123123
*clr = pinMask;
124124
} else {
@@ -140,7 +140,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
140140
asm("nop; nop; nop; nop; nop;");
141141
#endif
142142
#ifdef SAMD51
143-
delay_cycles(20);
143+
delay_cycles(4);
144144
#endif
145145
} else {
146146
if(ptr >= end) break;
@@ -151,7 +151,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
151151
// above operations take.
152152
// For the SK6812 its 0.6us +- 0.15us
153153
#ifdef SAMD51
154-
delay_cycles(15);
154+
delay_cycles(3);
155155
#endif
156156
}
157157
}

0 commit comments

Comments
 (0)
0