bug: pin_write macro used undefined identifier LATA2, never actually toggled DATA pin #35

Closed
opened 2026-08-02 05:57:15 +00:00 by time · 1 comment
Contributor

The CONCAT-based pin_write macro expanded CONCAT(LATA, 2) to LATA2, but LATA2 is not a defined identifier in the XC8 DFP — the correct name is LATAbits.LATA2. This meant pin_write wrote to an undefined variable, the DATA pin never actually toggled, and no RF energy was produced. Fixed with indirection-layer bitfield accessors.

The CONCAT-based pin_write macro expanded CONCAT(LATA, 2) to LATA2, but LATA2 is not a defined identifier in the XC8 DFP — the correct name is LATAbits.LATA2. This meant pin_write wrote to an undefined variable, the DATA pin never actually toggled, and no RF energy was produced. Fixed with indirection-layer bitfield accessors.
Author
Contributor

Fixed in PR #39: pin_write macros rewritten with indirection layer (_pin_write_impl → LATAbits.LATA##p) so CONCAT produces valid XC8 DFP identifiers.

Fixed in PR #39: pin_write macros rewritten with indirection layer (_pin_write_impl → LATAbits.LATA##p) so CONCAT produces valid XC8 DFP identifiers.
time closed this issue 2026-08-03 04:06:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#35
No description provided.