diff --git a/source/arm11/power.c b/source/arm11/power.c index ee94bae..fbe6cf5 100644 --- a/source/arm11/power.c +++ b/source/arm11/power.c @@ -1,6 +1,8 @@ #include "types.h" #include "util.h" #include "arm11/i2c.h" +#include "arm11/start.h" +#include "arm11/interrupt.h" @@ -28,22 +30,22 @@ { i2cmcu_lcd_poweroff(); i2cmcu_lcd_backlight_poweroff(); - - for(;;) - { - i2c_writeregdata(3, 0x20, 1u); - wait(0x200000); - } + + deinitCpu(); + + i2c_writeregdata(3, 0x20, 1u); + + while(1) waitForInterrupt(); } noreturn void power_reboot(void) { i2cmcu_lcd_poweroff(); i2cmcu_lcd_backlight_poweroff(); - - for(;;) - { - i2c_writeregdata(3, 0x20, 1u << 2); - wait(0x200000); - } + + deinitCpu(); + + i2c_writeregdata(3, 0x20, 1u << 2); + + while(1) waitForInterrupt(); } diff --git a/source/arm9/main.c b/source/arm9/main.c index 24d20c9..56d068d 100644 --- a/source/arm9/main.c +++ b/source/arm9/main.c @@ -16,6 +16,7 @@ #include "arm9/timer.h" #include "arm9/menu.h" #include "arm9/main.h" +#include "arm9/start.h" static void initWifiFlash(void); static u32 mount_fs(void); @@ -272,11 +273,13 @@ noreturn void power_off_safe() { uiClearConsoles(); - uiPrintIfVerbose("Attempting to turn off...\n"); fsUnmountAll(); devs_close(); + + deinitCpu(); + // tell the arm11 we're done PXI_sendWord(PXI_CMD_POWER_OFF);