summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-12-01 13:50:36 (GMT)
committerAvamander <avamander@gmail.com>2021-12-04 20:03:40 (GMT)
commitcccec6e1abc8b7180d9e69c22c50fe9244b48ebc (patch)
tree93a7358699b54b77d9e7a101e32f8ecf6dad80b6
parent9108952e6ba96f94bbd1530036318c9b21ec0cf9 (diff)
Improved debug UI.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/displayapp/screens/Weather.cpp24
2 files changed, 25 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9f3b6d4..ac91c0c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -892,7 +892,7 @@ target_compile_options(${EXECUTABLE_NAME} PUBLIC
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3>
$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os>
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:DEBUG>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Og -g3 -fno-rtti>
- $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -Os -fno-rtti>
+ $<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:RELEASE>>: ${COMMON_FLAGS} -Wextra -Wformat -Wno-missing-field-initializers -Wno-unused-parameter -O1 -g3 -fno-rtti>
$<$<COMPILE_LANGUAGE:ASM>: -MP -MD -x assembler-with-cpp>
)
diff --git a/src/displayapp/screens/Weather.cpp b/src/displayapp/screens/Weather.cpp
index 0854c74..c9852ee 100644
--- a/src/displayapp/screens/Weather.cpp
+++ b/src/displayapp/screens/Weather.cpp
@@ -140,6 +140,14 @@ std::unique_ptr<Screen> Weather::CreateScreenClouds() {
std::unique_ptr<Controllers::WeatherData::Clouds>& current = weatherService.GetCurrentClouds();
if (current->timestamp == 0) {
// Do not use the data, it's invalid
+ lv_label_set_text_fmt(label,
+ "#FFFF00 Clouds#\n\n"
+ "#444444 %d%%#\n\n"
+ "%d\n"
+ "%d\n",
+ 0,
+ 0,
+ 0);
} else {
lv_label_set_text_fmt(label,
"#FFFF00 Clouds#\n\n"
@@ -161,6 +169,14 @@ std::unique_ptr<Screen> Weather::CreateScreenPrecipitation() {
std::unique_ptr<Controllers::WeatherData::Precipitation>& current = weatherService.GetCurrentPrecipitation();
if (current->timestamp == 0) {
// Do not use the data, it's invalid
+ lv_label_set_text_fmt(label,
+ "#FFFF00 Precipitation#\n\n"
+ "#444444 %d%%#\n\n"
+ "%d\n"
+ "%d\n",
+ 0,
+ 0,
+ 0);
} else {
lv_label_set_text_fmt(label,
"#FFFF00 Precipitation#\n\n"
@@ -182,6 +198,14 @@ std::unique_ptr<Screen> Weather::CreateScreenHumidity() {
std::unique_ptr<Controllers::WeatherData::Humidity>& current = weatherService.GetCurrentHumidity();
if (current->timestamp == 0) {
// Do not use the data, it's invalid
+ lv_label_set_text_fmt(label,
+ "#FFFF00 Humidity#\n\n"
+ "#444444 %d%%#\n\n"
+ "%d\n"
+ "%d\n",
+ 0,
+ 0,
+ 0);
} else {
lv_label_set_text_fmt(label,
"#FFFF00 Humidity#\n\n"