From f12d5105c166fc170dc2d0c51ae7740efbd882fd Mon Sep 17 00:00:00 2001 From: Boteium Date: Mon, 3 Jul 2023 22:52:44 +0800 Subject: [PATCH 01/13] new game: bird and cactus --- src/CMakeLists.txt | 1 + src/displayapp/Apps.h | 1 + src/displayapp/DisplayApp.cpp | 4 + src/displayapp/fonts/fonts.json | 2 +- src/displayapp/screens/ApplicationList.h | 2 +- src/displayapp/screens/Bird.cpp | 141 +++++++++++++++++++++++ src/displayapp/screens/Bird.h | 52 +++++++++ src/displayapp/screens/Symbols.h | 1 + 8 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 src/displayapp/screens/Bird.cpp create mode 100644 src/displayapp/screens/Bird.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d903629b..d1e8bcfb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -375,6 +375,7 @@ list(APPEND SOURCE_FILES displayapp/screens/Screen.cpp displayapp/screens/Clock.cpp displayapp/screens/Tile.cpp + displayapp/screens/Bird.cpp displayapp/screens/InfiniPaint.cpp displayapp/screens/Paddle.cpp displayapp/screens/StopWatch.cpp diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index f253bc03..919d9bc4 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -16,6 +16,7 @@ namespace Pinetime { FlashLight, BatteryInfo, Music, + Bird, Paint, Paddle, Twos, diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index a930fe96..6188c11a 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -16,6 +16,7 @@ #include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/InfiniPaint.h" #include "displayapp/screens/Paddle.h" +#include "displayapp/screens/Bird.h" #include "displayapp/screens/StopWatch.h" #include "displayapp/screens/Metronome.h" #include "displayapp/screens/Music.h" @@ -528,6 +529,9 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio case Apps::Paddle: currentScreen = std::make_unique(lvgl); break; + case Apps::Bird: + currentScreen = std::make_unique(lvgl); + break; case Apps::Music: currentScreen = std::make_unique(systemTask->nimble().music()); break; diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json index e65f6dd4..e31e39dc 100644 --- a/src/displayapp/fonts/fonts.json +++ b/src/displayapp/fonts/fonts.json @@ -7,7 +7,7 @@ }, { "file": "FontAwesome5-Solid+Brands+Regular.woff", - "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c" + "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c, 0xf4ba" } ], "bpp": 1, diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index 7bdd1154..c3a8f4b0 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -52,7 +52,7 @@ namespace Pinetime { {"2", Apps::Twos}, {Symbols::drum, Apps::Metronome}, {Symbols::map, Apps::Navigation}, - {Symbols::none, Apps::None}, + {Symbols::dove, Apps::Bird}, // {"M", Apps::Motion}, }}; diff --git a/src/displayapp/screens/Bird.cpp b/src/displayapp/screens/Bird.cpp new file mode 100644 index 00000000..49d714b4 --- /dev/null +++ b/src/displayapp/screens/Bird.cpp @@ -0,0 +1,141 @@ +#include "displayapp/screens/Bird.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/LittleVgl.h" +#include "displayapp/screens/Symbols.h" + +#include // for rand() + +using namespace Pinetime::Applications::Screens; + +Bird::Bird(Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} { + + lv_obj_t* background = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(background, LV_HOR_RES, LV_VER_RES); + lv_obj_set_style_local_radius(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0); + lv_obj_set_style_local_bg_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x2874a6)); + + cactus_top = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(cactus_top, CACTUS_WIDTH, CACTUS_HEIGHT); + lv_obj_set_style_local_bg_color(cactus_top, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_obj_set_style_local_border_color(cactus_top, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_style_local_border_width(cactus_top, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 1); + + cactus_bottom = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(cactus_bottom, CACTUS_WIDTH, CACTUS_HEIGHT); + lv_obj_set_style_local_bg_color(cactus_bottom, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_obj_set_style_local_border_color(cactus_bottom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_style_local_border_width(cactus_bottom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 1); + + MovePipe(); + + points = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(points, " "); + lv_obj_align(points, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -10, 5); + + info = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(info, "touch to start"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + + bird = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(bird, Symbols::dove); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); + lv_obj_set_pos(bird, BIRD_X, pos); + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); +} + +Bird::~Bird() { + lv_task_del(taskRefresh); + lv_obj_clean(lv_scr_act()); +} + +void Bird::MovePipe() { + lv_obj_set_pos(cactus_top, cactus_x, -cactus_y_offset); + lv_obj_set_pos(cactus_bottom, cactus_x, CACTUS_HEIGHT + CACTUS_GAP - cactus_y_offset); + return; +} + +void Bird::Refresh() { + if (is_stopped) { + return; + } + + pos += accel / 6; + + if (is_ascending) { + if (accel >= -18) { + accel -= 3; + } + } else { + if (accel <= 42) { + accel++; + } + } + + // checks if it has hit the floor or ceiling + if (pos <= 1 || pos >= LV_VER_RES - BIRD_SIZE) { + GameOver(); + return; + } + + // checks if it has rammed into cacti + // BIRD_X-CACTUS_WIDTH to BIRD_X+BIRD_SIZE + if (90 < cactus_x && cactus_x < 130) { + if (pos < CACTUS_HEIGHT - cactus_y_offset || pos > CACTUS_HEIGHT + CACTUS_GAP - BIRD_SIZE - cactus_y_offset) { + GameOver(); + return; + } + } + + lv_obj_set_pos(bird, BIRD_X, pos); + + lv_label_set_text_fmt(points, "%04d", score / 10); + is_ascending = false; + + score++; + if (cactus_x == 0) { + while (true) { + uint8_t new_offset = rand() % 5 * 40; + if (new_offset != cactus_y_offset) { + cactus_y_offset = new_offset; + break; + } + } + cactus_x = 240; + } + cactus_x--; + if (cactus_x % 4 == 0) { + MovePipe(); + } +} + +void Bird::GameOver() { + lv_label_set_text_static(info, "Game Over"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + is_stopped = true; + return; +} + +bool Bird::OnTouchEvent(Pinetime::Applications::TouchEvents /*event*/) { + if (is_stopped) { + if (pos != 120) { + pos = 120; + lv_label_set_text_static(info, "Touch to Start"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + return true; + } + // reset + cactus_x = 240; + accel = 0; + score = 0; + is_stopped = false; + lv_label_set_text_static(info, ""); + } + is_ascending = true; + return true; +} + +bool Bird::OnTouchEvent(uint16_t /*x*/, uint16_t /*y*/) { + is_ascending = true; + return true; +} diff --git a/src/displayapp/screens/Bird.h b/src/displayapp/screens/Bird.h new file mode 100644 index 00000000..87b46ba5 --- /dev/null +++ b/src/displayapp/screens/Bird.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include +#include "displayapp/screens/Screen.h" + +#define BIRD_X 110 +#define BIRD_SIZE 20 +#define CACTUS_HEIGHT 160 +#define CACTUS_WIDTH 30 +#define CACTUS_GAP 80 + +namespace Pinetime { + namespace Components { + class LittleVgl; + } + + namespace Applications { + namespace Screens { + + class Bird : public Screen { + public: + Bird(Pinetime::Components::LittleVgl& lvgl); + ~Bird() override; + + void Refresh() override; + + bool OnTouchEvent(TouchEvents event) override; + bool OnTouchEvent(uint16_t x, uint16_t y) override; + + private: + void GameOver(); + void MovePipe(); + Pinetime::Components::LittleVgl& lvgl; + + bool is_stopped = true; + bool is_ascending = false; + + uint8_t cactus_x = 240; + uint8_t cactus_y_offset = 40; + + int8_t accel = 0; + uint8_t pos = 120; + uint16_t score = 0; + + lv_obj_t *info, *points, *bird, *cactus_top, *cactus_bottom; + + lv_task_t* taskRefresh; + }; + } + } +} diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index 7154ff44..bf63d398 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -20,6 +20,7 @@ namespace Pinetime { static constexpr const char* paintbrush = "\xEF\x87\xBC"; static constexpr const char* paddle = "\xEF\x91\x9D"; static constexpr const char* map = "\xEF\x96\xa0"; + static constexpr const char* dove = "\xEF\x92\xBA"; static constexpr const char* phone = "\xEF\x82\x95"; static constexpr const char* phoneSlash = "\xEF\x8F\x9D"; static constexpr const char* volumMute = "\xEF\x9A\xA9"; From 2cd4b8bb5b0362662dc4af0e3eb5464ee4a7437c Mon Sep 17 00:00:00 2001 From: Boteium Date: Tue, 4 Jul 2023 18:11:19 +0800 Subject: [PATCH 02/13] change color upon game over --- src/displayapp/DisplayApp.cpp | 2 +- src/displayapp/screens/Bird.cpp | 6 ++++-- src/displayapp/screens/Bird.h | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 6188c11a..1f3d1691 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -530,7 +530,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio currentScreen = std::make_unique(lvgl); break; case Apps::Bird: - currentScreen = std::make_unique(lvgl); + currentScreen = std::make_unique(); break; case Apps::Music: currentScreen = std::make_unique(systemTask->nimble().music()); diff --git a/src/displayapp/screens/Bird.cpp b/src/displayapp/screens/Bird.cpp index 49d714b4..d2d78fde 100644 --- a/src/displayapp/screens/Bird.cpp +++ b/src/displayapp/screens/Bird.cpp @@ -7,7 +7,7 @@ using namespace Pinetime::Applications::Screens; -Bird::Bird(Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} { +Bird::Bird() { lv_obj_t* background = lv_obj_create(lv_scr_act(), nullptr); lv_obj_set_size(background, LV_HOR_RES, LV_VER_RES); @@ -110,9 +110,10 @@ void Bird::Refresh() { } void Bird::GameOver() { + is_stopped = true; lv_label_set_text_static(info, "Game Over"); lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); - is_stopped = true; + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); return; } @@ -122,6 +123,7 @@ bool Bird::OnTouchEvent(Pinetime::Applications::TouchEvents /*event*/) { pos = 120; lv_label_set_text_static(info, "Touch to Start"); lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); return true; } // reset diff --git a/src/displayapp/screens/Bird.h b/src/displayapp/screens/Bird.h index 87b46ba5..f8a08a16 100644 --- a/src/displayapp/screens/Bird.h +++ b/src/displayapp/screens/Bird.h @@ -20,7 +20,7 @@ namespace Pinetime { class Bird : public Screen { public: - Bird(Pinetime::Components::LittleVgl& lvgl); + Bird(); ~Bird() override; void Refresh() override; @@ -31,7 +31,6 @@ namespace Pinetime { private: void GameOver(); void MovePipe(); - Pinetime::Components::LittleVgl& lvgl; bool is_stopped = true; bool is_ascending = false; From dbe43445c70dd705f92ea079fb961ae36b8e82e6 Mon Sep 17 00:00:00 2001 From: JustScott Date: Sat, 13 Jan 2024 12:17:23 -0600 Subject: [PATCH 03/13] Add app/game: Bird --- src/CMakeLists.txt | 1 + src/displayapp/DisplayApp.cpp | 1 + src/displayapp/apps/Apps.h.in | 1 + src/displayapp/apps/CMakeLists.txt | 1 + src/displayapp/fonts/fonts.json | 2 +- src/displayapp/screens/Bird.cpp | 143 +++++++++++++++++++++++++++++ src/displayapp/screens/Bird.h | 63 +++++++++++++ src/displayapp/screens/Symbols.h | 1 + 8 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 src/displayapp/screens/Bird.cpp create mode 100644 src/displayapp/screens/Bird.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b3de51c..b2007cbd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -383,6 +383,7 @@ list(APPEND SOURCE_FILES displayapp/screens/ApplicationList.cpp displayapp/screens/Notifications.cpp displayapp/screens/Twos.cpp + displayapp/screens/Bird.cpp displayapp/screens/HeartRate.cpp displayapp/screens/FlashLight.cpp displayapp/screens/List.cpp diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 938d1179..c6be65a2 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -14,6 +14,7 @@ #include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/InfiniPaint.h" +#include "displayapp/screens/Bird.h" #include "displayapp/screens/Paddle.h" #include "displayapp/screens/StopWatch.h" #include "displayapp/screens/Metronome.h" diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in index e6e8d7dc..98bcfa60 100644 --- a/src/displayapp/apps/Apps.h.in +++ b/src/displayapp/apps/Apps.h.in @@ -21,6 +21,7 @@ namespace Pinetime { Paint, Paddle, Twos, + Bird, HeartRate, Navigation, StopWatch, diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index a531bdff..78c03e96 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -10,6 +10,7 @@ else () set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paint") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paddle") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Twos") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Bird") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json index ead5239e..dc287117 100644 --- a/src/displayapp/fonts/fonts.json +++ b/src/displayapp/fonts/fonts.json @@ -7,7 +7,7 @@ }, { "file": "FontAwesome5-Solid+Brands+Regular.woff", - "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c, 0xf743" + "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c, 0xf743, 0xf4ba" } ], "bpp": 1, diff --git a/src/displayapp/screens/Bird.cpp b/src/displayapp/screens/Bird.cpp new file mode 100644 index 00000000..d2d78fde --- /dev/null +++ b/src/displayapp/screens/Bird.cpp @@ -0,0 +1,143 @@ +#include "displayapp/screens/Bird.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/LittleVgl.h" +#include "displayapp/screens/Symbols.h" + +#include // for rand() + +using namespace Pinetime::Applications::Screens; + +Bird::Bird() { + + lv_obj_t* background = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(background, LV_HOR_RES, LV_VER_RES); + lv_obj_set_style_local_radius(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0); + lv_obj_set_style_local_bg_color(background, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x2874a6)); + + cactus_top = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(cactus_top, CACTUS_WIDTH, CACTUS_HEIGHT); + lv_obj_set_style_local_bg_color(cactus_top, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_obj_set_style_local_border_color(cactus_top, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_style_local_border_width(cactus_top, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 1); + + cactus_bottom = lv_obj_create(lv_scr_act(), nullptr); + lv_obj_set_size(cactus_bottom, CACTUS_WIDTH, CACTUS_HEIGHT); + lv_obj_set_style_local_bg_color(cactus_bottom, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); + lv_obj_set_style_local_border_color(cactus_bottom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); + lv_obj_set_style_local_border_width(cactus_bottom, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 1); + + MovePipe(); + + points = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(points, " "); + lv_obj_align(points, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, -10, 5); + + info = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(info, "touch to start"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + + bird = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_static(bird, Symbols::dove); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); + lv_obj_set_pos(bird, BIRD_X, pos); + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); +} + +Bird::~Bird() { + lv_task_del(taskRefresh); + lv_obj_clean(lv_scr_act()); +} + +void Bird::MovePipe() { + lv_obj_set_pos(cactus_top, cactus_x, -cactus_y_offset); + lv_obj_set_pos(cactus_bottom, cactus_x, CACTUS_HEIGHT + CACTUS_GAP - cactus_y_offset); + return; +} + +void Bird::Refresh() { + if (is_stopped) { + return; + } + + pos += accel / 6; + + if (is_ascending) { + if (accel >= -18) { + accel -= 3; + } + } else { + if (accel <= 42) { + accel++; + } + } + + // checks if it has hit the floor or ceiling + if (pos <= 1 || pos >= LV_VER_RES - BIRD_SIZE) { + GameOver(); + return; + } + + // checks if it has rammed into cacti + // BIRD_X-CACTUS_WIDTH to BIRD_X+BIRD_SIZE + if (90 < cactus_x && cactus_x < 130) { + if (pos < CACTUS_HEIGHT - cactus_y_offset || pos > CACTUS_HEIGHT + CACTUS_GAP - BIRD_SIZE - cactus_y_offset) { + GameOver(); + return; + } + } + + lv_obj_set_pos(bird, BIRD_X, pos); + + lv_label_set_text_fmt(points, "%04d", score / 10); + is_ascending = false; + + score++; + if (cactus_x == 0) { + while (true) { + uint8_t new_offset = rand() % 5 * 40; + if (new_offset != cactus_y_offset) { + cactus_y_offset = new_offset; + break; + } + } + cactus_x = 240; + } + cactus_x--; + if (cactus_x % 4 == 0) { + MovePipe(); + } +} + +void Bird::GameOver() { + is_stopped = true; + lv_label_set_text_static(info, "Game Over"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); + return; +} + +bool Bird::OnTouchEvent(Pinetime::Applications::TouchEvents /*event*/) { + if (is_stopped) { + if (pos != 120) { + pos = 120; + lv_label_set_text_static(info, "Touch to Start"); + lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); + return true; + } + // reset + cactus_x = 240; + accel = 0; + score = 0; + is_stopped = false; + lv_label_set_text_static(info, ""); + } + is_ascending = true; + return true; +} + +bool Bird::OnTouchEvent(uint16_t /*x*/, uint16_t /*y*/) { + is_ascending = true; + return true; +} diff --git a/src/displayapp/screens/Bird.h b/src/displayapp/screens/Bird.h new file mode 100644 index 00000000..b6d44d30 --- /dev/null +++ b/src/displayapp/screens/Bird.h @@ -0,0 +1,63 @@ +#pragma once + +#include +#include +#include "displayapp/screens/Screen.h" +#include "Symbols.h" +#include "systemtask/SystemTask.h" + +#define BIRD_X 110 +#define BIRD_SIZE 20 +#define CACTUS_HEIGHT 160 +#define CACTUS_WIDTH 30 +#define CACTUS_GAP 80 + +namespace Pinetime { + namespace Components { + class LittleVgl; + } + + namespace Applications { + namespace Screens { + + class Bird : public Screen { + public: + Bird(); + ~Bird() override; + + void Refresh() override; + + bool OnTouchEvent(TouchEvents event) override; + bool OnTouchEvent(uint16_t x, uint16_t y) override; + + private: + void GameOver(); + void MovePipe(); + + bool is_stopped = true; + bool is_ascending = false; + + uint8_t cactus_x = 240; + uint8_t cactus_y_offset = 40; + + int8_t accel = 0; + uint8_t pos = 120; + uint16_t score = 0; + + lv_obj_t *info, *points, *bird, *cactus_top, *cactus_bottom; + + lv_task_t* taskRefresh; + }; + } + + template <> + struct AppTraits { + static constexpr Apps app = Apps::Bird; + static constexpr const char* icon = Screens::Symbols::dove; + + static Screens::Screen* Create(AppControllers& /*controllers*/) { + return new Screens::Bird(); + }; + }; + } +} diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index 549ea04f..495c3261 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -20,6 +20,7 @@ namespace Pinetime { static constexpr const char* paintbrush = "\xEF\x87\xBC"; static constexpr const char* paddle = "\xEF\x91\x9D"; static constexpr const char* map = "\xEF\x96\xa0"; + static constexpr const char* dove = "\xEF\x92\xBA"; static constexpr const char* phone = "\xEF\x82\x95"; static constexpr const char* phoneSlash = "\xEF\x8F\x9D"; static constexpr const char* volumMute = "\xEF\x9A\xA9"; From d0f776b44cf5bab2b4be0b727e16297df65c323e Mon Sep 17 00:00:00 2001 From: JustScott Date: Wed, 10 Jan 2024 22:32:01 -0600 Subject: [PATCH 04/13] Add a new Calendar App A basic calendar app that shows all the days dates in the current month along with the correlating week days, highlights the current day, and allows swiping left and right to increase and decrease the current month by one. Co-authored-by: thnikk Co-authored-by: Boteium --- src/CMakeLists.txt | 1 + src/displayapp/DisplayApp.cpp | 1 + src/displayapp/apps/Apps.h.in | 1 + src/displayapp/apps/CMakeLists.txt | 1 + src/displayapp/fonts/fonts.json | 2 +- src/displayapp/screens/Calendar.cpp | 88 +++++++++++++++++++++++++++++ src/displayapp/screens/Calendar.h | 42 ++++++++++++++ src/displayapp/screens/Symbols.h | 1 + 8 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 src/displayapp/screens/Calendar.cpp create mode 100644 src/displayapp/screens/Calendar.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fd8ece62..21413bdb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -377,6 +377,7 @@ list(APPEND SOURCE_FILES displayapp/screens/FirmwareUpdate.cpp displayapp/screens/Music.cpp displayapp/screens/Navigation.cpp + displayapp/screens/Calendar.cpp displayapp/screens/Metronome.cpp displayapp/screens/Motion.cpp displayapp/screens/Weather.cpp diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 9c7d87b2..adfa6171 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -19,6 +19,7 @@ #include "displayapp/screens/Metronome.h" #include "displayapp/screens/Music.h" #include "displayapp/screens/Navigation.h" +#include "displayapp/screens/Calendar.h" #include "displayapp/screens/Notifications.h" #include "displayapp/screens/SystemInfo.h" #include "displayapp/screens/Tile.h" diff --git a/src/displayapp/apps/Apps.h.in b/src/displayapp/apps/Apps.h.in index 2104a267..9fa4843a 100644 --- a/src/displayapp/apps/Apps.h.in +++ b/src/displayapp/apps/Apps.h.in @@ -23,6 +23,7 @@ namespace Pinetime { Twos, HeartRate, Navigation, + Calendar, StopWatch, Metronome, Motion, diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index d7858760..99b0a936 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -14,6 +14,7 @@ else () set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calendar") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif () diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json index 41c383c0..b88af94f 100644 --- a/src/displayapp/fonts/fonts.json +++ b/src/displayapp/fonts/fonts.json @@ -7,7 +7,7 @@ }, { "file": "FontAwesome5-Solid+Brands+Regular.woff", - "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c, 0xf0f3, 0xf522, 0xf743" + "range": "0xf294, 0xf242, 0xf54b, 0xf21e, 0xf1e6, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf06e, 0xf015, 0xf00c, 0xf0f3, 0xf522, 0xf743, 0xf073" } ], "bpp": 1, diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp new file mode 100644 index 00000000..e466ac4a --- /dev/null +++ b/src/displayapp/screens/Calendar.cpp @@ -0,0 +1,88 @@ +#include "displayapp/screens/Calendar.h" +#include "components/datetime/DateTimeController.h" + +using namespace Pinetime::Applications::Screens; + +Calendar::Calendar(Controllers::DateTime& dateTimeController) : dateTimeController {dateTimeController} { + + // Create calendar object + calendar = lv_calendar_create(lv_scr_act(), NULL); + // Set size + lv_obj_set_size(calendar, LV_HOR_RES, LV_VER_RES); + // Set alignment + lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -5); + // Disable clicks + lv_obj_set_click(calendar, false); + + // Set background of today's date + /* + lv_obj_set_style_local_bg_opa(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_OPA_COVER); + lv_obj_set_style_local_bg_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_WHITE); + lv_obj_set_style_local_radius(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, 3); + */ + + // Set style of today's date + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + + // Set style of inactive month's days + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); + + // Get today's date + today.year = static_cast(dateTimeController.Year()); + today.month = static_cast(dateTimeController.Month()); + today.day = static_cast(dateTimeController.Day()); + + // Set today's date + lv_calendar_set_today_date(calendar, &today); + lv_calendar_set_showed_date(calendar, &today); + + // Use today's date as a reference for which month to show if moved + current = today; + +} + +bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + switch (event) { + case TouchEvents::SwipeLeft: { + if (current.month == 12) { + current.month = 1; + current.year++; + } + else{ + current.month++; + } + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + case TouchEvents::SwipeRight: { + if (current.month == 1) { + current.month = 12; + current.year--; + } + else{ + current.month--; + } + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + /* + case TouchEvents::SwipeUp: { + current.year++; + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + case TouchEvents::SwipeDown: { + current.year--; + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + */ + default: { + return false; + } + } +} + +Calendar::~Calendar() { + lv_obj_clean(lv_scr_act()); +} diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h new file mode 100644 index 00000000..ab5facfb --- /dev/null +++ b/src/displayapp/screens/Calendar.h @@ -0,0 +1,42 @@ +#pragma once + +#include "displayapp/apps/Apps.h" +#include "displayapp/Controllers.h" +#include "displayapp/screens/Screen.h" +#include "components/datetime/DateTimeController.h" +#include + +#include "Symbols.h" + +namespace Pinetime { + namespace Controllers { + class Settings; + } + + namespace Applications { + namespace Screens { + class Calendar : public Screen { + public: + Calendar(Controllers::DateTime& dateTimeController); + ~Calendar() override; + private: + bool OnTouchEvent(TouchEvents event); + Controllers::DateTime& dateTimeController; + lv_obj_t* label_time; + lv_obj_t * calendar; + lv_calendar_date_t today; + lv_calendar_date_t current; + }; + } + + template <> + struct AppTraits { + static constexpr Apps app = Apps::Calendar; + static constexpr const char* icon = Screens::Symbols::calendar; + + static Screens::Screen* Create(AppControllers& controllers) { + return new Screens::Calendar(controllers.dateTimeController); + }; + }; + } +} diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index bd958b28..e48b4336 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -39,6 +39,7 @@ namespace Pinetime { static constexpr const char* eye = "\xEF\x81\xAE"; static constexpr const char* home = "\xEF\x80\x95"; static constexpr const char* sleep = "\xEE\xBD\x84"; + static constexpr const char* calendar = "\xEF\x81\xB3"; // fontawesome_weathericons.c // static constexpr const char* sun = "\xEF\x86\x85"; From 780e68f456678e6a31c7cb47b621dd3ddec569be Mon Sep 17 00:00:00 2001 From: JustScott Date: Thu, 11 Jan 2024 10:58:05 -0600 Subject: [PATCH 05/13] Removed unused variables, some of the commented out code, and added a license copyright notice to the source and header calendar files. --- src/displayapp/screens/Calendar.cpp | 41 ++++++++++++++++++----------- src/displayapp/screens/Calendar.h | 22 +++++++++++++--- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index e466ac4a..837970e4 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -1,3 +1,21 @@ +/* Copyright (C) 2024 thnikk, Boteium, JustScott + + This file is part of InfiniTime. + + InfiniTime is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + InfiniTime is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "displayapp/screens/Calendar.h" #include "components/datetime/DateTimeController.h" @@ -14,13 +32,6 @@ Calendar::Calendar(Controllers::DateTime& dateTimeController) : dateTimeControll // Disable clicks lv_obj_set_click(calendar, false); - // Set background of today's date - /* - lv_obj_set_style_local_bg_opa(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_OPA_COVER); - lv_obj_set_style_local_bg_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_WHITE); - lv_obj_set_style_local_radius(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, 3); - */ - // Set style of today's date lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); @@ -28,17 +39,13 @@ Calendar::Calendar(Controllers::DateTime& dateTimeController) : dateTimeControll lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); // Get today's date - today.year = static_cast(dateTimeController.Year()); - today.month = static_cast(dateTimeController.Month()); - today.day = static_cast(dateTimeController.Day()); + current.year = static_cast(dateTimeController.Year()); + current.month = static_cast(dateTimeController.Month()); + current.day = static_cast(dateTimeController.Day()); // Set today's date - lv_calendar_set_today_date(calendar, &today); - lv_calendar_set_showed_date(calendar, &today); - - // Use today's date as a reference for which month to show if moved - current = today; - + lv_calendar_set_today_date(calendar, ¤t); + lv_calendar_set_showed_date(calendar, ¤t); } bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { @@ -51,6 +58,7 @@ bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { else{ current.month++; } + lv_calendar_set_showed_date(calendar, ¤t); return true; } @@ -62,6 +70,7 @@ bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { else{ current.month--; } + lv_calendar_set_showed_date(calendar, ¤t); return true; } diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h index ab5facfb..b20edd73 100644 --- a/src/displayapp/screens/Calendar.h +++ b/src/displayapp/screens/Calendar.h @@ -1,3 +1,21 @@ +/* Copyright (C) 2024 thnikk, Boteium, JustScott + + This file is part of InfiniTime. + + InfiniTime is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + InfiniTime is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #pragma once #include "displayapp/apps/Apps.h" @@ -22,9 +40,7 @@ namespace Pinetime { private: bool OnTouchEvent(TouchEvents event); Controllers::DateTime& dateTimeController; - lv_obj_t* label_time; - lv_obj_t * calendar; - lv_calendar_date_t today; + lv_obj_t* calendar; lv_calendar_date_t current; }; } From 0535e93848fce686edc041aa225bc1b2538eb8bb Mon Sep 17 00:00:00 2001 From: JustScott Date: Sun, 14 Jan 2024 10:15:13 -0600 Subject: [PATCH 06/13] Reformatted the code to comply with clang-format. --- src/displayapp/screens/Calendar.cpp | 116 ++++++++++++++-------------- src/displayapp/screens/Calendar.h | 3 +- 2 files changed, 59 insertions(+), 60 deletions(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 837970e4..fea69496 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -23,75 +23,73 @@ using namespace Pinetime::Applications::Screens; Calendar::Calendar(Controllers::DateTime& dateTimeController) : dateTimeController {dateTimeController} { - // Create calendar object - calendar = lv_calendar_create(lv_scr_act(), NULL); - // Set size - lv_obj_set_size(calendar, LV_HOR_RES, LV_VER_RES); - // Set alignment - lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -5); - // Disable clicks - lv_obj_set_click(calendar, false); + // Create calendar object + calendar = lv_calendar_create(lv_scr_act(), NULL); + // Set size + lv_obj_set_size(calendar, LV_HOR_RES, LV_VER_RES); + // Set alignment + lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -5); + // Disable clicks + lv_obj_set_click(calendar, false); - // Set style of today's date - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + // Set style of today's date + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); - // Set style of inactive month's days - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); + // Set style of inactive month's days + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); - // Get today's date - current.year = static_cast(dateTimeController.Year()); - current.month = static_cast(dateTimeController.Month()); - current.day = static_cast(dateTimeController.Day()); + // Get today's date + current.year = static_cast(dateTimeController.Year()); + current.month = static_cast(dateTimeController.Month()); + current.day = static_cast(dateTimeController.Day()); - // Set today's date - lv_calendar_set_today_date(calendar, ¤t); - lv_calendar_set_showed_date(calendar, ¤t); + // Set today's date + lv_calendar_set_today_date(calendar, ¤t); + lv_calendar_set_showed_date(calendar, ¤t); } bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - switch (event) { - case TouchEvents::SwipeLeft: { - if (current.month == 12) { - current.month = 1; - current.year++; - } - else{ - current.month++; - } + switch (event) { + case TouchEvents::SwipeLeft: { + if (current.month == 12) { + current.month = 1; + current.year++; + } else { + current.month++; + } - lv_calendar_set_showed_date(calendar, ¤t); - return true; - } - case TouchEvents::SwipeRight: { - if (current.month == 1) { - current.month = 12; - current.year--; - } - else{ - current.month--; - } - - lv_calendar_set_showed_date(calendar, ¤t); - return true; - } - /* - case TouchEvents::SwipeUp: { - current.year++; - lv_calendar_set_showed_date(calendar, ¤t); - return true; - } - case TouchEvents::SwipeDown: { - current.year--; - lv_calendar_set_showed_date(calendar, ¤t); - return true; - } - */ - default: { - return false; - } + lv_calendar_set_showed_date(calendar, ¤t); + return true; } + case TouchEvents::SwipeRight: { + if (current.month == 1) { + current.month = 12; + current.year--; + } else { + current.month--; + } + + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + /* + case TouchEvents::SwipeUp: { + current.year++; + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + case TouchEvents::SwipeDown: { + current.year--; + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + */ + default: { + return false; + } + } } Calendar::~Calendar() { - lv_obj_clean(lv_scr_act()); + lv_obj_clean(lv_scr_act()); } diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h index b20edd73..bbdc8322 100644 --- a/src/displayapp/screens/Calendar.h +++ b/src/displayapp/screens/Calendar.h @@ -23,7 +23,7 @@ #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" #include - + #include "Symbols.h" namespace Pinetime { @@ -37,6 +37,7 @@ namespace Pinetime { public: Calendar(Controllers::DateTime& dateTimeController); ~Calendar() override; + private: bool OnTouchEvent(TouchEvents event); Controllers::DateTime& dateTimeController; From 577dfd5b8703969b1c42f14ac876ff2309c06cac Mon Sep 17 00:00:00 2001 From: JustScott Date: Mon, 22 Jan 2024 18:44:47 -0600 Subject: [PATCH 07/13] Updated the calendar to use colors from the InfiniTimeTheme.h's Colors namespace --- src/displayapp/InfiniTimeTheme.h | 1 + src/displayapp/screens/Calendar.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/displayapp/InfiniTimeTheme.h b/src/displayapp/InfiniTimeTheme.h index 0690b099..57680e87 100644 --- a/src/displayapp/InfiniTimeTheme.h +++ b/src/displayapp/InfiniTimeTheme.h @@ -8,6 +8,7 @@ namespace Colors { static constexpr lv_color_t green = LV_COLOR_MAKE(0x0, 0xb0, 0x0); static constexpr lv_color_t blue = LV_COLOR_MAKE(0x0, 0x50, 0xff); static constexpr lv_color_t lightGray = LV_COLOR_MAKE(0xb0, 0xb0, 0xb0); + static constexpr lv_color_t gray = LV_COLOR_MAKE(0x50, 0x50, 0x50); static constexpr lv_color_t bg = LV_COLOR_MAKE(0x5d, 0x69, 0x7e); static constexpr lv_color_t bgAlt = LV_COLOR_MAKE(0x38, 0x38, 0x38); diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index fea69496..43643f6c 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -18,6 +18,7 @@ #include "displayapp/screens/Calendar.h" #include "components/datetime/DateTimeController.h" +#include "displayapp/InfiniTimeTheme.h" using namespace Pinetime::Applications::Screens; @@ -33,10 +34,10 @@ Calendar::Calendar(Controllers::DateTime& dateTimeController) : dateTimeControll lv_obj_set_click(calendar, false); // Set style of today's date - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, Colors::deepOrange); // Set style of inactive month's days - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, Colors::gray); // Get today's date current.year = static_cast(dateTimeController.Year()); From f4c35f0883dc1113fe79292dc06fe7ca753d013a Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Mon, 8 Jan 2024 10:02:45 -0500 Subject: [PATCH 08/13] timer: Add ringing The timer app issues a short buzz once and then disappears. There is no trace left that the timer finished or how long ago. This change makes the motor start ringing and presents a timer counter. --- src/components/motor/MotorController.cpp | 4 +++ src/components/motor/MotorController.h | 1 + src/components/timer/Timer.cpp | 8 +++--- src/displayapp/DisplayApp.cpp | 2 +- src/displayapp/screens/Timer.cpp | 31 +++++++++++++++++++++--- src/displayapp/screens/Timer.h | 8 ++++-- 6 files changed, 44 insertions(+), 10 deletions(-) diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index 4e392416..d3bd2cf3 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -34,6 +34,10 @@ void MotorController::StopRinging() { nrf_gpio_pin_set(PinMap::Motor); } +bool MotorController::IsRinging() { + return (xTimerIsTimerActive(longVib) == pdTRUE); +} + void MotorController::StopMotor(TimerHandle_t /*xTimer*/) { nrf_gpio_pin_set(PinMap::Motor); } diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index 6dea6d1f..ab8c956e 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -15,6 +15,7 @@ namespace Pinetime { void RunForDuration(uint8_t motorDuration); void StartRinging(); void StopRinging(); + bool IsRinging(); private: static void Ring(TimerHandle_t xTimer); diff --git a/src/components/timer/Timer.cpp b/src/components/timer/Timer.cpp index 279178cd..b3c4417a 100644 --- a/src/components/timer/Timer.cpp +++ b/src/components/timer/Timer.cpp @@ -12,11 +12,13 @@ void Timer::StartTimer(std::chrono::milliseconds duration) { } std::chrono::milliseconds Timer::GetTimeRemaining() { + TickType_t remainingTime = 0; if (IsRunning()) { - TickType_t remainingTime = xTimerGetExpiryTime(timer) - xTaskGetTickCount(); - return std::chrono::milliseconds(remainingTime * 1000 / configTICK_RATE_HZ); + remainingTime = xTimerGetExpiryTime(timer) - xTaskGetTickCount(); + } else { + remainingTime = xTaskGetTickCount() - xTimerGetExpiryTime(timer); } - return std::chrono::milliseconds(0); + return std::chrono::milliseconds(remainingTime * 1000 / configTICK_RATE_HZ); } void Timer::StopTimer() { diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 9c7d87b2..aaed5513 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -273,7 +273,7 @@ void DisplayApp::Refresh() { } else { LoadNewScreen(Apps::Timer, DisplayApp::FullRefreshDirections::Up); } - motorController.RunForDuration(35); + motorController.StartRinging(); break; case Messages::AlarmTriggered: if (currentApp == Apps::Alarm) { diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp index a1ede6be..f0b48f8d 100644 --- a/src/displayapp/screens/Timer.cpp +++ b/src/displayapp/screens/Timer.cpp @@ -17,7 +17,8 @@ static void btnEventHandler(lv_obj_t* obj, lv_event_t event) { } } -Timer::Timer(Controllers::Timer& timerController) : timer {timerController} { +Timer::Timer(Controllers::Timer& timerController, Controllers::MotorController& motorController) + : timer {timerController}, motorController {motorController} { lv_obj_t* colonLabel = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_font(colonLabel, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_76); @@ -62,7 +63,9 @@ Timer::Timer(Controllers::Timer& timerController) : timer {timerController} { txtPlayPause = lv_label_create(lv_scr_act(), nullptr); lv_obj_align(txtPlayPause, btnPlayPause, LV_ALIGN_CENTER, 0, 0); - if (timer.IsRunning()) { + if (motorController.IsRinging()) { + SetTimerRinging(); + } else if (timer.IsRunning()) { SetTimerRunning(); } else { SetTimerStopped(); @@ -103,7 +106,12 @@ void Timer::UpdateMask() { } void Timer::Refresh() { - if (timer.IsRunning()) { + if (motorController.IsRinging()) { + SetTimerRinging(); + auto secondsElapsed = std::chrono::duration_cast(timer.GetTimeRemaining()); + minuteCounter.SetValue(secondsElapsed.count() / 60); + secondCounter.SetValue(secondsElapsed.count() % 60); + } else if (timer.IsRunning()) { auto secondsRemaining = std::chrono::duration_cast(timer.GetTimeRemaining()); minuteCounter.SetValue(secondsRemaining.count() / 60); secondCounter.SetValue(secondsRemaining.count() % 60); @@ -123,16 +131,31 @@ void Timer::SetTimerRunning() { minuteCounter.HideControls(); secondCounter.HideControls(); lv_label_set_text_static(txtPlayPause, "Pause"); + lv_obj_set_style_local_bg_color(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Colors::bgAlt); } void Timer::SetTimerStopped() { minuteCounter.ShowControls(); secondCounter.ShowControls(); lv_label_set_text_static(txtPlayPause, "Start"); + lv_obj_set_style_local_bg_color(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GREEN); +} + +void Timer::SetTimerRinging() { + minuteCounter.HideControls(); + secondCounter.HideControls(); + lv_label_set_text_static(txtPlayPause, "Reset"); + lv_obj_set_style_local_bg_color(btnPlayPause, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); + if (ringTime == 0) { + ringTime = xTaskGetTickCount(); + } } void Timer::ToggleRunning() { - if (timer.IsRunning()) { + if (motorController.IsRinging()) { + motorController.StopRinging(); + Reset(); + } else if (timer.IsRunning()) { auto secondsRemaining = std::chrono::duration_cast(timer.GetTimeRemaining()); minuteCounter.SetValue(secondsRemaining.count() / 60); secondCounter.SetValue(secondsRemaining.count() % 60); diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h index 409cae1c..99f3a016 100644 --- a/src/displayapp/screens/Timer.h +++ b/src/displayapp/screens/Timer.h @@ -2,6 +2,7 @@ #include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" +#include "components/motor/MotorController.h" #include "systemtask/SystemTask.h" #include "displayapp/LittleVgl.h" #include "displayapp/widgets/Counter.h" @@ -14,7 +15,7 @@ namespace Pinetime::Applications { namespace Screens { class Timer : public Screen { public: - Timer(Controllers::Timer& timerController); + Timer(Controllers::Timer& timerController, Controllers::MotorController& motorController); ~Timer() override; void Refresh() override; void Reset(); @@ -25,8 +26,10 @@ namespace Pinetime::Applications { private: void SetTimerRunning(); void SetTimerStopped(); + void SetTimerRinging(); void UpdateMask(); Pinetime::Controllers::Timer& timer; + Pinetime::Controllers::MotorController& motorController; lv_obj_t* btnPlayPause; lv_obj_t* txtPlayPause; @@ -43,6 +46,7 @@ namespace Pinetime::Applications { bool buttonPressing = false; lv_coord_t maskPosition = 0; TickType_t pressTime = 0; + TickType_t ringTime = 0; }; } @@ -52,7 +56,7 @@ namespace Pinetime::Applications { static constexpr const char* icon = Screens::Symbols::hourGlass; static Screens::Screen* Create(AppControllers& controllers) { - return new Screens::Timer(controllers.timer); + return new Screens::Timer(controllers.timer, controllers.motorController); }; }; } From 58db58229441273f2617234e7e000ee20a5b2e8d Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Mon, 15 Jan 2024 11:50:54 -0500 Subject: [PATCH 09/13] timer: Stop buzzing after 10 seconds Also reset timer after 1 minute. --- src/displayapp/DisplayApp.cpp | 9 ++++++--- src/displayapp/screens/Timer.cpp | 15 ++++++++++++--- src/displayapp/screens/Timer.h | 3 ++- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index aaed5513..d83f157e 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -266,12 +266,15 @@ void DisplayApp::Refresh() { if (state != States::Running) { PushMessageToSystemTask(System::Messages::GoToRunning); } + // Load timer app if not loaded + if (currentApp != Apps::Timer) { + LoadNewScreen(Apps::Timer, DisplayApp::FullRefreshDirections::Up); + } + // Once loaded, set the timer to ringing mode if (currentApp == Apps::Timer) { lv_disp_trig_activity(nullptr); auto* timer = static_cast(currentScreen.get()); - timer->Reset(); - } else { - LoadNewScreen(Apps::Timer, DisplayApp::FullRefreshDirections::Up); + timer->SetTimerRinging(); } motorController.StartRinging(); break; diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp index f0b48f8d..dbfaeff5 100644 --- a/src/displayapp/screens/Timer.cpp +++ b/src/displayapp/screens/Timer.cpp @@ -106,11 +106,18 @@ void Timer::UpdateMask() { } void Timer::Refresh() { - if (motorController.IsRinging()) { - SetTimerRinging(); + if (isRinging) { auto secondsElapsed = std::chrono::duration_cast(timer.GetTimeRemaining()); minuteCounter.SetValue(secondsElapsed.count() / 60); secondCounter.SetValue(secondsElapsed.count() % 60); + // Stop buzzing after 10 seconds, but continue the counter + if (motorController.IsRinging() && secondsElapsed.count() > 10) { + motorController.StopRinging(); + } + // Reset timer after 1 minute + if (secondsElapsed.count() > 60) { + Reset(); + } } else if (timer.IsRunning()) { auto secondsRemaining = std::chrono::duration_cast(timer.GetTimeRemaining()); minuteCounter.SetValue(secondsRemaining.count() / 60); @@ -135,6 +142,7 @@ void Timer::SetTimerRunning() { } void Timer::SetTimerStopped() { + isRinging = false; minuteCounter.ShowControls(); secondCounter.ShowControls(); lv_label_set_text_static(txtPlayPause, "Start"); @@ -142,6 +150,7 @@ void Timer::SetTimerStopped() { } void Timer::SetTimerRinging() { + isRinging = true; minuteCounter.HideControls(); secondCounter.HideControls(); lv_label_set_text_static(txtPlayPause, "Reset"); @@ -152,7 +161,7 @@ void Timer::SetTimerRinging() { } void Timer::ToggleRunning() { - if (motorController.IsRinging()) { + if (isRinging) { motorController.StopRinging(); Reset(); } else if (timer.IsRunning()) { diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h index 99f3a016..62ae96a7 100644 --- a/src/displayapp/screens/Timer.h +++ b/src/displayapp/screens/Timer.h @@ -22,11 +22,11 @@ namespace Pinetime::Applications { void ToggleRunning(); void ButtonPressed(); void MaskReset(); + void SetTimerRinging(); private: void SetTimerRunning(); void SetTimerStopped(); - void SetTimerRinging(); void UpdateMask(); Pinetime::Controllers::Timer& timer; Pinetime::Controllers::MotorController& motorController; @@ -44,6 +44,7 @@ namespace Pinetime::Applications { Widgets::Counter secondCounter = Widgets::Counter(0, 59, jetbrains_mono_76); bool buttonPressing = false; + bool isRinging = false; lv_coord_t maskPosition = 0; TickType_t pressTime = 0; TickType_t ringTime = 0; From 0585ccdfaebb47efb36032683bddd2736feabb66 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 21 Oct 2023 23:45:41 -0400 Subject: [PATCH 10/13] cleanup code and fix 12hour time on digital face (cherry picked from commit e4b4fba5a18d525c16a2ecdc399b201a1c3cacff) --- src/displayapp/screens/WatchFaceDigital.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 4e29f15c..62d967f8 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -66,10 +66,6 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController, lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); - /*label_time_ampm = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_static(label_time_ampm, ""); - lv_obj_align(label_time_ampm, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, -30, -55);*/ - heartbeatIcon = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat); lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B)); @@ -115,16 +111,11 @@ void WatchFaceDigital::Refresh() { uint8_t second = dateTimeController.Seconds(); if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - /*char ampmChar[3] = "AM"; if (hour == 0) { hour = 12; - } else if (hour == 12) { - ampmChar[0] = 'P'; } else if (hour > 12) { hour = hour - 12; - ampmChar[0] = 'P'; } - lv_label_set_text(label_time_ampm, ampmChar);*/ lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); } else { From 71729f6d0d2904757a19fa75d580fb3bb7a42910 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 May 2024 23:01:53 -0400 Subject: [PATCH 11/13] Change default apps --- src/displayapp/apps/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index 7b909124..73f564c1 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -5,16 +5,16 @@ else () set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Alarm") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Timer") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Steps") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::HeartRate") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::HeartRate") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Music") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paint") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paddle") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paint") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Paddle") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Twos") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Dice") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Metronome") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Navigation") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") + #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif () From 5fc07724b6b27c188ca135321f48450168127061 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 8 May 2024 23:34:22 -0400 Subject: [PATCH 12/13] Add bird app to build and switch calculator to weather in quickring --- src/displayapp/DisplayApp.cpp | 10 +++++----- src/displayapp/apps/CMakeLists.txt | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index a1d064eb..314d28f1 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -317,7 +317,7 @@ void DisplayApp::Refresh() { }; if (!currentScreen->OnTouchEvent(gesture)) { - if (currentApp == Apps::Clock || currentApp == Apps::Music || currentApp == Apps::Calculator || currentApp == Apps::QuickSettings) { + if (currentApp == Apps::Clock || currentApp == Apps::Music || currentApp == Apps::Weather || currentApp == Apps::QuickSettings) { switch (gesture) { case TouchEvents::SwipeUp: if (currentApp == Apps::Clock) { @@ -333,8 +333,8 @@ void DisplayApp::Refresh() { if (currentApp == Apps::Clock) { LoadNewScreen(Apps::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); } else if (currentApp == Apps::QuickSettings) { - LoadNewScreen(Apps::Calculator, DisplayApp::FullRefreshDirections::RightAnim); - } else if (currentApp == Apps::Calculator) { + LoadNewScreen(Apps::Weather, DisplayApp::FullRefreshDirections::RightAnim); + } else if (currentApp == Apps::Weather) { LoadNewScreen(Apps::Music, DisplayApp::FullRefreshDirections::RightAnim); } else { LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::RightAnim); @@ -344,8 +344,8 @@ void DisplayApp::Refresh() { if (currentApp == Apps::Clock) { LoadNewScreen(Apps::Music, DisplayApp::FullRefreshDirections::LeftAnim); } else if (currentApp == Apps::Music) { - LoadNewScreen(Apps::Calculator, DisplayApp::FullRefreshDirections::LeftAnim); - } else if (currentApp == Apps::Calculator) { + LoadNewScreen(Apps::Weather, DisplayApp::FullRefreshDirections::LeftAnim); + } else if (currentApp == Apps::Weather) { LoadNewScreen(Apps::QuickSettings, DisplayApp::FullRefreshDirections::LeftAnim); } else { LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::LeftAnim); diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index 21d03e72..8c9a2f22 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -17,6 +17,7 @@ else () set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Weather") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") + set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Bird") set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif () From 408b2f28a81c6f8f3c6418270687e7bfd30e68b9 Mon Sep 17 00:00:00 2001 From: Josh Date: Thu, 9 May 2024 08:36:17 -0400 Subject: [PATCH 13/13] Remove duplicate of bird app --- src/displayapp/apps/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/displayapp/apps/CMakeLists.txt b/src/displayapp/apps/CMakeLists.txt index d2523f08..f23c845a 100644 --- a/src/displayapp/apps/CMakeLists.txt +++ b/src/displayapp/apps/CMakeLists.txt @@ -18,7 +18,6 @@ else () #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calculator") set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Calendar") #set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Motion") - set(DEFAULT_USER_APP_TYPES "${DEFAULT_USER_APP_TYPES}, Apps::Bird") set(USERAPP_TYPES "${DEFAULT_USER_APP_TYPES}" CACHE STRING "List of user apps to build into the firmware") endif ()