[riot-notifications] [RIOT-OS/RIOT] ieee802154/submac: fix initialization code (#16533)

benpicco notifications at github.com
Sun Jul 4 15:24:17 CEST 2021


@benpicco commented on this pull request.

looks good, just some style nits 

> @@ -291,8 +291,28 @@ static int _init(netdev_t *netdev)
         (netdev_ieee802154_submac_t *)netdev;
     ieee802154_submac_t *submac = &netdev_submac->submac;
     netdev_ieee802154_t *netdev_ieee802154 = (netdev_ieee802154_t *)netdev;
-    ieee802154_submac_init(submac, (network_uint16_t*) netdev_ieee802154->short_addr, (eui64_t*) netdev_ieee802154->long_addr);
+    netdev_ieee802154_setup(netdev_ieee802154);
+
+    int res = ieee802154_submac_init(submac, (network_uint16_t*) netdev_ieee802154->short_addr, (eui64_t*) netdev_ieee802154->long_addr);

```suggestion
    int res = ieee802154_submac_init(submac,
                                     (network_uint16_t*) netdev_ieee802154->short_addr,
                                     (eui64_t*) netdev_ieee802154->long_addr);
```

>  
     ieee802154_radio_config_phy(dev, &conf);
     assert(ieee802154_radio_set_cca_threshold(dev,
                                               CONFIG_IEEE802154_CCA_THRESH_DEFAULT) >= 0);
 
-    ieee802154_radio_request_set_trx_state(dev, IEEE802154_TRX_STATE_RX_ON);
+    _req_set_trx_state_wait_busy(dev, IEEE802154_TRX_STATE_RX_ON);
+    while(ieee802154_radio_confirm_set_trx_state(dev) == -EAGAIN) {};

```suggestion
    while (ieee802154_radio_confirm_set_trx_state(dev) == -EAGAIN) {};
```

-- 
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/16533#pullrequestreview-698674286
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210704/dca03c53/attachment.htm>


More information about the notifications mailing list