eerimoq / simba

Simba Embedded Programming Platform.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing documentation of interrupt context

simonlbn opened this issue · comments

I'm looking at using timers, but had some trouble with the actual usage since I'm unsure what I can safely do in the callback function. I tried to call a log function, but it just seemed to not do anything, but if I e.g. set a global variable I can see that my code is called.

Reading http://simba-os.readthedocs.io/en/latest/library-reference/kernel/timer.html it says the callback is 'Called from interrupt context' - but I haven't seen any documentation of what that means, but I suspect it limits what I can safely do.

So, it would be very useful to have some docs about what it means to run in interrupt context, or if it already exists making it more visible.

You are right, timers are called from interrupt context and should generally only call functions suffixed with _isr. Usually the timer callback writes and event to an event channel, and a thread read this event and acts on it.

I'll have a look at the documentation and improve it where necessary.