Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing documentation of interrupt context #157

Open
simonlbn opened this issue Oct 10, 2017 · 1 comment
Open

Missing documentation of interrupt context #157

simonlbn opened this issue Oct 10, 2017 · 1 comment

Comments

@simonlbn
Copy link
Contributor

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.

@eerimoq
Copy link
Owner

eerimoq commented Oct 11, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants