Updated to use latest headers of USBDevice

Dependents:   USBMSB_Ramdisk_kl25z 14_USBMSB_Ramdisk

Fork of RAM_DISK by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
ragmondo
Date:
Wed May 15 22:38:36 2013 +0000
Parent:
0:ba333853266b
Commit message:
updated to match latest revision of usbdevice library

Changed in this revision

USBMSD_Ram.cpp Show annotated file Show diff for this revision Revisions of this file
USBMSD_Ram.h Show annotated file Show diff for this revision Revisions of this file
diff -r ba333853266b -r 0b8a0be40802 USBMSD_Ram.cpp
--- a/USBMSD_Ram.cpp	Sat Mar 03 07:55:24 2012 +0000
+++ b/USBMSD_Ram.cpp	Wed May 15 22:38:36 2013 +0000
@@ -214,18 +214,18 @@
     return 0;
 }
 
-int USBMSD_Ram::disk_write(const char *buffer, int block_number) { 
+int USBMSD_Ram::disk_write(const uint8_t * buffer, uint64_t block_number) { 
     memcpy((void *)&disk_image[block_number*512], buffer, 512);
     return 0;    
 }
 
-int USBMSD_Ram::disk_read(char *buffer, int block_number) {
+int USBMSD_Ram::disk_read(uint8_t * buffer, uint64_t block_number) {
     memcpy(buffer, &disk_image[block_number*512], 512);
     return 0;
 }
 
 int USBMSD_Ram::disk_status() { return _status; }
 int USBMSD_Ram::disk_sync() { return 0; }
-int USBMSD_Ram::disk_sectors() { return 32; }
-int USBMSD_Ram::disk_size() { return 32*512;}
+uint64_t USBMSD_Ram::disk_sectors() { return 32; }
+uint64_t USBMSD_Ram::disk_size() { return 32*512;}
 
diff -r ba333853266b -r 0b8a0be40802 USBMSD_Ram.h
--- a/USBMSD_Ram.h	Sat Mar 03 07:55:24 2012 +0000
+++ b/USBMSD_Ram.h	Wed May 15 22:38:36 2013 +0000
@@ -43,26 +43,19 @@
 class USBMSD_Ram : public USBMSD {
 public:
 
-    /** Create the File System for accessing an SD Card using SPI
-     *
-     * @param mosi SPI mosi pin connected to SD Card
-     * @param miso SPI miso pin conencted to SD Card
-     * @param sclk SPI sclk pin connected to SD Card
-     * @param cs   DigitalOut pin used as SD Card chip select
-     * @param name The name used to access the virtual filesystem
-     */
+   
     USBMSD_Ram();
     virtual int disk_initialize();
-    virtual int disk_write(const char *buffer, int block_number);
-    virtual int disk_read(char *buffer, int block_number);    
+    virtual int disk_write(const uint8_t * data, uint64_t block);
+    virtual int disk_read(uint8_t * data, uint64_t block);    
     virtual int disk_status();
     virtual int disk_sync();
-    virtual int disk_sectors();
-    virtual int disk_size();
+    virtual uint64_t disk_sectors();
+    virtual uint64_t disk_size();
     
 protected:
     int _status;
-    char disk_image[512*32];
+    char disk_image[512*5];
 
 };