ot-rtos
ot-rtos copied to clipboard
Potential duplicate otrTaskNotifyGive() call
https://github.com/openthread/ot-rtos/blob/a6e1c6ad2e46652c5942deba46ea2706c6b9524b/include/openthread/openthread-freertos.h#L132
I'm not sure this otrTaskNotifyGive() line is necessary. If a user makes an OpenThread call using the OT_API_CALL(...) macro from another FreeRTOS task and a call to otTaskletsProcess() is required, won't the callback otSysEventSignalPending() be called which also calls otrTaskNotifyGive()? It seems this would duplicate the call to otrTaskNotifyGive(). Not that big of a deal because each call to otrTaskNotifyGive() will just run the application loop an extra time, but if you're running a low-power application you wouldn't really want that.
So as an example: Calling OT_API_CALL(otSetStateChangedCallback) wouldn't actually require a call to otTaskletsProcess() but the macro OT_API_CALL(...) would force a call to that application layer function anyway.
Thanks
To further this idea: The callbacks for both otSysEventSignalPending and otTaskletsSignalPending both call otrTaskNotifyGive. So notifying the task in the macro OT_API_CALL(...) is going to be redundant I believe.