summaryrefslogtreecommitdiff
path: root/src/components/brightness
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-04 02:08:51 (GMT)
committerJoaquim <joaquim.org@gmail.com>2021-04-04 02:08:51 (GMT)
commit1d3742e14f09316a1d795527713eb8f9742f0ffb (patch)
tree6bc6343538506b68256aa057121e063d22f8ed1a /src/components/brightness
parent58a2d000c4d49d96121894d6dd6bb861d7564bea (diff)
Big UI and navigation Rewrite
new navigation add some color to the apps redesign menus new settings menu new quick settings code clean up size reduction by converting navigation images to font and more...
Diffstat (limited to 'src/components/brightness')
-rw-r--r--src/components/brightness/BrightnessController.cpp28
-rw-r--r--src/components/brightness/BrightnessController.h4
2 files changed, 32 insertions, 0 deletions
diff --git a/src/components/brightness/BrightnessController.cpp b/src/components/brightness/BrightnessController.cpp
index 78c461d..0d8f366 100644
--- a/src/components/brightness/BrightnessController.cpp
+++ b/src/components/brightness/BrightnessController.cpp
@@ -1,5 +1,6 @@
#include "BrightnessController.h"
#include <hal/nrf_gpio.h>
+#include "displayapp/screens/Symbols.h"
using namespace Pinetime::Controllers;
@@ -68,3 +69,30 @@ void BrightnessController::Restore() {
Set(backupLevel);
}
+void BrightnessController::Step() {
+ switch(level) {
+ case Levels::Low: Set(Levels::Medium); break;
+ case Levels::Medium: Set(Levels::High); break;
+ case Levels::High: Set(Levels::Low); break;
+ default: break;
+ }
+}
+
+const char* BrightnessController::GetIcon() {
+ switch(level) {
+ case Levels::Medium: return Applications::Screens::Symbols::brightnessMedium;
+ case Levels::High: return Applications::Screens::Symbols::brightnessHigh;
+ default: break;
+ }
+ return Applications::Screens::Symbols::brightnessLow;
+}
+
+const char* BrightnessController::ToString() {
+ switch(level) {
+ case Levels::Off: return "Off";
+ case Levels::Low: return "Low";
+ case Levels::Medium: return "Medium";
+ case Levels::High: return "High";
+ default : return "???";
+ }
+} \ No newline at end of file
diff --git a/src/components/brightness/BrightnessController.h b/src/components/brightness/BrightnessController.h
index b8354ec..efff7e8 100644
--- a/src/components/brightness/BrightnessController.h
+++ b/src/components/brightness/BrightnessController.h
@@ -13,10 +13,14 @@ namespace Pinetime {
Levels Level() const;
void Lower();
void Higher();
+ void Step();
void Backup();
void Restore();
+ const char* GetIcon();
+ const char* ToString();
+
private:
static constexpr uint8_t pinLcdBacklight1 = 14;
static constexpr uint8_t pinLcdBacklight2 = 22;