[riot-notifications] [RIOT-OS/RIOT] drivers/cc110x: Complete rewrite from scratch (#10340)

Francisco Acosta notifications at github.com
Wed Jun 12 16:56:00 CEST 2019


kYc0o commented on this pull request.

Have minor comments, I'll test on my application and give feedback.

> +
+#include "xtimer.h"
+#include "cc110x.h"
+#include "cc110x_internal.h"
+
+#define ENABLE_DEBUG    (0)
+#include "debug.h"
+
+/* Use NETDEV_EVENT_ISR to indicate that no event needs to be passed to upper
+ * layer at end of ISR, as ISR will never need this event
+ */
+#define NETDEV_NO_EVENT NETDEV_EVENT_ISR
+
+void cc110x_rx(cc110x_t *dev)
+{
+    //DEBUG("[cc110x] Going to RX\n");

Please uncomment this line.

> + */
+static netdev_event_t cc110x_rx_done(cc110x_t *dev)
+{
+    uint8_t lqi_crc;
+    int8_t rssi;
+
+    cc110x_read(dev, CC110X_REG_LQI, &lqi_crc);
+    cc110x_read(dev, CC110X_REG_RSSI, (uint8_t *)&rssi);
+
+    /* CRC_OK bit is most significant bit, see page 92 in the data sheet */
+    if (!(lqi_crc & 0x80)) {
+        DEBUG("[cc110x] ISR: CRC error, dropping frame\n");
+        /* Drop frame and go back to RX */
+        cc110x_rx(dev);
+        return NETDEV_EVENT_CRC_ERROR;
+    }

Should you first check if CRC check is enabled? In some cases the embedded CRC function is not needed and thus disabled. This check would drop the frame even if a valid (different) CRC can be calculated afterwards.

-- 
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/10340#pullrequestreview-248805819
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190612/7a42531d/attachment.html>


More information about the notifications mailing list