Files
cute-handshake-capture/handshake-capture-c6/SD_Card.h
drjones 804e71e175 handshake-capture-c6: production SD gating (SD_IsReady), v1.0.1
- Gate capture on SD_IsReady() after successful SD_Init; avoid false
  'insert SD' when SD.cardType() lies after WiFi on shared SPI with LCD
- SD_Init: LCD CS high, SD.end() on empty card; HandshakeCapture save path
  retries SD_Init before discard
- FAT filename sanitize, discard deadlocks, WPA3 scan labels, docs (README,
  PRODUCTION, IMPROVEMENTS), firmware version 1.0.1

Made-with: Cursor
2026-03-21 01:12:12 -07:00

18 lines
440 B
C

#pragma once
#include <Arduino.h>
#include <SD.h>
#include <SPI.h>
#define SD_CS 4
extern uint16_t SDCard_Size;
bool SD_Init();
/**
* True only after the last SD_Init() completed successfully (SD.begin + valid cardType).
* Use this to gate capture — do NOT rely on SD.cardType() alone after WiFi on ESP32-C6:
* with LCD+SD sharing SPI, cardType() can spuriously read CARD_NONE and falsely show "insert SD".
*/
bool SD_IsReady();