touch with abtraction working, SD is not working
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user