git-svn-id: svn://db.shs.com.ru/pip@573 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
4
main.cpp
4
main.cpp
@@ -13,8 +13,10 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
PIString path = cli.argumentValue("dev");
|
||||
PISPI spi(path, 1000000);
|
||||
spi.setDebug(true);
|
||||
piCout << "SPI" << path;
|
||||
//spi.setDebug(true);
|
||||
if (cli.hasArgument("speed")) spi.setSpeed(cli.argumentValue("speed").toInt());
|
||||
piCout << "try opening..";
|
||||
piCout << "open" << spi.open();
|
||||
piCout << "write" << spi.write(PIByteArray::fromHex("0000000000000000000000000000000000000000000000000000000000000000"));
|
||||
piCout << "read" << spi.readForTime(10).toHex();
|
||||
|
||||
@@ -93,7 +93,7 @@ int PISPI::writeDevice(const void * data, int max_size) {
|
||||
ret = ioctl(PRIVATE->fd, SPI_IOC_MESSAGE(1), &PRIVATE->spi_ioc_tr);
|
||||
if (ret < 1) {piCoutObj << "can't send spi message" << ret; return -1;}
|
||||
recv_buf.append(rx_buf);
|
||||
if (recv_buf.size() > threadedReadBufferSize()) recv_buf.resize(threadedReadBufferSize());
|
||||
if (recv_buf.size_s() > threadedReadBufferSize()) recv_buf.resize(threadedReadBufferSize());
|
||||
return max_size;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user