java: solved callbacks

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Stefan Andritoiu
2015-08-19 19:27:16 +03:00
committed by Mihai Tudor Panu
parent 323905a215
commit 19bcbc7c42
13 changed files with 108 additions and 16 deletions

View File

@ -27,6 +27,10 @@
#include <mraa/i2c.h>
#include <mraa/gpio.h>
#ifdef SWIGJAVA
#include "../IsrCallback.h"
#endif
#define MMA7660_I2C_BUS 0
#define MMA7660_DEFAULT_I2C_ADDR 0x4c
@ -248,8 +252,11 @@ namespace upm {
* @param arg Pointer to an object to be supplied as an
* argument to the ISR.
*/
#ifdef SWIGJAVA
void installISR(int pin, IsrCallback *cb);
#else
void installISR(int pin, void (*isr)(void *), void *arg);
#endif
/**
* Uninstalls the previously installed ISR
*
@ -276,6 +283,10 @@ namespace upm {
bool setSampleRate(MMA7660_AUTOSLEEP_T sr);
private:
#ifdef SWIGJAVA
void installISR(int pin, void (*isr)(void *), void *arg);
#endif
bool m_isrInstalled;
mraa_i2c_context m_i2c;
mraa_gpio_context m_gpio;