Skip to content

Commit

Permalink
Merge pull request #1096 from tannewt/tune_neopixel
Browse files Browse the repository at this point in the history
Retune neopixel timings on SAMD51. They were too slow.
  • Loading branch information
dhalbert committed Aug 8, 2018
2 parents 08def6b + b0dd645 commit 2e80f37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ports/atmel-samd/common-hal/neopixel_write/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
#ifdef SAMD51
delay_cycles(3);
#endif
if(p & bitMask) {
if((p & bitMask) != 0) {
// This is the high delay unique to a one bit.
// For the SK6812 its 0.3us
#ifdef SAMD21
asm("nop; nop; nop; nop; nop; nop; nop;");
#endif
#ifdef SAMD51
delay_cycles(11);
delay_cycles(3);
#endif
*clr = pinMask;
} else {
Expand All @@ -140,7 +140,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
asm("nop; nop; nop; nop; nop;");
#endif
#ifdef SAMD51
delay_cycles(20);
delay_cycles(4);
#endif
} else {
if(ptr >= end) break;
Expand All @@ -151,7 +151,7 @@ void common_hal_neopixel_write(const digitalio_digitalinout_obj_t* digitalinout,
// above operations take.
// For the SK6812 its 0.6us +- 0.15us
#ifdef SAMD51
delay_cycles(15);
delay_cycles(3);
#endif
}
}
Expand Down

0 comments on commit 2e80f37

Please sign in to comment.