Make the test for success when programming single blocks the same as that for programming multiple blocks (i.e. the response must be SPI_DATA_ACCEPTED). Otherwise a response of zero (e.g. from a slow SD card) was being treated as success.

pull/7774/head
Rob Meades 2018-05-22 16:13:29 +01:00
parent 21e465bd72
commit ca8aa64b5a
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ int SDBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size)
response = _write(buffer, SPI_START_BLOCK, _block_size);
// Only CRC and general write error are communicated via response token
if ((response == SPI_DATA_CRC_ERROR) || (response == SPI_DATA_WRITE_ERROR)) {
if (response != SPI_DATA_ACCEPTED) {
debug_if(SD_DBG, "Single Block Write failed: 0x%x \n", response);
status = SD_BLOCK_DEVICE_ERROR_WRITE;
}