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(#5148): ObjectFLED pad restore can corrupt the GPIO1 latch and glitch input pins #5191
coderabbit-followupFollow-up for a CodeRabbit finding missed at merge timesanitizedTitle, body and conversation screened; review text requires separate screening.
capture() reads GPIO1_DR to save the output latch. On i.MX RT, reading DR for a pin that is configured as an input returns the pad level, not the latch. When that level differs from the latch, restore() writes the wrong value into the latch, and a later switch to output drives the wrong level.
Suggested fix: Save the latch in a way that does not depend on the input sample: for pins that were inputs, keep the previous DR value, or read it with GDIR set temporarily, or take it from shadow state.
restore() writes DR before GDIR. For a pin that was an input and read high at capture time, the pad is still an output (from the SPI mode) when DR goes high, so deinit drives a short high pulse and can fight an external driver.
Suggested fix: For pins saved as inputs, clear their GDIR bits first, then write the latch. Keep the latch-then-direction order only for pins that were saved as outputs. Add a host test with an input pin that reads high.
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(teensy4): ObjectFLED pad restore keeps GPIO1 latch and avoids inp…