Implement Auto Reboot Timer (#518) (#519)

* Implement Auto Reboot Timer (#518)

* Use > to check for values below -1

* Use TimeoutHelper and accept MS

* Add fatal_auto_reboot_interval into config (commented)

* Check for 0
This commit is contained in:
Sun
2019-04-22 00:18:01 -07:00
committed by SciresM
parent a09c08994f
commit be4ca7eee5
4 changed files with 16 additions and 1 deletions

View File

@@ -18,7 +18,7 @@
#include "fatal_types.hpp"
#include "fatal_config.hpp"
static FatalConfig g_fatal_config;
static FatalConfig g_fatal_config = {};
static IEvent *g_fatal_settings_event = nullptr;
@@ -84,5 +84,8 @@ void InitializeFatalConfig() {
setsysGetFlag(SetSysFlag_Quest, &config->quest_flag);
config->is_auto_reboot_enabled = R_SUCCEEDED(setsysGetSettingsItemValue("atmosphere", "fatal_auto_reboot_interval", &config->fatal_auto_reboot_interval, sizeof(config->fatal_auto_reboot_interval)));
config->is_auto_reboot_enabled &= (config->fatal_auto_reboot_interval != 0);
SetupConfigLanguages();
}