1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-12-18 16:32:05 +00:00

fatal: Implement BacklightControlTask

This commit is contained in:
Michael Scire 2018-11-10 03:16:13 -08:00
parent e96eaa3d7c
commit 5649b6d63f
4 changed files with 67 additions and 1 deletions

View file

@ -82,6 +82,11 @@ void __appInit(void) {
std::abort(); std::abort();
} }
rc = lblInitialize();
if (R_FAILED(rc)) {
std::abort();
}
rc = psmInitialize(); rc = psmInitialize();
if (R_FAILED(rc)) { if (R_FAILED(rc)) {
std::abort(); std::abort();
@ -99,6 +104,7 @@ void __appExit(void) {
/* Cleanup services. */ /* Cleanup services. */
spsmExit(); spsmExit();
psmExit(); psmExit();
lblExit();
pcvExit(); pcvExit();
bpcExit(); bpcExit();
pminfoExit(); pminfoExit();

View file

@ -19,6 +19,7 @@
#include "fatal_task.hpp" #include "fatal_task.hpp"
#include "fatal_task_error_report.hpp" #include "fatal_task_error_report.hpp"
#include "fatal_task_screen.hpp"
#include "fatal_task_clock.hpp" #include "fatal_task_clock.hpp"
#include "fatal_task_power.hpp" #include "fatal_task_power.hpp"
@ -56,7 +57,7 @@ void RunFatalTasks(FatalContext *ctx, u64 title_id, bool error_report, Event *er
RunTask(new PowerControlTask(ctx, title_id, erpt_event, battery_event)); RunTask(new PowerControlTask(ctx, title_id, erpt_event, battery_event));
/* TODO: RunTask(new ShowFatalTask(ctx, title_id, battery_event)); */ /* TODO: RunTask(new ShowFatalTask(ctx, title_id, battery_event)); */
/* TODO: RunTask(new StopSoundTask(ctx, title_id)); */ /* TODO: RunTask(new StopSoundTask(ctx, title_id)); */
/* TODO: RunTask(new BacklightControlTask(ctx, title_id)); */ RunTask(new BacklightControlTask(ctx, title_id));
RunTask(new AdjustClockTask(ctx, title_id)); RunTask(new AdjustClockTask(ctx, title_id));
RunTask(new PowerButtonObserveTask(ctx, title_id, erpt_event)); RunTask(new PowerButtonObserveTask(ctx, title_id, erpt_event));
RunTask(new StateTransitionStopTask(ctx, title_id)); RunTask(new StateTransitionStopTask(ctx, title_id));

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2018 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <switch.h>
#include "fatal_task_screen.hpp"
void BacklightControlTask::TurnOnBacklight() {
lblSwitchBacklightOn(0);
}
Result BacklightControlTask::Run() {
TurnOnBacklight();
return 0;
}

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2018 Atmosphère-NX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <switch.h>
#include <stratosphere.hpp>
#include "fatal_task.hpp"
class BacklightControlTask : public IFatalTask {
private:
void TurnOnBacklight();
public:
BacklightControlTask(FatalContext *ctx, u64 title_id) : IFatalTask(ctx, title_id) { }
virtual Result Run() override;
virtual const char *GetName() const override {
return "BacklightControlTask";
}
};