[riot-notifications] [RIOT-OS/RIOT] at86rf2xx: add NETOPT_TX_RETRIES_NEEDED support (#7484)

Joakim NohlgÄrd notifications at github.com
Thu Sep 28 17:06:08 CEST 2017


gebart commented on this pull request.

Looks good to me, but I did not test, only had a brief look at the data sheet

> @@ -561,6 +568,10 @@ static void _isr(netdev_t *netdev)
                 at86rf2xx_set_state(dev, dev->idle_state);
                 DEBUG("[at86rf2xx] return to state 0x%x\n", dev->idle_state);
             }
+#if defined(MODULE_AT86RF232) || defined(MODULE_AT86RF233)
+            dev->tx_retries = at86rf2xx_reg_read(dev, AT86RF2XX_REG__XAH_CTRL_2) >>
+                              AT86RF2XX_XAH_CTRL_2__ARET_FRAME_RETRIES_OFFSET;

Whole technically not needed because of the actual values of the mask, it would be more semantically correct to do a bitwise and with AT86RF2XX_XAH_CTRL_2__ARET_FRAME_RETRIES_MASK first

> @@ -561,6 +568,10 @@ static void _isr(netdev_t *netdev)
                 at86rf2xx_set_state(dev, dev->idle_state);
                 DEBUG("[at86rf2xx] return to state 0x%x\n", dev->idle_state);
             }
+#if defined(MODULE_AT86RF232) || defined(MODULE_AT86RF233)

Optionally you could change these checks to ifdef AT86RF2XX_XAH_CTRL_2__ARET_FRAME_RETRIES_OFFSET
and only have the model specific checks inside the register header. This way it will be easy to add support for a future at86rf234 or whatever 

-- 
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/7484#pullrequestreview-65889371
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170928/0050110a/attachment.html>


More information about the notifications mailing list