mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 09:51:14 +03:00
java: Use Runnables instead of IsrCallbacks in Java
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:

committed by
Mihai Tudor Panu

parent
e1c66c351a
commit
2cd043c2a1
@ -58,9 +58,9 @@ bool A110X::magnetDetected()
|
||||
}
|
||||
|
||||
#ifdef JAVACALLBACK
|
||||
void A110X::installISR( IsrCallback *cb)
|
||||
void A110X::installISR(jobject runnable)
|
||||
{
|
||||
installISR(generic_callback_isr, cb);
|
||||
installISR(mraa_java_isr_callback, runnable);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -26,10 +26,6 @@
|
||||
#include <string>
|
||||
#include <mraa/gpio.h>
|
||||
|
||||
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
|
||||
#include "../IsrCallback.h"
|
||||
#endif
|
||||
|
||||
namespace upm {
|
||||
/**
|
||||
* @brief A110X Hall Effect library
|
||||
@ -90,7 +86,7 @@ namespace upm {
|
||||
* argument to the ISR.
|
||||
*/
|
||||
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
|
||||
void installISR(IsrCallback *cb);
|
||||
void installISR(jobject runnable);
|
||||
#else
|
||||
void installISR(void (*isr)(void *), void *arg);
|
||||
#endif
|
||||
|
@ -1,13 +1,8 @@
|
||||
%module(directors="1") javaupm_a110x
|
||||
%module javaupm_a110x
|
||||
%include "../upm.i"
|
||||
%include "stdint.i"
|
||||
%include "typemaps.i"
|
||||
|
||||
%feature("director") IsrCallback;
|
||||
SWIG_DIRECTOR_OWNED(IsrCallback)
|
||||
%ignore generic_callback_isr;
|
||||
%include "../IsrCallback.h"
|
||||
|
||||
%{
|
||||
#include "a110x.h"
|
||||
%}
|
||||
@ -22,4 +17,4 @@ SWIG_DIRECTOR_OWNED(IsrCallback)
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
%}
|
||||
%}
|
||||
|
Reference in New Issue
Block a user