spi: fix the misleading example, letting the master wait until slave is ready

This commit is contained in:
Michael (XIAO Xufeng) 2018-08-29 18:40:21 +08:00
parent 27f3c3e668
commit 0c64d8e822

View File

@ -152,7 +152,7 @@ void app_main()
t.tx_buffer=sendbuf; t.tx_buffer=sendbuf;
t.rx_buffer=recvbuf; t.rx_buffer=recvbuf;
//Wait for slave to be ready for next byte before sending //Wait for slave to be ready for next byte before sending
xSemaphoreTake(rdySem, 100);//portMAX_DELAY); //Wait until slave is ready xSemaphoreTake(rdySem, portMAX_DELAY); //Wait until slave is ready
ret=spi_device_transmit(handle, &t); ret=spi_device_transmit(handle, &t);
printf("Received: %s\n", recvbuf); printf("Received: %s\n", recvbuf);
n++; n++;