Private
Public Access
2
0

spi: update spi module to use char instead of unsigned char as return values

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-07-01 14:56:12 +01:00
parent 8eff646cb0
commit b1def2a784
2 changed files with 6 additions and 6 deletions

View File

@@ -75,8 +75,8 @@ class Spi {
* @param data the byte to send
* @return data received on the miso line
*/
unsigned char write(char data) {
return (unsigned char) mraa_spi_write(m_spi, (uint8_t) data);
char write(char data) {
return (char) mraa_spi_write(m_spi, (uint8_t) data);
}
/**
* Write buffer of bytes to SPI device
@@ -85,8 +85,8 @@ class Spi {
* @param length size of buffer to send
* @return char* data received on the miso line. Same length as passed in
*/
unsigned char* write(char* data, size_t length) {
return (unsigned char*) mraa_spi_write_buf(m_spi, (uint8_t *) data, (int) length);
char* write(char* data, size_t length) {
return (char*) mraa_spi_write_buf(m_spi, (uint8_t *) data, (int) length);
}
/**
* Change the SPI lsb mode

View File

@@ -48,8 +48,8 @@ int main ()
spi = new mraa::Spi(0);
uint8_t data[] = {0x00, 100};
uint8_t *recv;
char data[] = {0x00, 100};
char *recv;
while (running == 0) {
int i;
for (i = 90; i < 130; i++) {