Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FATFileSystem mbed-rtos
Fork of USBHost by
Revision 33:6c4cab4d356f, committed 2015-12-11
- Comitter:
- mbed_official
- Date:
- Fri Dec 11 16:16:06 2015 +0000
- Parent:
- 32:140defdf151c
- Child:
- 34:028508fd50fa
- Commit message:
- Synchronized with git revision bee1c953f03a0e4f6a4c397e97409076516614a4
Full URL: https://github.com/mbedmicro/mbed/commit/bee1c953f03a0e4f6a4c397e97409076516614a4/
FATFileSystem -Fixed API integer widths
Changed in this revision
| USBHostMSD/USBHostMSD.cpp | Show annotated file Show diff for this revision Revisions of this file |
| USBHostMSD/USBHostMSD.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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();
--- a/USBHostMSD/USBHostMSD.h Fri Oct 16 07:46:31 2015 +0100
+++ b/USBHostMSD/USBHostMSD.h Fri Dec 11 16:16:06 2015 +0000
@@ -59,10 +59,10 @@
// From FATFileSystem
virtual int disk_initialize();
virtual int disk_status() {return 0;};
- virtual int disk_read(uint8_t* buffer, uint64_t sector, uint8_t count);
- virtual int disk_write(const uint8_t* buffer, uint64_t sector, uint8_t count);
+ virtual int disk_read(uint8_t* buffer, uint32_t sector, uint32_t count);
+ virtual int disk_write(const uint8_t* buffer, uint32_t sector, uint32_t count);
virtual int disk_sync() {return 0;};
- virtual uint64_t disk_sectors();
+ virtual uint32_t disk_sectors();
private:
USBHost * host;
@@ -104,7 +104,7 @@
int getMaxLun();
int blockSize;
- uint64_t blockCount;
+ uint32_t blockCount;
int msd_intf;
bool msd_device_found;
