lorabasics / basicmac

LoRa Basics™ MAC
Other
79 stars 42 forks source link

os_runloop() clarification #6

Closed Rush4iot closed 5 years ago

Rush4iot commented 5 years ago

https://doc.sm.tc/mac/programming.html#c.os_runloop

It might be great to add something like "It should be called only one time" so users now they do not have to call in again in the callbacks, and maybe rename it to os_runInifiniteLoop() ?

mkuyper commented 5 years ago

Correct. The documentation says (emphasis added):

Executes run-time jobs from the timer and from the run queues. This function is the main action dispatcher. It must be run on the main thread and doesn’t return.

We can clarify this to make it more clear.

It is recommended that applications make use of the higher-level appstart service that inititalizes the run-time correctly and takes care of running the scheduler; i.e. calling os_runlop() function at the appropriate time and exactly once.