Switch to updating all 4 bytes of the IRQ mask, on the suggestion of profi200.

This commit is contained in:
selabnayr 2019-07-05 15:37:54 -07:00
parent 0bc51d5c34
commit 3061001fb1

View File

@ -150,7 +150,7 @@ void SysConfigMenu_ToggleWireless(void)
void SysConfigMenu_TogglePowerButton(void) void SysConfigMenu_TogglePowerButton(void)
{ {
u8 result; u32 mcuIRQMask;
Draw_Lock(); Draw_Lock();
Draw_ClearFramebuffer(); Draw_ClearFramebuffer();
@ -158,7 +158,7 @@ void SysConfigMenu_TogglePowerButton(void)
Draw_Unlock(); Draw_Unlock();
mcuHwcInit(); mcuHwcInit();
MCUHWC_ReadRegister(0x18, &result, 1); MCUHWC_ReadRegister(0x18, (u8*)&mcuIRQMask, 4);
mcuHwcExit(); mcuHwcExit();
do do
@ -168,7 +168,7 @@ void SysConfigMenu_TogglePowerButton(void)
Draw_DrawString(10, 30, COLOR_WHITE, "Press A to toggle, press B to go back."); Draw_DrawString(10, 30, COLOR_WHITE, "Press A to toggle, press B to go back.");
Draw_DrawString(10, 50, COLOR_WHITE, "Current status:"); Draw_DrawString(10, 50, COLOR_WHITE, "Current status:");
Draw_DrawString(100, 50, (((result & 0x01) == 0x01) ? COLOR_RED : COLOR_GREEN), (((result & 0x01) == 0x01) ? " DISABLED" : " ENABLED ")); Draw_DrawString(100, 50, (((mcuIRQMask & 0x00000001) == 0x00000001) ? COLOR_RED : COLOR_GREEN), (((mcuIRQMask & 0x00000001) == 0x00000001) ? " DISABLED" : " ENABLED "));
Draw_FlushFramebuffer(); Draw_FlushFramebuffer();
Draw_Unlock(); Draw_Unlock();
@ -178,9 +178,9 @@ void SysConfigMenu_TogglePowerButton(void)
if(pressed & BUTTON_A) if(pressed & BUTTON_A)
{ {
mcuHwcInit(); mcuHwcInit();
MCUHWC_ReadRegister(0x18, &result, 1); MCUHWC_ReadRegister(0x18, (u8*)&mcuIRQMask, 4);
result ^= 0x01; mcuIRQMask ^= 0x00000001;
MCUHWC_WriteRegister(0x18, &result, 1); MCUHWC_WriteRegister(0x18, (u8*)&mcuIRQMask, 4);
mcuHwcExit(); mcuHwcExit();
} }
else if(pressed & BUTTON_B) else if(pressed & BUTTON_B)