diff --git a/README.md b/README.md index e4f6707f..b58821ef 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@ -# [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) +# Infinitime with a new watchface ![InfiniTime logo](doc/logo/infinitime-logo-small.jpg "InfiniTime Logo") Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devices/pinetime/) with many features, written in modern C++. +## Quick notes on this InfiniTime version + +- I copied the source code from this git repo : [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) +- I added a watch face "WatchFaceMeow" whose main features are to be pink and have info about the alarm status +- I stored the compile commands in scripts compile.sh to run from InfiniTime/ folder, and make_pine_mcu.sh to build the image must be run from InfiniTime/build/ (compile.sh copies make_pine_mcu.sh to build/ +- The file to flash to the pinetime is InfiniTime/build/pinetime-mcuboot-app-dfu-1.14.0.zip : I didn't change the version compared to the one I downloaded from [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) so make sure not to keep keep a copy of it + ## New to InfiniTime? - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) diff --git a/build/src/pinetime-mcuboot-app-dfu-1.14.0.zip b/build/src/pinetime-mcuboot-app-dfu-1.14.0.zip new file mode 100644 index 00000000..4904d149 Binary files /dev/null and b/build/src/pinetime-mcuboot-app-dfu-1.14.0.zip differ diff --git a/src/Version.h.in b/src/Version.h.in index 0d6219c0..dfeccdbc 100644 --- a/src/Version.h.in +++ b/src/Version.h.in @@ -19,4 +19,4 @@ namespace Pinetime { static constexpr const char* commitHash = "@PROJECT_GIT_COMMIT_HASH@"; static constexpr const char* versionString = "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@"; }; -} \ No newline at end of file +} diff --git a/src/displayapp/screens/README.md b/src/displayapp/screens/README.md index 4f785766..f84a5fc6 100644 --- a/src/displayapp/screens/README.md +++ b/src/displayapp/screens/README.md @@ -1,8 +1,10 @@ - to edit with new watch face : +# Add a new watchface : +## Modify the following files with the names of your source files : + +- /src/displayapp/apps/Apps.h.in +- /src/components/settings/Settings.h +- /src/displayapp/UserApps.h +- /src/displayapp/apps/CMakeLists.txt +- CMakelists.txt -/src/displayapp/apps/Apps.h.in -/src/components/settings/Settings.h -/src/displayapp/UserApps.h -/src/displayapp/apps/CMakeLists.txt -CMakelists.txt diff --git a/src/displayapp/screens/WatchFaceMeow.cpp b/src/displayapp/screens/WatchFaceMeow.cpp index 5b1c94c3..0adff72c 100644 --- a/src/displayapp/screens/WatchFaceMeow.cpp +++ b/src/displayapp/screens/WatchFaceMeow.cpp @@ -1,3 +1,15 @@ +/*********************************************************/ +/* + * I modified the watchface Infineat : + * - added alarm info on the screen + * - modified the colors + * - modified step count icon + * Except colors, modifications are at line 254 and 500 + */ +/*********************************************************/ + + + #include "displayapp/screens/WatchFaceMeow.h" #include @@ -61,15 +73,18 @@ namespace { LV_COLOR_MAKE(0xff, 0xff, 0xff), LV_COLOR_MAKE(0x62, 0xd5, 0x15), LV_COLOR_MAKE(0x00, 0x74, 0x00)}; - constexpr std::array rainbowColors = {LV_COLOR_MAKE(0x2d, 0xa4, 0x00), //vert petit triangle le plus haut - LV_COLOR_MAKE(0xac, 0x09, 0xc4), //purple petit triangle bas côté horloge - LV_COLOR_MAKE(0xfe, 0x03, 0x03), //rouge 2 petits triangles à côté de batterie - LV_COLOR_MAKE(0x0d, 0x57, 0xff), //bleu petit triangle le plus bas + //added comments to say which color is which triangle + constexpr std::array rainbowColors = {LV_COLOR_MAKE(0x2d, 0xa4, 0x00), //green, small triangle on top + LV_COLOR_MAKE(0xac, 0x09, 0xc4), //purple, smalltriangle in the bottom half part on the clock display side + LV_COLOR_MAKE(0xfe, 0x03, 0x03), //red, the two small triangles above and below the battery + LV_COLOR_MAKE(0x0d, 0x57, 0xff), //blue, the small triangle at the bottom LV_COLOR_MAKE(0xff, 0xff, 0xff), LV_COLOR_MAKE(0xff, 0xff, 0xff), LV_COLOR_MAKE(0xff, 0xff, 0xff), - LV_COLOR_MAKE(0xe0, 0xb9, 0x00), //jaune gd triangle haut - LV_COLOR_MAKE(0xe8, 0x51, 0x02)}; //orange gd triangle bas + LV_COLOR_MAKE(0xe0, 0xb9, 0x00), //Yellow, large triangle on top left + LV_COLOR_MAKE(0xe8, 0x51, 0x02)}; //orange, large triangle on bottom left + +// Add new colors, still rainbow but more pastel like constexpr std::array rainbowVividColors ={LV_COLOR_MAKE(0xa5, 0xeb, 0x64), LV_COLOR_MAKE(0xfc, 0x42, 0xb5), LV_COLOR_MAKE(0xe7, 0xc1, 0xff), @@ -100,8 +115,8 @@ namespace { LV_COLOR_MAKE(0x11, 0x70, 0x5a)}; //define colors for texts and symbols + // gray is used for text symbols and time. I changed it to pink, because I can. //static constexpr lv_color_t grayColor = LV_COLOR_MAKE(0x99, 0x99, 0x99); - static constexpr lv_color_t grayColor = LV_COLOR_MAKE(0x99, 0x99, 0x99); static constexpr lv_color_t pinkColor = LV_COLOR_MAKE(0xfc, 0x42, 0xb5); constexpr const std::array* returnColor(colors color) { @@ -243,12 +258,16 @@ WatchFaceMeow::WatchFaceMeow(Controllers::DateTime& dateTimeController, lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_TOP_MID, 0, -10); - //version par defaut de l'icône avant qu'il aie regardé le statut de l'alarme ? + // Based on existing code, I understand that items on the screen (date, bluteooth status..) + // are declared here with default states, and later below the state (date, ...) is assigned + // So I do the same to add the alarm status : I put a symbol that has a default value + // and a text that has a default value + // symbol alarmIcon = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(alarmIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, pinkColor); lv_label_set_text_static(alarmIcon, Symbols::paw); lv_obj_align(alarmIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); - //version par defaut de l'icône avant qu'il aie regardé le statut de l'alarme ? + // text labelAlarm = lv_label_create(lv_scr_act(), nullptr); lv_obj_set_style_local_text_color(labelAlarm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, pinkColor); lv_obj_set_style_local_text_font(labelAlarm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_teko); @@ -481,8 +500,9 @@ void WatchFaceMeow::Refresh() { lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_TOP_MID, 0, -10); } - //Add alarm state and time + // Add alarm state and time // AlarmState is an enum type in class AlarmController that is in namespace controllers + // Not sure if it can handle automatically am / pm format (TODO) alarmState = alarmController.State()==Pinetime::Controllers::AlarmController::AlarmState::Set; lv_label_set_text_static(alarmIcon, AlarmIcon::GetIcon(alarmState)); lv_obj_align(alarmIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); @@ -495,14 +515,6 @@ void WatchFaceMeow::Refresh() { lv_label_set_text_static(labelAlarm, Symbols::none); } - //lv_label_set_text_fmt(labelMinutes, "%02d", minute); -/* - if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { - lv_obj_align(labelHour, timeContainer, LV_ALIGN_IN_TOP_MID, 0, 5); - lv_obj_align(labelMinutes, timeContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0); - } - */ - stepCount = motionController.NbSteps(); if (stepCount.IsUpdated()) {