summaryrefslogtreecommitdiff
path: root/peripheral/libupm/src/lsm303d/jsupm_lsm303d.i
diff options
context:
space:
mode:
Diffstat (limited to 'peripheral/libupm/src/lsm303d/jsupm_lsm303d.i')
-rw-r--r--peripheral/libupm/src/lsm303d/jsupm_lsm303d.i15
1 files changed, 15 insertions, 0 deletions
diff --git a/peripheral/libupm/src/lsm303d/jsupm_lsm303d.i b/peripheral/libupm/src/lsm303d/jsupm_lsm303d.i
new file mode 100644
index 0000000..cfdb1d1
--- /dev/null
+++ b/peripheral/libupm/src/lsm303d/jsupm_lsm303d.i
@@ -0,0 +1,15 @@
+%module jsupm_lsm303d
+%include "../upm.i"
+%include "../carrays_int16_t.i"
+
+// Adding this typemap because SWIG is converting int16 into a short by default
+// This forces SWIG to convert it correctly
+%typemap(out) int16_t* {
+ jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
+}
+
+%{
+ #include "lsm303d.h"
+%}
+
+%include "lsm303d.h"