Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/CANReceiver/CANReceiver.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void loop() {
// try to parse packet
int packetSize = CAN.parsePacket();

if (packetSize) {
if (packetSize >= 0) {
// received a packet
Serial.print("Received ");

Expand Down
2 changes: 1 addition & 1 deletion src/CANController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int CANControllerClass::endPacket()

int CANControllerClass::parsePacket()
{
return 0;
return -1;
}

long CANControllerClass::packetId()
Expand Down
2 changes: 1 addition & 1 deletion src/ESP32SJA1000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int ESP32SJA1000Class::parsePacket()
{
if ((readRegister(REG_SR) & 0x01) != 0x01) {
// no packet
return 0;
return -1;
}

_rxExtended = (readRegister(REG_SFF) & 0x80) ? true : false;
Expand Down
2 changes: 1 addition & 1 deletion src/MCP2515.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int MCP2515Class::parsePacket()
_rxExtended = false;
_rxRtr = false;
_rxLength = 0;
return 0;
return -1;
}

_rxExtended = (readRegister(REG_RXBnSIDL(n)) & FLAG_IDE) ? true : false;
Expand Down