2018.07.26
Dependencies: FATFileSystem3 mbed-rtos
Fork of USBHost by
Diff: USBHostMSD/USBHostMSD.cpp
- Revision:
- 37:6c4cab4d356f
- Parent:
- 27:4206883f4cb7
diff -r 140defdf151c -r 6c4cab4d356f USBHostMSD/USBHostMSD.cpp --- a/USBHostMSD/USBHostMSD.cpp Fri Oct 16 07:46:31 2015 +0100 +++ b/USBHostMSD/USBHostMSD.cpp Fri Dec 11 16:16:06 2015 +0000 @@ -323,14 +323,14 @@ return readCapacity(); } -int USBHostMSD::disk_write(const uint8_t* buffer, uint64_t block_number, uint8_t count) { +int USBHostMSD::disk_write(const uint8_t* buffer, uint32_t block_number, uint32_t count) { USB_DBG("FILESYSTEM: write block: %lld, count: %d", block_number, count); if (!disk_init) { disk_initialize(); } if (!disk_init) return -1; - for (uint64_t b = block_number; b < block_number + count; b++) { + for (uint32_t b = block_number; b < block_number + count; b++) { if (dataTransfer((uint8_t*)buffer, b, 1, HOST_TO_DEVICE)) return -1; buffer += 512; @@ -338,14 +338,14 @@ return 0; } -int USBHostMSD::disk_read(uint8_t* buffer, uint64_t block_number, uint8_t count) { +int USBHostMSD::disk_read(uint8_t* buffer, uint32_t block_number, uint32_t count) { USB_DBG("FILESYSTEM: read block: %lld, count: %d", block_number, count); if (!disk_init) { disk_initialize(); } if (!disk_init) return -1; - for (uint64_t b = block_number; b < block_number + count; b++) { + for (uint32_t b = block_number; b < block_number + count; b++) { if (dataTransfer((uint8_t*)buffer, b, 1, DEVICE_TO_HOST)) return -1; buffer += 512; @@ -353,7 +353,7 @@ return 0; } -uint64_t USBHostMSD::disk_sectors() { +uint32_t USBHostMSD::disk_sectors() { USB_DBG("FILESYSTEM: sectors"); if (!disk_init) { disk_initialize();