Changeset 1513 for trunk/linux_spi.c
- Timestamp:
- Mar 6, 2012 11:17:06 PM (15 months ago)
- File:
-
- 1 edited
-
trunk/linux_spi.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/linux_spi.c
r1512 r1513 131 131 unsigned char *rxbuf) 132 132 { 133 int iocontrol_code; 133 134 struct spi_ioc_transfer msg[2] = { 134 135 { … … 144 145 if (fd == -1) 145 146 return -1; 147 /* The implementation currently does not support requests that 148 don't start with sending a command. */ 149 if (writecnt == 0) 150 return SPI_INVALID_LENGTH; 146 151 147 if (ioctl(fd, SPI_IOC_MESSAGE(2), msg) == -1) { 152 /* Just submit the first (write) request in case there is nothing 153 to read. Otherwise submit both requests. */ 154 if (readcnt == 0) 155 iocontrol_code = SPI_IOC_MESSAGE(1); 156 else 157 iocontrol_code = SPI_IOC_MESSAGE(2); 158 159 if (ioctl(fd, iocontrol_code, msg) == -1) { 148 160 msg_cerr("%s: ioctl: %s\n", __func__, strerror(errno)); 149 161 return -1;
Note: See TracChangeset
for help on using the changeset viewer.
