diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-27 23:10:18 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-27 23:22:15 +1100 |
commit | 3242cf2d364b40fd26a643f1c618e8b51cef0139 (patch) | |
tree | 7bb63b57a42435ed0809e6fb65b0b391750567f7 | |
parent | 4565d42e707705a0763fddee18f24133d1756db4 (diff) | |
download | micropython-3242cf2d364b40fd26a643f1c618e8b51cef0139.tar.gz micropython-3242cf2d364b40fd26a643f1c618e8b51cef0139.zip |
stmhal/usbd_msc_storage: Use storage functions instead of disk ones.
-rw-r--r-- | stmhal/usbd_msc_storage.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/stmhal/usbd_msc_storage.c b/stmhal/usbd_msc_storage.c index 82fa550dc9..cec9737418 100644 --- a/stmhal/usbd_msc_storage.c +++ b/stmhal/usbd_msc_storage.c @@ -37,7 +37,6 @@ #include "usbd_msc_storage.h" #include "py/misc.h" -#include "lib/fatfs/diskio.h" #include "storage.h" #include "sdcard.h" @@ -121,7 +120,7 @@ int8_t FLASH_STORAGE_StartStopUnit(uint8_t lun, uint8_t started) { int8_t FLASH_STORAGE_PreventAllowMediumRemoval(uint8_t lun, uint8_t param) { // sync the flash so that the cache is cleared and the device can be unplugged/turned off - disk_ioctl(0, CTRL_SYNC, NULL); + storage_flush(); return 0; } @@ -134,7 +133,7 @@ int8_t FLASH_STORAGE_PreventAllowMediumRemoval(uint8_t lun, uint8_t param) { * @retval Status */ int8_t FLASH_STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) { - disk_read(0, buf, blk_addr, blk_len); + storage_read_blocks(buf, blk_addr, blk_len); /* for (int i = 0; i < blk_len; i++) { if (!storage_read_block(buf + i * FLASH_BLOCK_SIZE, blk_addr + i)) { @@ -154,7 +153,7 @@ int8_t FLASH_STORAGE_Read(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t * @retval Status */ int8_t FLASH_STORAGE_Write (uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len) { - disk_write(0, buf, blk_addr, blk_len); + storage_write_blocks(buf, blk_addr, blk_len); /* for (int i = 0; i < blk_len; i++) { if (!storage_write_block(buf + i * FLASH_BLOCK_SIZE, blk_addr + i)) { |