bug: IOC macros use raw register masks instead of bitfield accessors #36
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#36
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?
The ioc_rising/falling/clear_flag macros use (IOCAP |= (1<<(pin))) pattern instead of IOCAPbits.IOCAPx = 1. Not currently used in code but should be fixed for consistency.
Confirmed. The IOC macros (
ioc_rising,ioc_falling,ioc_clear_flag) use raw register masks like(IOCAP |= (1<<(pin)))instead of bitfield accessors (IOCAPbits.IOCAP0 = 1).These macros are currently unused in the codebase. The main I/O macros (
pin_write,pin_read,pin_mode_output, etc.) also use raw bit-shifts instead of bitfield accessors, but those are functionally correct and would require a different macro signature sinceCONCAT(LATA, pin)is used for dynamic pin selection. The IOC macros could be fixed to use bitfield accessors if they're ever used.IOC macros still use raw register masks. Not currently used in the codebase, but should be fixed for consistency with the now-bitfield-based pin I/O macros. The pin I/O macros were converted to bitfield accessors in PR #39 (e.g.,
LATAbits.LATA##p), so the IOC macros should follow the same pattern.