From c509fbbdab41eadad65f13ea2d4fe5e906d847d0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 30 Aug 2017 08:00:35 -0600 Subject: [PATCH] Porting Guide: Add usage tip for reading CAN messages from the CAN driver without losing message. --- Documentation/NuttxPortingGuide.html | 41 +++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 12850ed495..339f64f306 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@

NuttX RTOS Porting Guide

-

Last Updated: May 20, 2017

+

Last Updated: August 30, 2017

@@ -4999,6 +4999,45 @@ void iob_dump(FAR const char *msg, FAR struct iob_s *iob, unsigned int len, Platform-specific CAN drivers reside in arch/<architecture>/src/<chip> directory for the specific processor <architecture> and for the specific <chip> CAN peripheral devices. +

+ Usage Note: + When reading from the the CAN multiple messages may be returned, depending on (1) the size the returned can messages, and (2) the size of the buffer provided to receive CAN messages. + Never assume that a single message will be returned... if you do this, you will lose CAN data under conditions where your read buffer can hold more than one small message. + Below is an example about how you should think of the CAN read operation: +

+

6.1.6 Quadrature Encoder Drivers