Skip to content

Commit 10319d0

Browse files
committed
Fix: write returns either 0 or a negative error code on failure.
1 parent 74d3064 commit 10319d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/Arduino_CAN/examples/CANWrite/CANWrite.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void loop()
4040
/* Transmit the CAN message, capture and display an
4141
* error core in case of failure.
4242
*/
43-
if (int const rc = CAN.write(msg); rc < 0)
43+
if (int const rc = CAN.write(msg); rc <= 0)
4444
{
4545
Serial.print ("CAN.write(...) failed with error code ");
4646
Serial.println(rc);

0 commit comments

Comments
 (0)