EDGE_FALLING = 3 /**< Interupt on falling only */
} Edge;
+#if defined(SWIGJAVA)
+
+class IsrCallback
+{
+ public:
+ virtual ~IsrCallback()
+ {
+ }
+ virtual void
+ run()
+ { /* empty, overloaded in Java*/
+ }
+
+ private:
+};
+
+void
+generic_isr_callback(void* data)
+{
+ IsrCallback* callback = (IsrCallback*) data;
+ callback->run();
+}
+#endif
+
/**
* @brief API to General Purpose IO
*
#endif
return mraa_gpio_isr(m_gpio, (gpio_edge_t) mode, &uvwork, this);
}
+#elif defined(SWIGJAVA)
+ mraa_result_t
+ isr(Edge mode, IsrCallback* cb, void* args)
+ {
+ return mraa_gpio_isr(m_gpio, (gpio_edge_t) mode, generic_isr_callback, cb);
+ }
#else
/**
* Sets a callback to be called when pin value changes
}
#endif
/**
- * Exits callback - this call will not kill the isr thread imediatlu
+ * Exits callback - this call will not kill the isr thread immediatly
* but only when it is out of it's critical section
*
* @return Result of operation