bug: ISR uses sizeof(tx_buf) instead of PACKET_LEN for half-bit count #31
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#31
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_isr checks tx_bit_idx < sizeof(tx_buf) * 16, but sizeof(tx_buf) returns byte size (30), giving 480 iterations instead of the intended 240 (PACKET_LEN × 16). This reads out-of-bounds past tx_buf into tx_bit_idx and tx_done memory, corrupting output. Fix: use PACKET_LEN * 16.
Fixed in PR #39: ISR was completely rewritten — no longer uses sizeof(tx_buf). Main loop iterates PACKET_LEN * 2 over the 8-bit buffer.