[riot-notifications] [RIOT-OS/RIOT] drivers/cc2420: Implemented missing drop case (#10416)

José Alamos notifications at github.com
Mon Jan 7 16:32:02 CET 2019


jia200x requested changes on this pull request.



> @@ -172,6 +172,10 @@ int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info)
         cc2420_ram_read(dev, CC2420_RAM_RXFIFO, &len, 1);
         len -= 2;   /* subtract RSSI and FCF */
         DEBUG("cc2420: recv: packet of length %i in RX FIFO\n", (int)len);
+        if (max_len != 0) {
+            /* dropping frame was requested */
+            cc2420_strobe(dev, CC2420_STROBE_FLUSHRX);

AFAIS since the second `cc2420_strobe` is in the `else` block, this function will only get called once. Thus, the FIFO won't be flushed properly.

I guess that could be solved putting both `cc2420_strobe` in the end and adding `return` statement with the length here.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10416#pullrequestreview-189857689
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190107/e2dc9809/attachment.html>


More information about the notifications mailing list