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: USBDevice USBMSD_SD mbed
Fork of USBMSD_SD_HelloWorld_Mbed by
Diff: USBMSD/USBMSD.cpp
- Revision:
- 9:9c343b9ee6d8
- Parent:
- 8:534fd41d8cc7
- Child:
- 10:cf8fd2b6ca23
--- a/USBMSD/USBMSD.cpp Mon Nov 14 17:50:02 2011 +0000
+++ b/USBMSD/USBMSD.cpp Tue Nov 15 09:16:25 2011 +0000
@@ -81,8 +81,6 @@
//disk initialization
disk_initialize();
-
- //set_status(1 << 1);
// get block size
BlockSize = 512;
@@ -92,15 +90,17 @@
return false;
}
- //get number of blocks
BlockCount = disk_sectors();
- MemorySize = BlockCount * 512;
+ //get memory size
+ MemorySize = BlockCount * BlockSize;
if (!MemorySize) {
return false;
}
- printf("block count: %d\r\n", BlockCount);
- printf("mem size: %d\r\n", MemorySize);
+
+ printf("blockSize: %d\r\n", BlockSize);
+ printf("memSize: %d\r\n", MemorySize);
+ printf("number of blocks: %d\r\n", BlockCount);
//connect the device
USBDevice::connect();
