This commit adds isr support to node.js mraa module, it also forces SWIGJAVASCRIPT to be set at compile time by cmake (SWIG uses SWIGJAVASCRIPT and not SWIGNODE in it's preprocessor). This uses libuv uv_queue_work to call v8isr and is all done at a C++ level unlike the python isr, so this reuses the mraa_gpio_isr call. This closes #110 Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
62 lines
1.1 KiB
OpenEdge ABL
62 lines
1.1 KiB
OpenEdge ABL
%rename("%(strip:[MRAA_])s", %$isenumitem) "";
|
|
|
|
%include stdint.i
|
|
%include std_string.i
|
|
%include exception.i
|
|
|
|
#ifdef DOXYGEN
|
|
%include common_hpp_doc.i
|
|
%include gpio_class_doc.i
|
|
%include i2c_class_doc.i
|
|
%include pwm_class_doc.i
|
|
%include aio_class_doc.i
|
|
%include spi_class_doc.i
|
|
%include uart_class_doc.i
|
|
#endif
|
|
|
|
%{
|
|
#include "common.hpp"
|
|
#include "gpio.hpp"
|
|
#include "pwm.hpp"
|
|
#include "i2c.hpp"
|
|
#include "spi.hpp"
|
|
#include "aio.hpp"
|
|
#include "uart.hpp"
|
|
%}
|
|
|
|
%init %{
|
|
//Adding mraa_init() to the module initialisation process
|
|
mraa_init();
|
|
%}
|
|
|
|
%exception {
|
|
try {
|
|
$action
|
|
} catch(const std::invalid_argument& e) {
|
|
SWIG_exception(SWIG_ValueError, e.what());
|
|
} catch(...) {
|
|
SWIG_exception(SWIG_RuntimeError, "Unknown exception");
|
|
}
|
|
}
|
|
|
|
%include "common.hpp"
|
|
|
|
%include "types.h"
|
|
|
|
%ignore Gpio::nop(uv_work_t* req);
|
|
%ignore Gpio::v8isr(uv_work_t* req);
|
|
%ignore Gpio::v8isr(uv_work_t* req, int status);
|
|
%ignore Gpio::uvwork(void *ctx);
|
|
|
|
%include "gpio.hpp"
|
|
|
|
%include "i2c.hpp"
|
|
|
|
%include "pwm.hpp"
|
|
|
|
%include "spi.hpp"
|
|
|
|
%include "aio.hpp"
|
|
|
|
%include "uart.hpp"
|