1 %module jsupm_lsm303d 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 } 10 11 %{ 12 #include "lsm303d.h" 13 %} 14 15 %include "lsm303d.h" 16