Initial commit: handshake capture firmware for ESP32-C6 1.47" LCD
Made-with: Cursor
This commit is contained in:
19
handshake-capture-c6/SD_Card.cpp
Normal file
19
handshake-capture-c6/SD_Card.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "SD_Card.h"
|
||||
#include "Display_ST7789.h"
|
||||
|
||||
uint16_t SDCard_Size = 0;
|
||||
|
||||
bool SD_Init() {
|
||||
pinMode(SD_CS, OUTPUT);
|
||||
digitalWrite(SD_CS, HIGH);
|
||||
if (!SD.begin(SD_CS, SPI)) {
|
||||
Serial.println("SD init failed");
|
||||
return false;
|
||||
}
|
||||
if (SD.cardType() == CARD_NONE) {
|
||||
Serial.println("No SD card");
|
||||
return false;
|
||||
}
|
||||
SDCard_Size = SD.totalBytes() / (1024 * 1024);
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user