debug_menu: show 2nd SD/MMC card info only if NUM_DRIVES > 1

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit eafcbd3fd6a72a1a8b1f8854f8cec3b6ea4d0625
Author: Aidan MacDonald <[email protected]>
Date:   Mon Mar 2 10:38:29 2026 +0000

    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

diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 117194b834..71686efba2 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -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 */
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.