Disable poweroff when shell closed on NTRboothax altogether to prevent issues with unstable magnets

This commit is contained in:
Aurora Wright 2017-12-18 21:02:41 +01:00
parent f30b7b9fb3
commit be0f50b19c

View File

@ -68,11 +68,10 @@ static u64 chrono(void)
u32 waitInput(bool isMenu) u32 waitInput(bool isMenu)
{ {
static u64 dPadDelay = 0ULL; static u64 dPadDelay = 0ULL;
static u32 shouldShellShutdown = 2;
u64 initialValue = 0ULL; u64 initialValue = 0ULL;
u32 key, u32 key,
oldKey = HID_PAD; oldKey = HID_PAD;
if(shouldShellShutdown == 2) shouldShellShutdown = (bootType == B9SNTR || bootType == NTR) ? 0 : 1; bool shouldShellShutdown = bootType != B9SNTR && bootType != NTR;
if(isMenu) if(isMenu)
{ {
@ -87,13 +86,8 @@ u32 waitInput(bool isMenu)
if(!key) if(!key)
{ {
if((i2cReadRegister(I2C_DEV_MCU, 0x10) & 1) == 1) mcuPowerOff(); if((!(i2cReadRegister(I2C_DEV_MCU, 0xF) & 2) && shouldShellShutdown) ||
if(!(i2cReadRegister(I2C_DEV_MCU, 0xF) & 2)) (i2cReadRegister(I2C_DEV_MCU, 0x10) & 1) == 1) mcuPowerOff();
{
if(shouldShellShutdown) mcuPowerOff();
}
else shouldShellShutdown = 1;
oldKey = 0; oldKey = 0;
dPadDelay = 0; dPadDelay = 0;
continue; continue;