spi: update spi module to use char instead of unsigned char as return values
authorBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 1 Jul 2014 13:56:12 +0000 (14:56 +0100)
committerBrendan Le Foll <brendan.le.foll@intel.com>
Tue, 1 Jul 2014 13:56:12 +0000 (14:56 +0100)
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
api/mraa/spi.hpp
examples/c++/Spi-pot.cpp

index eb7fb45..1cdbaff 100644 (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
index 0ff0088..b86f5f2 100644 (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++) {