Mercurial > ~darius > hgwebdir.cgi > stm32temp
changeset 51:590886732da9
Return correct error defines.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Sun, 07 Apr 2013 22:31:05 +0930 |
parents | d7207a9d3c3b |
children | 9521be9b391e |
files | fatfs_sd.c |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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) {