Browse Source

Support W-04 firmware 4.0.0.01+

W-04 needs to use  CMD17 instead of CMD48 to retrieve iSDIO register memories.
To supporting both W-03 and W-04 card, I changed the readExt() code to use CMD48 first and use CMD17 if it returned some error.
This method is from the FlashAir developer sample code.
https://flashair-developers.github.io/website/docs/tutorials/arduino/2
odaki 4 years ago
parent
commit
2ca1bc0acb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Firmware/Sd2Card.cpp

+ 1 - 1
Firmware/Sd2Card.cpp

@@ -774,7 +774,7 @@ uint8_t Sd2Card::readExt(uint32_t arg, uint8_t* dst, uint16_t count) {
   uint16_t i;
 
   // send command and argument.
-  if (cardCommand(CMD48, arg)) {
+  if (cardCommand(CMD48, arg) && cardCommand(CMD17, arg)) { // CMD48 for W-03, CMD17 for W-04
     error(SD_CARD_ERROR_CMD48);
     goto fail;
   }