diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-30 12:30:35 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-30 12:30:35 +0100 |
commit | 09d207785c77c85c957471b064ceebe0d2ee0a23 (patch) | |
tree | 6c34e11ee61c820c807db06d3d3cd69611c13ddb /stmhal/diskio.c | |
parent | 24a140a444cfb2ebda7f0b6d0a88be9461a99d03 (diff) | |
download | micropython-09d207785c77c85c957471b064ceebe0d2ee0a23.tar.gz micropython-09d207785c77c85c957471b064ceebe0d2ee0a23.zip |
stmhal: Unify naming of HW config; make SD detect configurable.
All board config macros now begin with MICROPY_HW_.
Renamed PYBv10 to PYBV10, since macros should be all uppercase.
Made SDCARD_DETECT configurable in mpconfigport.h, so that the SD
detect pin can be easily configured.
Diffstat (limited to 'stmhal/diskio.c')
-rw-r--r-- | stmhal/diskio.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/stmhal/diskio.c b/stmhal/diskio.c index 4d6f998f55..0c67a23d68 100644 --- a/stmhal/diskio.c +++ b/stmhal/diskio.c @@ -41,12 +41,14 @@ DSTATUS disk_initialize ( storage_init(); return 0; +#if MICROPY_HW_HAS_SDCARD case PD_SDCARD: if (!sdcard_power_on()) { return STA_NODISK; } // TODO return STA_PROTECT if SD card is read only return 0; +#endif } return STA_NOINIT; @@ -65,9 +67,11 @@ DSTATUS disk_status ( // flash is ready return 0; +#if MICROPY_HW_HAS_SDCARD case PD_SDCARD: // TODO return STA_PROTECT if SD card is read only return 0; +#endif } return STA_NOINIT; @@ -93,11 +97,13 @@ DRESULT disk_read ( } return RES_OK; +#if MICROPY_HW_HAS_SDCARD case PD_SDCARD: if (!sdcard_read_blocks(buff, sector, count)) { return RES_ERROR; } return RES_OK; +#endif } return RES_PARERR; @@ -124,11 +130,13 @@ DRESULT disk_write ( } return RES_OK; +#if MICROPY_HW_HAS_SDCARD case PD_SDCARD: if (!sdcard_write_blocks(buff, sector, count)) { return RES_ERROR; } return RES_OK; +#endif } return RES_PARERR; @@ -160,6 +168,7 @@ DRESULT disk_ioctl ( } break; +#if MICROPY_HW_HAS_SDCARD case PD_SDCARD: switch (cmd) { case CTRL_SYNC: @@ -170,6 +179,7 @@ DRESULT disk_ioctl ( return RES_OK; } break; +#endif } return RES_PARERR; |