More recomended way to use attachInterrupt

This commit is contained in:
Daniel Surizon
2019-10-08 09:43:26 +08:00
committed by Baozhu Zuo
parent 1935258e58
commit 7d41ceb28a
@@ -19,7 +19,7 @@ const int SPI_CS_PIN = 9;
MCP_CAN CAN(SPI_CS_PIN); // Set CS pin
const byte interruptPin = 0;
unsigned char flagRecv = 0;
unsigned char len = 0;
unsigned char buf[8];
@@ -37,7 +37,7 @@ void setup()
}
SERIAL.println("CAN BUS Shield init ok!");
attachInterrupt(0, MCP2515_ISR, FALLING); // start interrupt
attachInterrupt(digitalPinToInterrupt(interruptPin), MCP2515_ISR, FALLING); // start interrupt
/*
@@ -89,4 +89,4 @@ void loop()
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
*********************************************************************************************************/