File tree Expand file tree Collapse file tree
STM32F1/libraries/SPI/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,7 +322,11 @@ void SPIClass::write(uint16 data) {
322322
323323 spi_tx_reg (_currentSetting->spi_d , data); // "2. Write the first data item to be transmitted into the SPI_DR register (this clears the TXE flag)."
324324 while (spi_is_tx_empty (_currentSetting->spi_d ) == 0 ); // "5. Wait until TXE=1 ..."
325- while (spi_is_busy (_currentSetting->spi_d ) != 0 ); // "... and then wait until BSY=0 before disabling the SPI."
325+ while (spi_is_busy (_currentSetting->spi_d ) != 0 ); // "... and then wait until BSY=0 before disabling the SPI."
326+ // taken from SdSpiSTM32F1.cpp - Victor's lib, and adapted to support device selection
327+ if (spi_is_rx_nonempty (_currentSetting->spi_d )) {
328+ uint8_t b = spi_rx_reg (_currentSetting->spi_d );
329+ }
326330}
327331
328332// void SPIClass::write(uint8 byte) {
You can’t perform that action at this time.
0 commit comments