Skip to content

function to reset overflow error bits#34

Open
jesseklm wants to merge 1 commit intocoryjfowler:masterfrom
jesseklm:master
Open

function to reset overflow error bits#34
jesseklm wants to merge 1 commit intocoryjfowler:masterfrom
jesseklm:master

Conversation

@jesseklm
Copy link

This PR adds a new function, resetOverflowErrors(). It resets the overflow error bits (MCP_EFLG_RX0OVR and MCP_EFLG_RX1OVR) in the MCP_EFLG register, ensuring that these flags can be cleared after an overflow event.

Example for overflow checking:

uint8_t eflg = can.getError();
if ((eflg & MCP_EFLG_RX1OVR) || (eflg & MCP_EFLG_RX0OVR)) {
  Serial.println("buffer overflow!");
  can.resetOverflowErrors(); // new
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant