dead code: build_packet pre-loads preamble that gets overwritten #6

Closed
opened 2026-07-26 17:02:22 +00:00 by daru · 1 comment
Owner

build_packet sets dst_buffer[0]=0x0056, dst_buffer[1]=0x655a, then manchester_encode writes the full raw array starting at dst[0], overwriting both. The pre-load is dead code.

Fix: remove the dead pre-load lines.

build_packet sets dst_buffer[0]=0x0056, dst_buffer[1]=0x655a, then manchester_encode writes the full raw array starting at dst[0], overwriting both. The pre-load is dead code. Fix: remove the dead pre-load lines.
Contributor

Fixed in PR #14: removed the 3 dead lines (dst_buffer[0]=0x0056, dst_buffer[1]=0x655a) — manchester_encode overwrites them anyway since raw[] already contains the preamble.

Fixed in PR #14: removed the 3 dead lines (dst_buffer[0]=0x0056, dst_buffer[1]=0x655a) — manchester_encode overwrites them anyway since raw[] already contains the preamble.
daru closed this issue 2026-07-26 22:39:26 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
daru/PICsense#6
No description provided.