MCPcopy Create free account
hub / github.com/OpenEPaperLink/OpenEPaperLink / initSDCard

Function initSDCard

ESP32_AP-Flasher/src/storage.cpp:33–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31static bool sd_init_done = false;
32#ifdef SD_CARD_SDMMC
33static void initSDCard() {
34 if(!SD_MMC.begin("/sdcard", true, true, BOARD_MAX_SDMMC_FREQ, 5)){
35 Serial.println("Card Mount Failed");
36 return;
37 }
38 uint8_t cardType = SD_MMC.cardType();
39
40 if(cardType == CARD_NONE){
41 Serial.println("No SD_MMC card attached");
42 return;
43 }
44
45 Serial.print("SD_MMC Card Type: ");
46 if(cardType == CARD_MMC){
47 Serial.println("MMC");
48 } else if(cardType == CARD_SD){
49 Serial.println("SDSC");
50 } else if(cardType == CARD_SDHC){
51 Serial.println("SDHC");
52 } else {
53 Serial.println("UNKNOWN");
54 }
55
56 uint64_t cardSize = SD_MMC.cardSize() / (1024 * 1024);
57 Serial.printf("SD_MMC Card Size: %lluMB\n", cardSize);
58
59 contentFS = &SD_MMC;
60}
61#else
62static SPIClass* spi;
63

Callers 1

beginMethod · 0.70

Calls 4

printlnMethod · 0.80
printfMethod · 0.80
beginMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected