S_INFO_MENU_CURRENT gInfoMenuCurrent :
global structure containing the current menu and associated functions. This structure contains a pointer to a banked structure (structPtr). See the following :
typedef struct
{
s16 choix_u08; /*!< Menu current choice. Shall be signed for cds getString() */
u08 refresh_u08; /*!< Do we need a refresh? TRUE/FALSE */
u08 curseurPos_u08; /*!< Menu current possition. */
HID_LANGUE_TYPEDEF langue_enum; /*!< Current language. */
s08 menuFct_s08; /*!< Menu type. */
void BANK_PTR structPtr; /*!< Menu Structure. */
u08 DontWantLangueChoice; /*!< On specific menu, we don't want FN1 as langue button. */
}S_INFO_MENU_CURRENT;
The following code will generate a crash :
HID_CONFIG_MENU_INFO BANK_PTR menuPtr = (HID_CONFIG_MENU_INFO BANK_PTR)gInfoMenuCurrent.structPtr;
// Banked variables first
gInfoMenuCurrent.curseurPos_u08 = menuPtr->cursorPosPrec_u08;
gInfoMenuCurrent.choix_u08 = menuPtr->choixPrec_u08;
gInfoMenuCurrent.structPtr = menuPtr->menuPrecStruct;
gInfoMenuCurrent.menuFct_s08 = menuPtr->menuPrecFct_s08;
gInfoMenuCurrent.refresh_u08 = TRUE;
// Direct variable after
gRefreshDelay = HID_KEY_HOLD_DELAY; // WARNING : code will crash HERE! Tested with debugger
return;
已解决! 转到解答。