FAT12 read only file system

Fork of FATFileSystem by mbed official

Revision:
8:6c6acf81ff08
Parent:
7:f9f52d9c0c57
--- a/F12RFileHandle.cpp	Wed Nov 11 19:47:04 2015 +0900
+++ b/F12RFileHandle.cpp	Fri Apr 08 06:43:21 2016 +0900
@@ -44,10 +44,10 @@
     FS_DBG("length=%d", length);
     ssize_t n = 0;
     while(n < length && pos < file_length) {
-        uint32_t chunk = std::min(length - n, file_length - pos);
+        uint32_t chunk = std::min((filesize_t)length - n, file_length - pos);
         chunk = std::min(chunk, fs.cluster_tail(pos));
         FS_TEST_ASSERT(cluster >= 2 && cluster < 0xff8);
-        fs.storage->storage_read((fs.base_data + cluster - 2)*512 + fs.cluster_head(pos), (uint8_t*)buffer + n, chunk);
+        fs.storage->Read(fs.base_data + (cluster-2)*fs.cluster_size + fs.cluster_head(pos), (uint8_t*)buffer + n, chunk);
         pos += chunk;
         if (fs.cluster_head(pos) == 0) {
             cluster = fs.fat_read(cluster);