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

allow metro intervals >20s #285

Closed
trentgill opened this issue Feb 12, 2020 · 1 comment
Closed

allow metro intervals >20s #285

trentgill opened this issue Feb 12, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@trentgill
Copy link
Collaborator

This is a limitation in the timers LL library. The limitation is from the 16bit counters running with max prescalar.

Potentially could double available time by changing TIM peripherals clocksource to a slower divisions.

As we’re using the timers to run the ADC and USB drivers they need to be efficient when fast.

Could extend the library in software with an extra incrementer per timer. Add an extra callback function that will be called from the hardware timer callback. Then the nested callback executes when the counter finishes decrementing.

Algorithm should use the smallest incrementer count possible to reduce callbacks.

Each timer would need extra:

  • countresetvalue
  • countdown
  • fnptr (the real callback)
    We need an extra fnptr as the original one must point at the decrementer function.
@trentgill trentgill added the enhancement New feature or request label Feb 12, 2020
@trentgill
Copy link
Collaborator Author

Closing in preference for a move to #339 for this kind of thing. Allowing these longer intervals requires some kind of software timer mechanism which #339 already provides, so let's just lean on that. The metros are still useful for non-drifting metronomes (ie, even if the Lua env gets clogged up, the metro remains perfectly in time with the CPU).

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

No branches or pull requests

1 participant