Fork of USBMSD_SD

Fork of USBMSD_SD by Samuel Mokrani

Files at this revision

API Documentation at this revision

Comitter:
bridadan
Date:
Fri Dec 11 18:31:55 2015 +0000
Parent:
2:055119ccf5a7
Commit message:
Updating USBMSD_SD to new FatFileSystem

Changed in this revision

USBMSD_SD.cpp Show annotated file Show diff for this revision Revisions of this file
USBMSD_SD.h Show annotated file Show diff for this revision Revisions of this file
diff -r 055119ccf5a7 -r 6c4fc521977a USBMSD_SD.cpp
--- a/USBMSD_SD.cpp	Mon Jan 21 10:40:05 2013 +0000
+++ b/USBMSD_SD.cpp	Fri Dec 11 18:31:55 2015 +0000
@@ -222,9 +222,9 @@
     return 0;
 }
 
-int USBMSD_SD::disk_write(const uint8_t *buffer, uint64_t block_number) {
+int USBMSD_SD::disk_write(const uint8_t *buffer, uint64_t block, uint8_t count) {
     // set write address for single block (CMD24)
-    if (_cmd(24, block_number * cdv) != 0) {
+    if (_cmd(24, block * cdv) != 0) {
         return 1;
     }
     
@@ -233,9 +233,9 @@
     return 0;
 }
 
-int USBMSD_SD::disk_read(uint8_t *buffer, uint64_t block_number) {
+int USBMSD_SD::disk_read(uint8_t *buffer, uint64_t block, uint8_t count) {
     // set read address for single block (CMD17)
-    if (_cmd(17, block_number * cdv) != 0) {
+    if (_cmd(17, block * cdv) != 0) {
         return 1;
     }
     
diff -r 055119ccf5a7 -r 6c4fc521977a USBMSD_SD.h
--- a/USBMSD_SD.h	Mon Jan 21 10:40:05 2013 +0000
+++ b/USBMSD_SD.h	Fri Dec 11 18:31:55 2015 +0000
@@ -54,8 +54,8 @@
     USBMSD_SD(PinName mosi, PinName miso, PinName sclk, PinName cs);
     virtual int disk_initialize();
     virtual int disk_status();
-    virtual int disk_read(uint8_t * buffer, uint64_t block_number);
-    virtual int disk_write(const uint8_t * buffer, uint64_t block_number);
+    virtual int disk_read(uint8_t * buffer, uint64_t block, uint8_t count);
+    virtual int disk_write(const uint8_t * buffer, uint64_t block, uint8_t count);
     virtual int disk_sync();
     virtual uint64_t disk_sectors();