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

none busy wait #12

Open
coolya opened this issue Apr 20, 2013 · 1 comment
Open

none busy wait #12

coolya opened this issue Apr 20, 2013 · 1 comment

Comments

@coolya
Copy link
Owner

coolya commented Apr 20, 2013

split the linear code into different functions. Analyse the uses variables in the code after the wait and create global variables for these replace all referencens to the local once with the global. Set a timer interrupt for the the desired sleep time, store the callback to the second part of the execution (the second function) in some global variable. send the controller to sleep. In the interrupt handler jump to the second part of the execution, by calling the function pointer placed in the global variable.

@coolya
Copy link
Owner Author

coolya commented Sep 13, 2013

Basicly this just needs a simple sleep mode statement, since the stack is restored after a wakeup from a interrupt. What needs to be done is to simply setup a timer to wake the device aber a given time.
Maybe we can use some kind of scheduler for this in combination with long jumps.

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

No branches or pull requests

1 participant