summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/SystemInfo.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2021-01-04 18:56:56 (GMT)
committerGitea <gitea@fake.local>2021-01-04 18:56:56 (GMT)
commit1d940af924bac5728a4d494f780e298e5b67b707 (patch)
tree24540888f3d038ca3c88a0789b63faa8ac07d631 /src/displayapp/screens/SystemInfo.cpp
parent04abc91f157f5925ffa404728291a69893acf8cf (diff)
parent50ae0ae5e073ac48652e6c26549f9b19655e8da3 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/displayapp/screens/SystemInfo.cpp')
-rw-r--r--src/displayapp/screens/SystemInfo.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index 867fdae..2de5dad 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -1,9 +1,13 @@
-#include <libs/lvgl/lvgl.h>
-#include <displayapp/DisplayApp.h>
-#include <functional>
#include "SystemInfo.h"
-#include "../../Version.h"
-#include "Tile.h"
+#include <lvgl/lvgl.h>
+#include "../DisplayApp.h"
+#include "Label.h"
+#include "Version.h"
+#include "components/battery/BatteryController.h"
+#include "components/ble/BleController.h"
+#include "components/brightness/BrightnessController.h"
+#include "components/datetime/DateTimeController.h"
+#include "drivers/Watchdog.h"
using namespace Pinetime::Applications::Screens;
@@ -43,10 +47,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
- auto batteryPercentF = batteryController.PercentRemaining();
- uint16_t batteryPercent = 0;
- if(batteryPercentF > 100.0f) batteryPercent = 100;
- else if(batteryPercentF < 0.0f) batteryPercent = 0;
+ auto batteryPercent = static_cast<uint8_t>(batteryController.PercentRemaining());
uint8_t brightness = 0;
switch(brightnessController.Level()) {
@@ -83,7 +84,7 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
uptimeSeconds = uptimeSeconds % secondsInAMinute;
// TODO handle more than 100 days of uptime
- sprintf(t1, "Pinetime\n"
+ sprintf(t1, "InfiniTime\n"
"Version:%ld.%ld.%ld\n"
"Build: %s\n"
" %s\n"
@@ -111,6 +112,13 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen3() {
- strncpy(t3, "Hello from\nthe developer!", 27);
+ sprintf(t3, "Hello from\nthe developer!\n"
+ "Software Licensed\n"
+ "under the terms of\n"
+ "the GNU General\n"
+ "Public License v3\n"
+ "Source code:\n"
+ "https://github.com/\n"
+ " JF002/Pinetime");
return std::unique_ptr<Screen>(new Screens::Label(app, t3));
}