Yes - but I'd just pass channel in directly, then it's up to whatever library to do channel-EV_EXTI0 if needed (but at least you're comparing JsEventFlags with JsEventFlags).
I'm not 100% sure I understand what you mean - but if you're only going to use one instance of Gesture then yes, definitely statically allocate it.
In Espruino I don't do this because I only want to use RAM when it's needed - but for you, you're only compiling in Gesture when you need it so you might as well statically allocate.
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.
Yes - but I'd just pass
channel
in directly, then it's up to whatever library to dochannel-EV_EXTI0
if needed (but at least you're comparing JsEventFlags with JsEventFlags).I'm not 100% sure I understand what you mean - but if you're only going to use one instance of Gesture then yes, definitely statically allocate it.
In Espruino I don't do this because I only want to use RAM when it's needed - but for you, you're only compiling in Gesture when you need it so you might as well statically allocate.