@gordon, thanks for the feedback. In my knowledge, this would be a first step solution and would solve my needs.
On a longer term, there are some questions, like what happens on something like clearwatch ?
Would it be a better option to change definition of jshEventCallbacks in jsdevices to a struct, having a JshEventCallbackCallback and a JsVar for parent (or something else, I cannot even imagine right now) ?
As far as I can see, there are only 5 locations, where JshEventCallbacks is used.
Adding something like set jshSetEventJsVar to set and an if-statement in jshPushIOWatchEvent which would add this to callback ?
I'm pretty sure, it is doable, but would it be helpful ?
Lat not least it would slow down, would this be acceptable ?
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.
@gordon, thanks for the feedback. In my knowledge, this would be a first step solution and would solve my needs.
On a longer term, there are some questions, like what happens on something like clearwatch ?
Would it be a better option to change definition of jshEventCallbacks in jsdevices to a struct, having a JshEventCallbackCallback and a JsVar for parent (or something else, I cannot even imagine right now) ?
As far as I can see, there are only 5 locations, where JshEventCallbacks is used.
Adding something like set jshSetEventJsVar to set and an if-statement in jshPushIOWatchEvent which would add this to callback ?
I'm pretty sure, it is doable, but would it be helpful ?
Lat not least it would slow down, would this be acceptable ?