The thing I'd be worried about changing repeat is that I (and probably many others) do repeat:1 as a shorthand - and it'd break that.
Prescale could be an idea though (we'd just have to make sure we knew what data it should be reporting back) - to be honest I've wanted to do a more intelligent setWatch for a while.
Specifically:
Ignoring small pulses in the IRQ
Sampling another pin when one pin changes (so you can read clocked data)
Maybe some kind of bit storage, so it can store multiple bits of data and then call back into JS just once
I've struggled to think of how best to expose that. I'm wondering whether it's actually better if I let you specify code to execute in the IRQ. I think it should be ok to use JS now - or obviously compiled code/assembler would work best.
Then at least it'd be easy enough to write libraries that handle the common cases...
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The thing I'd be worried about changing
repeat
is that I (and probably many others) dorepeat:1
as a shorthand - and it'd break that.Prescale could be an idea though (we'd just have to make sure we knew what data it should be reporting back) - to be honest I've wanted to do a more intelligent
setWatch
for a while.Specifically:
I've struggled to think of how best to expose that. I'm wondering whether it's actually better if I let you specify code to execute in the IRQ. I think it should be ok to use JS now - or obviously compiled code/assembler would work best.
Then at least it'd be easy enough to write libraries that handle the common cases...