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

Timer system call interface buggy when interval=1 #52

Closed
phil-levis opened this issue Mar 28, 2016 · 1 comment
Closed

Timer system call interface buggy when interval=1 #52

phil-levis opened this issue Mar 28, 2016 · 1 comment

Comments

@phil-levis
Copy link
Contributor

If you pass 1ms to the timer interface, you miss callbacks. This likely has to do with the possibility that the counter is read, then the compare is set to read value +1. If the counter incremented between that read and set, no interrupt will be issued.

Two typical solutions (you generally want both): have the underlying counter at a higher precision (so a timer of 1 is, say, 1000 counter increments), and also check whether the counter has passed the compare value before returning. I.e., set the prescalar in ast.rs so it's higher than 1kHz (e.g., 32kHz), then have the system call interface translate ms to ticks of a 32kHz clock).

@alevy
Copy link
Member

alevy commented Apr 5, 2016

Fixed in 7e107e7

@alevy alevy closed this as completed Apr 5, 2016
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