[riot-notifications] [RIOT-OS/RIOT] ieee802154_submac: set TRX state only if SubMAC is idle (#15436)

benpicco notifications at github.com
Thu Nov 12 22:25:39 CET 2020


@benpicco commented on this pull request.

Do we have to worry about possible race conditions around `submac->tx`?

> +        /* The only set the radio to the SubMAC default state only if the upper
+         * layer didn't try to send more data. Otherwise there's risk of not

```suggestion
        /* Only set the radio to the SubMAC default state only if the upper
         * layer didn't try to send more data. Otherwise there's risk of not
```

>           */
-        while (ieee802154_radio_request_set_trx_state(submac->dev, next_state) == -EBUSY);
-
-        while (ieee802154_radio_confirm_set_trx_state(submac->dev) == -EAGAIN) {}
+        if (!submac->tx) {

```suggestion
        if (submac->tx) {
            return;
        }
```

saves a level of indentation 

-- 
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/15436#pullrequestreview-529508172
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201112/de33e286/attachment-0001.htm>


More information about the notifications mailing list