mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-07-05 17:12:14 +02:00
Implement Auto Reboot Timer (#518)
This commit is contained in:
parent
a09c08994f
commit
650ee8fd97
@ -84,5 +84,10 @@ void InitializeFatalConfig() {
|
|||||||
|
|
||||||
setsysGetFlag(SetSysFlag_Quest, &config->quest_flag);
|
setsysGetFlag(SetSysFlag_Quest, &config->quest_flag);
|
||||||
|
|
||||||
|
if(R_FAILED(setsysGetSettingsItemValue("atmosphere", "fatal_auto_reboot_interval", &config->fatal_auto_reboot_interval, sizeof(config->fatal_auto_reboot_interval)))) {
|
||||||
|
config->fatal_auto_reboot_interval = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SetupConfigLanguages();
|
SetupConfigLanguages();
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ struct FatalConfig {
|
|||||||
const char *error_msg;
|
const char *error_msg;
|
||||||
const char *error_desc;
|
const char *error_desc;
|
||||||
const char *quest_desc;
|
const char *quest_desc;
|
||||||
|
s64 fatal_auto_reboot_interval;
|
||||||
};
|
};
|
||||||
|
|
||||||
IEvent *GetFatalSettingsEvent();
|
IEvent *GetFatalSettingsEvent();
|
||||||
|
@ -96,6 +96,12 @@ void PowerButtonObserveTask::WaitForPowerButton() {
|
|||||||
const FatalConfig *config = GetFatalConfig();
|
const FatalConfig *config = GetFatalConfig();
|
||||||
TimeoutHelper reboot_helper(config->quest_reboot_interval_second * 1000000000UL);
|
TimeoutHelper reboot_helper(config->quest_reboot_interval_second * 1000000000UL);
|
||||||
|
|
||||||
|
if (config->fatal_auto_reboot_interval != -1) {
|
||||||
|
svcSleepThread(config->fatal_auto_reboot_interval);
|
||||||
|
bpcRebootSystem();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool check_vol_up = true, check_vol_down = true;
|
bool check_vol_up = true, check_vol_down = true;
|
||||||
GpioPadSession vol_up_btn, vol_down_btn;
|
GpioPadSession vol_up_btn, vol_down_btn;
|
||||||
if (R_FAILED(gpioOpenSession(&vol_up_btn, GpioPadName_ButtonVolUp))) {
|
if (R_FAILED(gpioOpenSession(&vol_up_btn, GpioPadName_ButtonVolUp))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user