Great! Also worth noting that while we do create events for rising and falling edges, to make this work I extended the code to allow some extra flags to be specified when creating a watch. It'd allow us to make some changes to (finally) being able to specify whether to record only rising or falling edges.
So far that hasn't been a big deal, but at least it can be done relatively easily now.
One thing to add: The setWatch code isn't smart enough to know whether you have one hispeed watch and one not - so to make this work reliably you can only really have one watch on each pin (if you have >1 watch on a pin it'll use the hispeed setting from the first call to setWatch with that pin).
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.
Great! Also worth noting that while we do create events for rising and falling edges, to make this work I extended the code to allow some extra flags to be specified when creating a watch. It'd allow us to make some changes to (finally) being able to specify whether to record only rising or falling edges.
So far that hasn't been a big deal, but at least it can be done relatively easily now.
One thing to add: The setWatch code isn't smart enough to know whether you have one
hispeed
watch and one not - so to make this work reliably you can only really have one watch on each pin (if you have >1 watch on a pin it'll use the hispeed setting from the first call to setWatch with that pin).