summaryrefslogtreecommitdiff
path: root/stmhal/diskio.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-09-15 23:49:57 +0100
committerDamien George <damien.p.george@gmail.com>2014-09-15 23:49:57 +0100
commit1d7fb82f0aec11331635532583617d773888b991 (patch)
treed1d408fafaa10826967abc1d872a5fc26c7299e1 /stmhal/diskio.c
parent6ff42c54bb2c6e950206c380a100db776e3938d8 (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.c4
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;