Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Teensy4 timing for 400kHz strings #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions OctoWS2811_imxrt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ void OctoWS2811::show(void)
TMR4_CNTR2 = comp1load[0] + 1;

// wait for WS2812 reset
while (micros() - update_begin_micros < numbytes * 10 + 300) ;
uint32_t us_per_byte = (params & 0xC0) == WS2811_400kHz ? 20 : 10;
while (micros() - update_begin_micros < numbytes * us_per_bytes + 300) ;

// start everything running!
TMR4_ENBL = enable | 7;
Expand Down Expand Up @@ -364,7 +365,8 @@ void OctoWS2811::isr(void)
int OctoWS2811::busy(void)
{
if (!dma3.complete()) ; // DMA still running
if (micros() - update_begin_micros < numbytes * 10 + 300) return 1; // WS2812 reset
uint32_t us_per_byte = (params & 0xC0) == WS2811_400kHz ? 20 : 10;
if (micros() - update_begin_micros < numbytes * us_per_byte + 300) return 1; // WS2812 reset
return 0;
}

Expand Down