Home > OS >  A question about SELECT under LINUX
A question about SELECT under LINUX

Time:03-13

Do the host application under LINUX SPI, the following program
SPI do the host, if not read this function, the SPI clock will not start, so spi_fd this should not have change to read file sets,
FD_ISSET (spi_fd, & amp; RDFDS), the return value should not effective? But actually, the program has been able to carry out the location of the AAA, why??
While (1) {
FD_ZERO (& amp; RDFDS);
FD_SET (spi_fd, & amp; RDFDS);
Fds_ret=select (spi_fd + 1, & amp; RDFDS, NULL, NULL, & amp; TV);
If (fds_ret==0) {
}
Else if (fds_ret & lt; 0 {
}
Else if (FD_ISSET (spi_fd, & amp; RDFDS)) {
AAA
}
  • Related