mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[apps/on_boarding] Visually hide the LCD POST to the user
By initing the backlight after the test, not before.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace OnBoarding {
|
||||
|
||||
LogoController::LogoController() :
|
||||
ViewController(nullptr),
|
||||
Timer(10),
|
||||
Timer(15),
|
||||
m_logoView(),
|
||||
m_previousLEDColor(KDColorBlack)
|
||||
{
|
||||
@@ -18,8 +18,8 @@ bool LogoController::fire() {
|
||||
}
|
||||
|
||||
void LogoController::viewWillAppear() {
|
||||
ViewController::viewWillAppear();
|
||||
m_previousLEDColor = PowerOnSelfTest::Perform();
|
||||
ViewController::viewWillAppear();
|
||||
}
|
||||
|
||||
void LogoController::viewDidDisappear() {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#include "power_on_self_test.h"
|
||||
#include <ion/backlight.h>
|
||||
#include <ion/battery.h>
|
||||
#include <ion/display.h>
|
||||
#include <ion/led.h>
|
||||
#include <ion/timing.h>
|
||||
|
||||
namespace OnBoarding {
|
||||
|
||||
@@ -41,7 +43,15 @@ bool PowerOnSelfTest::LCDDataOK() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return TestDisplayBlackWhite();
|
||||
bool result = TestDisplayBlackWhite();
|
||||
/* If EPSILON_ONBOARDING_APP == 1, the backlight is not inited in
|
||||
* Ion::Device::Board::initPeripherals, so that the LCD test is not visible to
|
||||
* the user. We thus need to init the backlight after the test. Before, we
|
||||
* push a white rect on the display to hide redrawing glitches. */
|
||||
Ion::Display::pushRectUniform(KDRect(KDPointZero, Ion::Display::Width, Ion::Display::Height), KDColorWhite);
|
||||
Ion::Timing::msleep(100);
|
||||
Ion::Backlight::init();
|
||||
return result;
|
||||
}
|
||||
|
||||
void PowerOnSelfTest::ColorPixelBuffer(KDColor * pixels, int numberOfPixels, KDColor c) {
|
||||
|
||||
@@ -7,6 +7,8 @@ namespace Ion {
|
||||
namespace Backlight {
|
||||
|
||||
constexpr uint8_t MaxBrightness = 240;
|
||||
void init();
|
||||
void shutdown();
|
||||
void setBrightness(uint8_t b);
|
||||
uint8_t brightness();
|
||||
|
||||
|
||||
@@ -14,14 +14,20 @@
|
||||
namespace Ion {
|
||||
namespace Backlight {
|
||||
|
||||
using namespace Ion::Device::Backlight;
|
||||
|
||||
void setBrightness(uint8_t b) {
|
||||
setLevel(b >> 4);
|
||||
Ion::Device::Backlight::setLevel(b >> 4);
|
||||
}
|
||||
|
||||
uint8_t brightness() {
|
||||
return level() << 4;
|
||||
return Ion::Device::Backlight::level() << 4;
|
||||
}
|
||||
|
||||
void init() {
|
||||
Ion::Device::Backlight::init();
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
Ion::Device::Backlight::shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ void initFPU() {
|
||||
|
||||
void initPeripherals() {
|
||||
Display::init();
|
||||
#if EPSILON_ONBOARDING_APP == 0
|
||||
Backlight::init();
|
||||
#endif
|
||||
Keyboard::init();
|
||||
LED::init();
|
||||
Battery::init();
|
||||
|
||||
@@ -4,6 +4,8 @@ uint8_t Ion::Backlight::brightness() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Ion::Backlight::setBrightness(uint8_t b) {
|
||||
return;
|
||||
}
|
||||
void Ion::Backlight::setBrightness(uint8_t b) {}
|
||||
|
||||
void Ion::Backlight::init() {}
|
||||
|
||||
void Ion::Backlight::shutdown() {}
|
||||
|
||||
Reference in New Issue
Block a user