Added new macros for installISR and applied where possible.

This commit is contained in:
Serban Waltter
2018-01-19 13:12:50 +02:00
committed by Noel Eck
parent 63b2b33df7
commit e192a125f3
20 changed files with 111 additions and 144 deletions

View File

@ -35,13 +35,18 @@
JCALL4(SetIntArrayRegion, jenv, $result, 0, 3, (const signed int*)$1);
}
%ignore getRawValues(int *, int *, int *);
%ignore getAcceleration(float *, float *, float *);
%include "mma7660_regs.h"
%include "mma7660.hpp"
%{
#include "mma7660.hpp"
#include "mma7660_regs.h"
%}
%include "mma7660_regs.h"
%include "mma7660.hpp"
%ignore installISR(int , void *, void *);
JAVA_ADD_INSTALLISR_PIN(upm::MMA7660)
JAVA_JNI_LOADLIBRARY(javaupm_mma7660)

View File

@ -225,12 +225,7 @@ namespace upm {
getRawValues(&values[0], &values[1], &values[2]);
return values;
}
void installISR(int pin, jobject runnable)
{
installISR(pin, mraa_java_isr_callback, runnable);
}
#else
#endif
/**
* Installs an interrupt service routine (ISR) to be called when
* an interrupt occurs
@ -241,7 +236,6 @@ namespace upm {
* argument to the ISR.
*/
void installISR(int pin, void (*isr)(void *), void *arg);
#endif // defined(SWIGJAVA) || defined(JAVACALLBACK)
protected:
mma7660_context m_mma7660;
@ -251,9 +245,5 @@ namespace upm {
MMA7660(const MMA7660&) = delete;
MMA7660 &operator=(const MMA7660&) = delete;
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(int pin, void (*isr)(void *), void *arg);
#endif
};
}