mirror of
https://github.com/eclipse/upm.git
synced 2025-07-05 11:21: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
@ -2,6 +2,7 @@
|
||||
%include "../upm.i"
|
||||
%include "typemaps.i"
|
||||
%include "arrays_java.i"
|
||||
%include "../java_buffer.i"
|
||||
|
||||
%feature("director") IsrCallback;
|
||||
|
||||
@ -34,20 +35,5 @@
|
||||
%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 "mpu60x0.h"
|
||||
%include "mpu9150.h"
|
||||
|
@ -139,9 +139,9 @@ uint8_t MPU60X0::readReg(uint8_t reg)
|
||||
return m_i2c.readReg(reg);
|
||||
}
|
||||
|
||||
void MPU60X0::readRegs(uint8_t reg, uint8_t *buf, int len)
|
||||
void MPU60X0::readRegs(uint8_t reg, uint8_t *buffer, int len)
|
||||
{
|
||||
m_i2c.readBytesReg(reg, buf, len);
|
||||
m_i2c.readBytesReg(reg, buffer, len);
|
||||
}
|
||||
|
||||
bool MPU60X0::writeReg(uint8_t reg, uint8_t val)
|
||||
|
@ -706,11 +706,11 @@ namespace upm {
|
||||
* read contiguous refister into a buffer
|
||||
*
|
||||
* @param reg the register to start reading at
|
||||
* @param buf the buffer to store the results
|
||||
* @param buffer the buffer to store the results
|
||||
* @param len the number of registers to read
|
||||
* @return the value of the register
|
||||
*/
|
||||
void readRegs(uint8_t reg, uint8_t *buf, int len);
|
||||
void readRegs(uint8_t reg, uint8_t *buffer, int len);
|
||||
|
||||
/**
|
||||
* write to a register
|
||||
|
Reference in New Issue
Block a user