Bläddra i källkod

Update to SdFat 2.2.0

Eric Helgeson 3 år sedan
förälder
incheckning
25fd946574
4 ändrade filer med 17 tillägg och 10 borttagningar
  1. 13 1
      lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp
  2. 1 1
      platformio.ini
  3. 2 7
      src/BlueSCSI.cpp
  4. 1 1
      src/BlueSCSI_disk.cpp

+ 13 - 1
lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

@@ -189,6 +189,18 @@ bool SdioCard::readCSD(csd_t* csd)
     return true;
 }
 
+bool SdioCard::readSCR(scr_t *scr)
+{
+    bluelog("SdioCard::readSCR() called but not implemented!");
+    return false;
+}
+
+bool SdioCard::cardCMD6(uint32_t arg, uint8_t* status)
+{
+    bluelog("SdioCard::cardCMD6() called but not implemented!");
+    return false;
+}
+
 bool SdioCard::readOCR(uint32_t* ocr)
 {
     // SDIO mode does not have CMD58, but main program uses this to
@@ -216,7 +228,7 @@ bool SdioCard::readStop()
 
 uint32_t SdioCard::sectorCount()
 {
-    return sdCardCapacity(&g_sdio_csd);
+    return g_sdio_csd.capacity();
 }
 
 uint32_t SdioCard::status()

+ 1 - 1
platformio.ini

@@ -13,7 +13,7 @@ extra_scripts = src/build_bootloader.py
 board_build.ldscript = lib/BlueSCSI_platform_RP2040/rp2040.ld
 ldscript_bootloader = lib/BlueSCSI_platform_RP2040/rp2040_btldr.ld
 lib_deps =
-    SdFat=https://github.com/greiman/SdFat#2.1.2
+    SdFat=https://github.com/greiman/SdFat#2.2.0
     minIni
     BlueSCSI_platform_RP2040
     SCSI2SD

+ 2 - 7
src/BlueSCSI.cpp

@@ -115,13 +115,8 @@ void print_sd_info()
 
     char sdname[6] = {sd_cid.pnm[0], sd_cid.pnm[1], sd_cid.pnm[2], sd_cid.pnm[3], sd_cid.pnm[4], 0};
     bluelog("SD Name: ", sdname);
-
-    char sdyear[5] = "2000";
-    sdyear[2] += sd_cid.mdt_year_high;
-    sdyear[3] += sd_cid.mdt_year_low;
-    bluelog("SD Date: ", (int)sd_cid.mdt_month, "/", sdyear);
-
-    bluelog("SD Serial: ", sd_cid.psn);
+    bluelog("SD Date: ", (int)sd_cid.mdtMonth(), "/", sd_cid.mdtYear());
+    bluelog("SD Serial: ", sd_cid.psn());
   }
 }
 

+ 1 - 1
src/BlueSCSI_disk.cpp

@@ -396,7 +396,7 @@ static void setDefaultDriveInfo(int target_idx)
         uint32_t sd_sn = 0;
         if (SD.card()->readCID(&sd_cid))
         {
-            sd_sn = sd_cid.psn;
+            sd_sn = sd_cid.psn();
         }
 
         memset(img.serial, 0, sizeof(img.serial));