mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 01:41:12 +03:00
java: Changed size_t and unsigned int to int in array declarations. Renamed buf to buffer where necesarry. Moved most Java array typemaps to java_buffer.i. Fixed some String buffers.
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com> Conflicts: src/upm.i
This commit is contained in:

committed by
Mihai Tudor Panu

parent
ab730038fd
commit
2cab79b4c2
@ -3,6 +3,7 @@
|
||||
%include "cpointer.i"
|
||||
%include "typemaps.i"
|
||||
%include "arrays_java.i";
|
||||
%include "../java_buffer.i"
|
||||
|
||||
%feature("director") IsrCallback;
|
||||
|
||||
@ -12,10 +13,6 @@
|
||||
%apply int {mraa::Edge};
|
||||
%apply float *INOUT { float *x, float *y, float *z };
|
||||
|
||||
%{
|
||||
#include "lsm9ds0.h"
|
||||
%}
|
||||
|
||||
%typemap(jni) float* "jfloatArray"
|
||||
%typemap(jstype) float* "float[]"
|
||||
%typemap(jtype) float* "float[]"
|
||||
@ -46,19 +43,8 @@
|
||||
%ignore getGyroscope(float *, float *, float *);
|
||||
%ignore getMagnetometer(float *, float *, float *);
|
||||
|
||||
%typemap(jni) (uint8_t *buf, int len) "jbyteArray";
|
||||
%typemap(jtype) (uint8_t *buf, int len) "byte[]";
|
||||
%typemap(jstype) (uint8_t *buf, int len) "byte[]";
|
||||
|
||||
%typemap(javain) (uint8_t *buf, int len) "$javainput";
|
||||
|
||||
%typemap(in) (uint8_t *buf, int len) {
|
||||
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||
$2 = JCALL1(GetArrayLength, jenv, $input);
|
||||
}
|
||||
|
||||
%typemap(freearg) (uint8_t *buf, int len) {
|
||||
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
||||
}
|
||||
%{
|
||||
#include "lsm9ds0.h"
|
||||
%}
|
||||
|
||||
%include "lsm9ds0.h"
|
||||
|
@ -287,7 +287,7 @@ uint8_t LSM9DS0::readReg(DEVICE_T dev, uint8_t reg)
|
||||
return device->readReg(reg);
|
||||
}
|
||||
|
||||
void LSM9DS0::readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buf, int len)
|
||||
void LSM9DS0::readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buffer, int len)
|
||||
{
|
||||
mraa::I2c *device;
|
||||
|
||||
@ -302,7 +302,7 @@ void LSM9DS0::readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buf, int len)
|
||||
|
||||
// We need to set the high bit of the register to enable
|
||||
// auto-increment mode for reading multiple registers in one go.
|
||||
device->readBytesReg(reg | m_autoIncrementMode, buf, len);
|
||||
device->readBytesReg(reg | m_autoIncrementMode, buffer, len);
|
||||
}
|
||||
|
||||
bool LSM9DS0::writeReg(DEVICE_T dev, uint8_t reg, uint8_t val)
|
||||
|
@ -1126,7 +1126,7 @@ namespace upm {
|
||||
* @param len the number of registers to read
|
||||
* @return the value of the register
|
||||
*/
|
||||
void readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buf, int len);
|
||||
void readRegs(DEVICE_T dev, uint8_t reg, uint8_t *buffer, int len);
|
||||
|
||||
/**
|
||||
* write to a register
|
||||
|
Reference in New Issue
Block a user