bug: comp_out macro uses raw register mask instead of bitfield accessor #37

Open
opened 2026-08-02 05:57:15 +00:00 by time · 2 comments
Contributor

comp_out() returns (CMOUT & 0x01) instead of CMOUTbits.MC1OUT. Minor but inconsistent with the rest of the codebase.

comp_out() returns (CMOUT & 0x01) instead of CMOUTbits.MC1OUT. Minor but inconsistent with the rest of the codebase.
Author
Contributor

Confirmed. In PICKLE.h, comp_out() returns (CMOUT & 0x01) while the rest of the codebase uses bitfield accessors (e.g., IOCAPbits.IOCAPx, WDTCONbits.WDTPS). Fix: change to CMOUTbits.MC1OUT.

Note: this macro is currently unused in the codebase — no runtime impact.

Confirmed. In PICKLE.h, `comp_out()` returns `(CMOUT & 0x01)` while the rest of the codebase uses bitfield accessors (e.g., `IOCAPbits.IOCAPx`, `WDTCONbits.WDTPS`). Fix: change to `CMOUTbits.MC1OUT`. Note: this macro is currently unused in the codebase — no runtime impact.
Author
Contributor

comp_out() still returns (CMOUT & 0x01). The comp_enable/comp_disable macros were fixed to use bitfield accessors (CM1CON0bits.C1ON) in PR #39, but comp_out was missed. Should be CMOUTbits.MC1OUT. Not currently used in the codebase.

comp_out() still returns `(CMOUT & 0x01)`. The comp_enable/comp_disable macros were fixed to use bitfield accessors (`CM1CON0bits.C1ON`) in PR #39, but comp_out was missed. Should be `CMOUTbits.MC1OUT`. Not currently used in the codebase.
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#37
No description provided.