fix: pin_write calls optimized away by XC8 #19
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wait-to-fix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
daru/PICsense!19
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/pin_write_optimized_away"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #18
XC8 was silently dropping
pin_writecalls because the ternary macro(val ? (LATA |= ...) : (LATA &= ...))produced a discarded expression whose volatile LATA side-effects were treated as side-effect-free. Replaced with direct writes to XC8'svolatile __bitvariables (LATAx), which the compiler cannot optimize away.Confirmed by: