Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Potential duplicate otrTaskNotifyGive() call #34

Open
theHurc opened this issue Oct 6, 2020 · 1 comment
Open

Potential duplicate otrTaskNotifyGive() call #34

theHurc opened this issue Oct 6, 2020 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@theHurc
Copy link

theHurc commented Oct 6, 2020

otrTaskNotifyGive(); \

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

@theHurc
Copy link
Author

theHurc commented Oct 6, 2020

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.

@jwhui jwhui added the question Further information is requested label Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants