USBDevice with support for STM32F3

Fork of F042K6_USBDevice by Norimasa Okamoto

Revision:
7:f8f057664123
Parent:
5:d27e4c226965
Child:
8:335f2506f422
--- a/USBMSD/USBMSD.cpp	Thu Dec 20 17:05:37 2012 +0000
+++ b/USBMSD/USBMSD.cpp	Mon Jan 21 10:41:28 2013 +0000
@@ -114,7 +114,7 @@
     // get memory size
     MemorySize = disk_size();
 
-    if (BlockCount >= 0) {
+    if (BlockCount > 0) {
         BlockSize = MemorySize / BlockCount;
         if (BlockSize != 0) {
             page = (uint8_t *)malloc(BlockSize * sizeof(uint8_t));
@@ -222,7 +222,7 @@
     // if the array is filled, write it in memory
     if (!((addr + size)%BlockSize)) {
         if (!(disk_status() & WRITE_PROTECT)) {
-            disk_write((const char *)page, addr/BlockSize);
+            disk_write(page, addr/BlockSize);
         }
     }
 
@@ -247,7 +247,7 @@
 
     // beginning of a new block -> load a whole block in RAM
     if (!(addr%BlockSize))
-        disk_read((char *)page, addr/BlockSize);
+        disk_read(page, addr/BlockSize);
 
     // info are in RAM -> no need to re-read memory
     for (n = 0; n < size; n++) {
@@ -495,7 +495,7 @@
 
     // we read an entire block
     if (!(addr%BlockSize))
-        disk_read((char *)page, addr/BlockSize);
+        disk_read(page, addr/BlockSize);
 
     // write data which are in RAM
     writeNB(EPBULK_IN, &page[addr%BlockSize], n, MAX_PACKET_SIZE_EPBULK);