I think you know this, but setWatch doesn't actually execute code on the interrupt, it just queues something to say the interrupt has happened.
As @allObjects says, if you can get it to output to a pin, you could loop back and use setWatch that way - but I'm not sure you can.
We could however modify Espruino to add some functions that put an event (USER1, USER2, etc?) into the queue when they are called, and could get them to call E.on('USER1', ...) when they were found. The addresses of those functions could then be poked into the Interrupt Vector Table, so that they were called when something happened...
I kind of wonder how many people would use the functionality though ;)
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.
I think you know this, but
setWatch
doesn't actually execute code on the interrupt, it just queues something to say the interrupt has happened.As @allObjects says, if you can get it to output to a pin, you could loop back and use setWatch that way - but I'm not sure you can.
We could however modify Espruino to add some functions that put an event (USER1, USER2, etc?) into the queue when they are called, and could get them to call
E.on('USER1', ...)
when they were found. The addresses of those functions could then be poked into the Interrupt Vector Table, so that they were called when something happened...I kind of wonder how many people would use the functionality though ;)