You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
follow-up(#5174): keep SAM SCK driven low across the writeBit SPI handoff #5181
coderabbit-followupFollow-up for a CodeRabbit finding missed at merge timesanitizedTitle, body and conversation screened; review text requires separate screening.
Unaddressed CodeRabbit review finding(s) from #5174, checked against current master.
1. src/platforms/arm/sam/fastspi_arm_sam.h:164
In SAMHardwareSPIOutput::writeBit(), PIO_PDR hands SCK/MOSI back to peripheral A before enableSPI() runs. In that window the SCK pad is not driven, so a clock pull-up (or an interrupt that lengthens the window) can make an extra rising edge. SM16716 counts it as a data bit and the following RGB bytes shift.
Suggested fix: Enable the SPI before releasing the pads to the peripheral (or do the PDR/enable pair with interrupts masked) so SCK stays driven low throughout. Verify on a Due with an SM16716 strip.
Missed CodeRabbit review: merged before the review was read (clud pr_merge_watch bug, fixed in talos-hq/clud#2719).
coderabbit-followupFollow-up for a CodeRabbit finding missed at merge timesanitizedTitle, body and conversation screened; review text requires separate screening.
Activity
fix(sam): restore CPOL=0 CSR before SPI handoff; keep SAMD-only warni…
fix(sam): mask interrupts across writeBit SPI handoff, preserving PRI…
fix(sam): set CSR without polling TDRE while SPI is disabled in write…
fix(sam): keep SCK driven low across writeBit SPI handoff (FastLED#5181…