mirror of
https://github.com/Seeed-Studio/Seeed_Arduino_CAN.git
synced 2026-07-27 19:55:59 +00:00
Move: CANFD argument to uint32_t from byte
This commit is contained in:
@@ -44,7 +44,7 @@ char str[20];
|
||||
|
||||
void setup() {
|
||||
SERIAL_PORT_MONITOR.begin(115200);
|
||||
while (!SERIAL_PORT_MONITOR. {
|
||||
while (!SERIAL_PORT_MONITOR) {
|
||||
; // wait for serial port to connect. Needed for native USB port only
|
||||
}
|
||||
attachInterrupt(digitalPinToInterrupt(CAN_INT_PIN), MCP2515_ISR, FALLING); // start interrupt
|
||||
|
||||
@@ -40,7 +40,9 @@ void setup() {
|
||||
}
|
||||
attachInterrupt(digitalPinToInterrupt(CAN_INT_PIN), MCP2515_ISR, FALLING); // start interrupt
|
||||
CAN.setMode(CAN_NORMAL_MODE);
|
||||
while (0 != CAN.begin((byte)CAN_500K_1M)) { // init can bus : baudrate = 500k
|
||||
|
||||
// init can bus : arbitration bitrate = 500k, data bitrate = 1M
|
||||
while (0 != CAN.begin(CAN_500K_1M)) {
|
||||
SERIAL_PORT_MONITOR.println("CAN init fail, retry...");
|
||||
delay(100);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ void setup() {
|
||||
*/
|
||||
CAN.setMode(CAN_NORMAL_MODE);
|
||||
|
||||
while (0 != CAN.begin((byte)CAN_500K_1M)) { // init can bus : baudrate = 500k
|
||||
// init can bus : arbitration bitrate = 500k, data bitrate = 1M
|
||||
while (0 != CAN.begin(CAN_500K_1M)) {
|
||||
SERIAL_PORT_MONITOR.println("CAN init fail, retry...");
|
||||
delay(100);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void loop() {
|
||||
#if MAX_DATA_SIZE > 8
|
||||
CANFD::len2dlc(len),
|
||||
#else
|
||||
len
|
||||
len,
|
||||
#endif
|
||||
cdata);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ void setup() {
|
||||
SERIAL_PORT_MONITOR.begin(115200);
|
||||
while(!Serial); // wait for Serial
|
||||
|
||||
if (CAN_SEND.begin((byte)CAN_500K_1M) != 0 || CAN_RECEIVE.begin((byte)CAN_500K_1M) != 0) {
|
||||
if (CAN_SEND.begin(CAN_500K_1M) != 0 || CAN_RECEIVE.begin(CAN_500K_1M) != 0) {
|
||||
SERIAL_PORT_MONITOR.println("CAN-BUS initiliased error!");
|
||||
while(1);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void setup() {
|
||||
CAN_SEND.setMode(CAN_NORMAL_MODE);
|
||||
CAN_RECEIVE.setMode(CAN_NORMAL_MODE);
|
||||
|
||||
if (CAN_SEND.begin((byte)CAN_500K_1M) != 0 || CAN_RECEIVE.begin((byte)CAN_500K_1M) != 0) {
|
||||
if (CAN_SEND.begin(CAN_500K_1M) != 0 || CAN_RECEIVE.begin(CAN_500K_1M) != 0) {
|
||||
SERIAL_PORT_MONITOR.println("CAN-BUS initiliased error!");
|
||||
while (1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user