Compare commits

..

2 commits

Author SHA1 Message Date
Aidan MacDonald
a1b7e7b134 sdmmc_host: mark tCardInfo initialized at end of card init
This is needed to display card info in the debug menu.

Change-Id: I2e45edd9a9e26834efac48cea892157588c546a7
2026-03-02 17:11:33 -05:00
Aidan MacDonald
eafcbd3fd6 debug_menu: show 2nd SD/MMC card info only if NUM_DRIVES > 1
Toggling to the second card was allowed if HAVE_HOTSWAP
was defined, but on targets with a single hotswappable
SD card -- for example many JZ47xx/X1000 targets -- this
ends up calling card_get_info() on a non-existent drive.

A slightly better option is to check if NUM_DRIVES is
greater than 1. This is still just guessing the number
of SD/MMC slots, but it should be wrong in fewer cases.

Change-Id: Ifca29323f1c7091d9cce55c73147d0d1decae9a5
2026-03-02 17:10:55 -05:00
2 changed files with 2 additions and 1 deletions

View file

@ -1283,7 +1283,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
if ((btn == ACTION_STD_OK) || (btn == SYS_FS_CHANGED) || (btn == ACTION_REDRAW))
{
#ifdef HAVE_HOTSWAP
#if NUM_DRIVES > 1
if (btn == ACTION_STD_OK)
{
*cardnum ^= 0x1; /* change cards */

View file

@ -639,6 +639,7 @@ static int sdmmc_host_device_init(struct sdmmc_host *host)
}
host->initialized = true;
host->cardinfo.initialized = true;
return 0;
}