When using the C++ Gpio method isr
or the C function mraa_gpio_isr
it's important to know that the passed in function will be called in the context of a low level interrupt.
As such it should be coded very carefully, and typically do as little as possible, in order not to interfere with the environment that has been interrupted.
When using the isr
method in Javascript do we have to worry about this kind of thing?
The answer is no, as the logic for the Javascript wrappers ensures that the callback function passed to isr
is invoked from the normal Node.js event loop.