ams.mitm: add bpc handler, for reboot power button stuff

This commit is contained in:
Michael Scire 2019-02-04 21:17:05 -08:00
parent e715197290
commit 784964d49d
12 changed files with 226 additions and 26 deletions

View file

@ -16,7 +16,6 @@
#include <switch.h>
#include "fatal_task_power.hpp"
#include "fatal_payload_manager.hpp"
#include "fatal_config.hpp"
bool PowerControlTask::TryShutdown() {
@ -124,13 +123,11 @@ void PowerButtonObserveTask::WaitForPowerButton() {
Result rc = 0;
if (check_vol_up && R_SUCCEEDED((rc = gpioPadGetValue(&vol_up_btn, &val))) && val == GpioValue_Low) {
/* Tell exosphere to reboot to payload. */
FatalPayloadManager::RebootToPayload();
bpcRebootSystem();
}
if (check_vol_down && R_SUCCEEDED((rc = gpioPadGetValue(&vol_down_btn, &val))) && val == GpioValue_Low) {
/* Tell exosphere to reboot to payload. */
FatalPayloadManager::RebootToPayload();
bpcRebootSystem();
}
if ((R_SUCCEEDED(rc = bpcGetSleepButtonState(&state)) && state == BpcSleepButtonState_Held) || (config->quest_flag && reboot_helper.TimedOut())) {