Added inicializing of income data structure.
authorMartin Prudek <prudemar@fel.cvut.cz>
Sun, 10 May 2015 09:17:34 +0000 (11:17 +0200)
committerMartin Prudek <prudemar@fel.cvut.cz>
Sun, 10 May 2015 09:17:34 +0000 (11:17 +0200)
pmsm-control/test_sw/rp_spi.c

index bbe8225..3ae1c63 100644 (file)
@@ -11,6 +11,7 @@
 #include <sys/ioctl.h>
 #include <linux/types.h>
 #include <linux/spi/spidev.h>
+#include <string.h>
 
 #include "rp_spi.h" /*struct rpi_in */
 
@@ -82,6 +83,8 @@ struct rpi_in spi_read(uint8_t * tx)
                .bits_per_word = bits,
        };
 
+       memset(&in,0,sizeof(in));
+
        ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
        /*vypisovani prichozich dat */