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

More flexible Timer control #2586

Open
gfwilliams opened this issue Dec 20, 2024 · 0 comments
Open

More flexible Timer control #2586

gfwilliams opened this issue Dec 20, 2024 · 0 comments

Comments

@gfwilliams
Copy link
Member

The internal timer system in Espruino is pretty powerful. Right now we have it exposed in a few different ways:

  • Waveform
  • analogWrite(..., {forceSoft})
  • digitalPulse
  • Pin.writeAtTime
  • Stepper
  • E.dumpTimers (for debug)

But there are some things it can do that we don't expose:

  • Synchronised PWM on up to 4 different pins (eg for positive+negative outputs of a square wave)
  • Output a value on up to 4 different pins as a set time
  • Executing a function from an interrupt: covered in Utility Timer native functions #476

... and probably more.

I'm not sure how to do this nicely, but it seems kind of crazy that we currently have (at least) 5 different APIs for using the same timer system. It might be nice to have a simple JS API that allows timers to be queried/updated and added programatically, and then we ditch E.dumpTimers and Pin.writeAtTime which nobody really uses

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

1 participant