Browse Source

lsm303: Modifications to js swig file

Signed-off-by: Zion Orent <zorent@ics.com>
Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
Zion Orent 10 years ago
parent
commit
405dab1725
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/lsm303/jsupm_lsm303.i

+ 7
- 0
src/lsm303/jsupm_lsm303.i View File

@@ -1,5 +1,12 @@
1 1
 %module jsupm_lsm303
2 2
 %include "../upm.i"
3
+%include "../carrays_int16_t.i"
4
+
5
+// Adding this typemap because SWIG is converting int16 into a short by default
6
+// This forces SWIG to convert it correctly
7
+%typemap(out) int16_t* {
8
+	jsresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 |  0 );
9
+}
3 10
 
4 11
 %{
5 12
     #include "lsm303.h"