bug: tx_done and tx_bit_idx missing volatile qualifier #32
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#32
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
tx_done is written in ISR and read in main, tx_bit_idx is written in main and read in ISR. Without volatile, compiler can cache these in registers, causing infinite loops in while(!tx_done) and stale reads in ISR. Fix: add volatile to both.
Fixed in PR #39: tx_done and tx_bit_idx removed entirely. Replaced with single volatile uint8_t tx_tick flag set by ISR, read by main loop.