Enable error interrupt

This commit is contained in:
redfast00 2020-08-26 23:41:00 +02:00
parent 36af43b144
commit a62562b716
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
2 changed files with 2 additions and 0 deletions

View file

@ -74,6 +74,7 @@ void init() {
mcp2515.reset();
mcp2515.setBitrate(CAN_50KBPS);
mcp2515.setNormalMode();
mcp2515.setRegister(MCP_CANINTE, CANINTF_ERRIF);
}

View file

@ -32,6 +32,7 @@ void setup(uint8_t type, uint8_t id) {
pinMode(GREEN_LED, OUTPUT);
digitalWrite(RED_LED, LOW);
digitalWrite(GREEN_LED, LOW);
attachInterrupt(digitalPinToInterrupt(MCP_INT), interrupt_can_error, RISING);
}
bool loop(obus_can::message* message) {