[riot-notifications] [RIOT-OS/RIOT] cpu/esp: esp_now_netdev fixes and optimizations (#10700)

Gunar Schorcht notifications at github.com
Thu Jan 10 10:28:21 CET 2019

gschorcht commented on this pull request.

> -    critical_enter();
+    /*
+     * The function `esp_now_recv_cb` is executed in the context of the `wifi`
+     * thread. The ISRs handling the hardware interrupts from the WiFi
+     * interface pass events to a message queue of the `wifi` thread which is
+     * sequentially processed by the `wifi` thread to asynchronously execute
+     * callback functions such as `esp_now_recv_cb`.
+     *
+     * It should be therefore not possible to reenter function
+     * `esp_now_recv_cb`. To avoid inconsistencies this is checked by an
+     * additional boolean variable . This can not be realized by a mutex
+     * because `esp_now_recv_cb` would be reentered from same thread context.
+     * If the NDEBUG macro is undefined, an assertion is used instead for
+     * debugging purposes.
+     */
+    assert(!_in_recv_cb);

The problem with a DEBUG message is that you would miss it in the set of other debug messages, especially during stress tests.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190110/a4ddb824/attachment.html>

More information about the notifications mailing list