Commit 5eb58d6
committed
nuttx/can: add read watermark
This provides an optional way to limit number of frames to be copied to
the buffer on read operation. The idea is to allow not only binary
decision if more than one frame can be read but a more granular control.
The size of the buffer itself can't be used for this purpose because
even on plain CAN up three small frames can fit into buffer prepared for
a full sized frame. The explicit change of the behavior of course is not
desirable but having ability to control this is advantageous.
The motivation behind this is the compatibility with socket CAN. It is
easier to port applications to NuttX's CAN driver if only one frame is
provided at the time. This is achieved by setting watermark to zero.
This solution was suggested by Pavel Pisa <[email protected]> as a more
versatile variant of plain boolean disabling the multiple frame
retrieval.
Signed-off-by: Karel Kočí <[email protected]>1 parent a391959 commit 5eb58d6
2 files changed
+47
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| |||
489 | 490 | | |
490 | 491 | | |
491 | 492 | | |
492 | | - | |
| 493 | + | |
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
| |||
964 | 965 | | |
965 | 966 | | |
966 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
967 | 984 | | |
968 | 985 | | |
969 | 986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
308 | 331 | | |
309 | 332 | | |
310 | 333 | | |
| |||
326 | 349 | | |
327 | 350 | | |
328 | 351 | | |
| 352 | + | |
| 353 | + | |
329 | 354 | | |
330 | 355 | | |
331 | | - | |
| 356 | + | |
332 | 357 | | |
333 | 358 | | |
334 | 359 | | |
| |||
796 | 821 | | |
797 | 822 | | |
798 | 823 | | |
799 | | - | |
| 824 | + | |
| 825 | + | |
800 | 826 | | |
801 | 827 | | |
802 | 828 | | |
803 | 829 | | |
804 | 830 | | |
805 | 831 | | |
| 832 | + | |
806 | 833 | | |
807 | 834 | | |
808 | 835 | | |
| |||
0 commit comments