Permalink
Browse files

Fix wiringPiSPIDataRW so that it will return value read from SPI bus.

  • Loading branch information...
omwah committed May 17, 2014
1 parent f388d58 commit abf2d0ecb95ce30a6c7981eb6103d3d022d459df
Showing with 7 additions and 0 deletions.
  1. +4 −0 wiringpi.i
  2. +3 −0 wiringpi_wrap.c
View
@@ -115,6 +115,10 @@ extern uint8_t shiftIn (uint8_t dPin, uint8_t cPin, uint8_t order);
$2 = PyString_Size($input);
};
%typemap(argout) (unsigned char *data) {
$result = SWIG_Python_AppendOutput($result, PyString_FromStringAndSize((char *) $1, result));
};
int wiringPiSPIGetFd (int channel) ;
int wiringPiSPIDataRW (int channel, unsigned char *data, int len) ;
int wiringPiSPISetup (int channel, int speed) ;
View
@@ -4398,6 +4398,9 @@ SWIGINTERN PyObject *_wrap_wiringPiSPIDataRW(PyObject *SWIGUNUSEDPARM(self), PyO
}
result = (int)wiringPiSPIDataRW(arg1,arg2,arg3);
resultobj = SWIG_From_int((int)(result));
{
resultobj = SWIG_Python_AppendOutput(resultobj, PyString_FromStringAndSize((char *) arg2, result));
}
return resultobj;
fail:
return NULL;

0 comments on commit abf2d0e

Please sign in to comment.