From 7c20dc8ef17ec415b95f347334b86e49fa8f0e56 Mon Sep 17 00:00:00 2001 From: woodward1 Date: Fri, 28 Feb 2014 15:41:11 -0800 Subject: [PATCH] Update receive_check.ino Checking CAN.checkReceive() agains MC_STAT_RXIF_MASK doesn't seem to make sense, it was confusing to me because the code seemed to be using equality with a mask. Since checkReceive() actually returns CAN_MSGAVAIL or CAN_NOMSG, Comparison with CAN_MSGAVAIL seemed more informative than MC_STAT_RXIF_MASK. --- example/receive_check/receive_check.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/receive_check/receive_check.ino b/example/receive_check/receive_check.ino index 19c9638..a56688d 100644 --- a/example/receive_check/receive_check.ino +++ b/example/receive_check/receive_check.ino @@ -35,7 +35,7 @@ START_INIT: void loop() { - if(MCP_STAT_RXIF_MASK == CAN.checkReceive()) // check if data coming + if(CAN_MSGAVAIL == CAN.checkReceive()) // check if data coming { CAN.readMsgBuf(&len, buf); // read data, len: data length, buf: data buf @@ -49,4 +49,4 @@ void loop() /********************************************************************************************************* END FILE -*********************************************************************************************************/ \ No newline at end of file +*********************************************************************************************************/