diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-09-15 23:49:57 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-09-15 23:49:57 +0100 |
| commit | 1d7fb82f0aec11331635532583617d773888b991 (patch) | |
| tree | d1d408fafaa10826967abc1d872a5fc26c7299e1 /stmhal/diskio.c | |
| parent | 6ff42c54bb2c6e950206c380a100db776e3938d8 (diff) | |
stmhal: Change 64-bit arithmetic to 32-bit for SD card block addressing.
By measuring SD card addresses in blocks and not bytes, one can get away
with using 32-bit numbers.
This patch also uses proper atomic lock/unlock around SD card
read/write, adds SD.info() function, and gives error code for failed
read/writes.
Diffstat (limited to 'stmhal/diskio.c')
| -rw-r--r-- | stmhal/diskio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stmhal/diskio.c b/stmhal/diskio.c index 35b9eab99..44059b04d 100644 --- a/stmhal/diskio.c +++ b/stmhal/diskio.c @@ -127,7 +127,7 @@ DRESULT disk_read ( #if MICROPY_HW_HAS_SDCARD case PD_SDCARD: - if (!sdcard_read_blocks(buff, sector, count)) { + if (sdcard_read_blocks(buff, sector, count) != 0) { return RES_ERROR; } return RES_OK; @@ -160,7 +160,7 @@ DRESULT disk_write ( #if MICROPY_HW_HAS_SDCARD case PD_SDCARD: - if (!sdcard_write_blocks(buff, sector, count)) { + if (sdcard_write_blocks(buff, sector, count) != 0) { return RES_ERROR; } return RES_OK; |
