# HG changeset patch # User Daniel O'Connor # Date 1365339665 -34200 # Node ID 590886732da94a941a95bed9638721fd5b18e71a # Parent d7207a9d3c3b6624e9948dfff54b998c2b58fafd Return correct error defines. diff -r d7207a9d3c3b -r 590886732da9 fatfs_sd.c --- a/fatfs_sd.c Fri Apr 05 00:08:31 2013 +1030 +++ b/fatfs_sd.c Sun Apr 07 22:31:05 2013 +0930 @@ -89,7 +89,7 @@ DEBUG("disk_read(%d, 0x%08x, %d, %d)\n", pdrv, buff, sector, count); if (pdrv != 0) - return STA_NOINIT; + return RES_ERROR; if (count == 1) err = SD_ReadBlock(buff, sector * SD_BLOCK_SIZE, SD_BLOCK_SIZE); @@ -99,12 +99,12 @@ #ifdef SD_DMA_MODE if ((err = SD_WaitReadOperation()) != SD_OK) { printf("Wait returned %s\n", sderr2str(err)); - goto read_exit; + return RES_ERROR; } #endif if (err != SD_OK) { printf("Read failed: %s\n", sderr2str(err)); - return STA_NOINIT; + return RES_ERROR; } while(SD_GetStatus() != SD_TRANSFER_OK) @@ -119,7 +119,7 @@ DEBUG("disk_write(%d, 0x%08x, %d, %d)\n", pdrv, buff, sector, count); if (pdrv != 0) - return RES_NOTRDY; + return RES_ERROR; if (count == 1) err = SD_WriteBlock(buff, sector * SD_BLOCK_SIZE, SD_BLOCK_SIZE); @@ -129,7 +129,7 @@ #ifdef SD_DMA_MODE if ((err = SD_WaitReadOperation()) != SD_OK) { printf("Wait returned %s\n", sderr2str(err)); - goto read_exit; + return RES_ERROR; } #endif if (err != SD_OK) {