void jshSetEventCallback(
IOEventFlags channel, //!< The event that fires the callback.
JshEventCallbackCallback callback //!< The callback to be invoked.
) {
// Save the callback function for this event channel.
assert(channel>=EV_EXTI0 && channel<=EV_EXTI_MAX);
jshEventCallbacks[channel-EV_EXTI0] = callback;
}
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
In debug mode build, an Assert is failing here:
https://github.com/espruino/Espruino/blob/master/src/jsdevices.c#L706 ( line 6 below)
EV_EXTI_MAX is defined as: https://github.com/espruino/Espruino/blob/e609b94f83f665c26cf4f86acac068c396427e99/src/jsdevices.h#L54
@JumJum did the setwatch code for ESP32 - so I'm unsure how pin numbers (D22 in this case) is mapping to a channel?