touch with abtraction working, SD is not working

This commit is contained in:
Adolfo Reyna
2026-01-28 23:23:49 -05:00
parent adfbef7228
commit d19a2ca639
13 changed files with 756 additions and 209 deletions

View File

@@ -9,6 +9,7 @@
#include <string.h>
#include <stdio.h>
static sd_card_config_t g_config_storage;
static const sd_card_config_t *g_config = NULL;
static sd_card_info_t g_card_info = {0};
@@ -91,7 +92,9 @@ static uint8_t sd_card_send_acmd(uint8_t acmd, uint32_t arg) {
bool sd_card_init(const sd_card_config_t *config) {
if (config == NULL) return false;
g_config = config;
// Copy config to static storage to avoid dangling pointer
memcpy(&g_config_storage, config, sizeof(sd_card_config_t));
g_config = &g_config_storage;
memset(&g_card_info, 0, sizeof(g_card_info));
// Initialize CS pin (active low)