summaryrefslogtreecommitdiff
path: root/src/DisplayApp/Screens/ScreenList.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-03-22 12:14:38 +0100
committerJF <jf@codingfield.com>2020-03-22 12:14:38 +0100
commit7e9a7e4d5fa0f55b43180600d499f1d0ce6aded1 (patch)
treea527ae3ee8b7c4625e0bd38215f6622703c79c2a /src/DisplayApp/Screens/ScreenList.cpp
parentfb64ba8fb6953fe7e98db6874207a687d0d57bac (diff)
Fix bad memory alloaction in sysinfo screen.
Diffstat (limited to 'src/DisplayApp/Screens/ScreenList.cpp')
-rw-r--r--src/DisplayApp/Screens/ScreenList.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/DisplayApp/Screens/ScreenList.cpp b/src/DisplayApp/Screens/ScreenList.cpp
index bea335ff..93a91212 100644
--- a/src/DisplayApp/Screens/ScreenList.cpp
+++ b/src/DisplayApp/Screens/ScreenList.cpp
@@ -16,7 +16,7 @@ ScreenList::ScreenList(Pinetime::Applications::DisplayApp *app, Pinetime::Contro
// TODO all of this is far too heavy (string processing). This should be improved.
// TODO the info (battery, time,...) should be updated in the Refresh method.
- char t1[200];
+
auto batteryPercent = static_cast<int16_t>(batteryController.PercentRemaining());
if(batteryPercent > 100) batteryPercent = 100;
@@ -57,23 +57,13 @@ ScreenList::ScreenList(Pinetime::Applications::DisplayApp *app, Pinetime::Contro
dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(),
dateTimeController.Day(), dateTimeController.Month(), dateTimeController.Year(),
batteryPercent, brightness, resetReason);
-/*
- auto t1 = "Pinetime\n"
- "Version:\n"
- "Build: 23/03/2020\n"
- "Time: 17:23:12\n"
- "date: 23/03/2020\n"
- "Uptime: 2d 13h52:21\n"
- "Battery: 3.56v/82%\n"
- "Backlight: 2/3\n"
- "Last reset: wtdg\n"
- "BLE MAC: \n AA:BB:CC:DD:EE:FF";*/
+
screens.emplace_back(t1);
- auto t2 = "Hello from\nthe developper!";
+ strncpy(t2, "Hello from\nthe developper!", 27);
screens.emplace_back(t2);
- auto t3 = "Place holder\nin case we need\nmore room!";
+ strncpy(t3, "Place holder\nin case we need\nmore room!", 40);
screens.emplace_back(t3);
auto &screen = screens[screenIndex];