From 10c470ef719412a3d208dc52ea62c32ae2b58ddf Mon Sep 17 00:00:00 2001 From: ecarlett Date: Wed, 29 May 2024 16:19:59 +0200 Subject: [PATCH 1/9] update doc of main branch --- README.md | 86 ++++------------------------------- doc/ui/infineat_settings.png | Bin 0 -> 7646 bytes doc/ui/meow_alarmset.png | Bin 0 -> 6100 bytes 3 files changed, 8 insertions(+), 78 deletions(-) create mode 100644 doc/ui/infineat_settings.png create mode 100644 doc/ui/meow_alarmset.png diff --git a/README.md b/README.md index e4f6707f..45b354a4 100644 --- a/README.md +++ b/README.md @@ -1,88 +1,18 @@ -# [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) +# [InfiniTime](https://github.com/Eve1374/InfiniTime) ![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++. -## New to InfiniTime? +## Welcome to my InfiniTime fork ?! -- [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) -- [Updating the software](doc/gettingStarted/updating-software.md) -- [About the firmware and bootloader](doc/gettingStarted/about-software.md) -- [PineTimeStyle Watch face](https://wiki.pine64.org/wiki/PineTimeStyle) - - [Weather integration](https://wiki.pine64.org/wiki/Infinitime-Weather) +Branches : -### Companion apps +- main : shows this doc +- alarm-status-on-infineat : shows the alarm status on infineat, can be enabled or disabled from the settigns menu that is updated accordingly : -- [Gadgetbridge](https://gadgetbridge.org/) (Android) -- [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) -- [Siglo](https://github.com/alexr4535/siglo) (Linux) -- [InfiniLink](https://github.com/InfiniTimeOrg/InfiniLink) (iOS) -- [ITD](https://gitea.elara.ws/Elara6331/itd) (Linux) -- [WatchMate](https://github.com/azymohliad/watchmate) (Linux) +![Infineat settings](doc/ui/infineat_settings.png "Infineat settings") -***Note**: We removed mentions to NRFConnect as this app is closed source and recent versions do not work anymore with InfiniTime (the last version known to work is 4.24.3). If you used NRFConnect in the past, we recommend you switch to [Gadgetbridge](https://gadgetbridge.org/).* +- my-custom-infinitime : branch were I put things that I want for myself, like a watchface with paw instead of shoe icon for steps counter : -## Development - -- [InfiniTime Vision](doc/InfiniTimeVision.md) -- [Rough structure of the code](doc/code/Intro.md) -- [How to implement an application](doc/code/Apps.md) -- [Generate the fonts and symbols](src/displayapp/fonts/README.md) -- [Tips on designing an app UI](doc/ui_guidelines.md) -- [Bootloader, OTA and DFU](bootloader/README.md) -- [External resources](doc/ExternalResources.md) - -### Contributing - -- [How to contribute?](CONTRIBUTING.md) -- [Coding conventions](doc/coding-convention.md) - -### Build, flash and debug - -- [InfiniTime simulator](https://github.com/InfiniTimeOrg/InfiniSim) -- [Build the project](doc/buildAndProgram.md) -- [Build the project with Docker](doc/buildWithDocker.md) -- [Build the project with VSCode](doc/buildWithVScode.md) -- [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.md) -- [Flash the firmware using SWD interface](doc/SWD.md) -- [Flash the firmware using JLink](doc/jlink.md) -- [Flash the firmware using GDB](doc/gdb.md) -- [Stub using NRF52-DK](doc/PinetimeStubWithNrf52DK.md) - -### API - -- [BLE implementation and API](doc/ble.md) - -### Architecture and technical topics - -- [Memory analysis](doc/MemoryAnalysis.md) - -### Project management - -- [Maintainer's guide](doc/maintainer-guide.md) -- [Versioning](doc/versioning.md) -- [Project branches](doc/branches.md) -- [Files included in the release notes](doc/filesInReleaseNotes.md) -- [Files needed by the factory](doc/files-needed-by-factory.md) - -## Licenses - -This project is released under the GNU General Public License version 3 or, at your option, any later version. - -It integrates the following projects: - -- RTOS: **[FreeRTOS](https://freertos.org)** under the MIT license -- UI: **[LittleVGL/LVGL](https://lvgl.io/)** under the MIT license -- BLE stack: **[NimBLE](https://github.com/apache/mynewt-nimble)** under the Apache 2.0 license -- Font: **[Jetbrains Mono](https://www.jetbrains.com/fr-fr/lp/mono/)** under the Apache 2.0 license - -## Credits - -I’m not working alone on this project. First, many people create pull requests for this project. Then, there is the whole #pinetime community: a lot of people all around the world who are hacking, searching, experimenting and programming the Pinetime. We exchange our ideas, experiments and code in the chat rooms and forums. - -Here are some people I would like to highlight: - -- [Atc1441](https://github.com/atc1441/): He works on an Arduino based firmware for the Pinetime and many other smartwatches based on similar hardware. He was of great help when I was implementing support for the BMA421 motion sensor and I²C driver. -- [Koen](https://github.com/bosmoment): He’s working on a firmware based on RiotOS. He integrated similar libs as me: NimBLE, LittleVGL,… His help was invaluable too! -- [Lup Yuen Lee](https://github.com/lupyuen): He is everywhere: he works on a Rust firmware, builds a MCUBoot based bootloader for the Pinetime, designs a Flutter based companion app for smartphones and writes a lot of articles about the Pinetime! +![Meow watchface](doc/ui/meow_alarmset.png "Meow watchface") diff --git a/doc/ui/infineat_settings.png b/doc/ui/infineat_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..0dffd5e781ae4b945d25c629d4f88d9c7435a770 GIT binary patch literal 7646 zcmYLu1yoeu7w*hB3@}JbDBaR2Dd51+tDV2U0RN(uf3FVz+Ak>344Fq$S$UT#^8+*hm5<+eBGlZ_v0+(l$ zz-;uU>d~88+4Wv2;r*ef3<94#Z5MskCj8fZ7T0f{xUB80lwamrccn(5xBCbwL7Xk$ zrd<6jDKEc~Dqn!nY3fz{W>3&C_g<&%ZHSeP8&Rt4TcE*8 z&T>E5q5Ru%8@yn_aO}NXG{`Z#8I5Gu0}WS!+?3|SM(T?E$jK&G(-ZUPwc@>ZS0Y|w zAbHNok)124#e^;&<}ijO8;z%BQokeh`_~1ZW<5PHx=&o9eRxs)OPQjItTGehb1?{Y zy522)SrZlAtCTOwj{%BF9$3hsz2#%?j8>RZ3fb8zcN9{_YXWcK=>?W7kPfj+qS|RsPea zsKEoCzn|M8`{2ZuwgHtBb{cqis!&~8gYj9uevPuC>`1X?ROKdL=MYQ>e(SiEpR$5L zAab>jXS(DNZOHXmu_yEC=^qZ@@#^kk$*4HP%y`$ zzRj{zAZ?NvVgb2+cr9d8wDx9!i+Mtse@PP?#8*7aHO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&(VINs#2zUwVx~T2Hwr;^`6Vd>n^^mVys!lB z<2H%OvqnAA2Ak+?vhKlWbMM4R*)|QBiMYN~5MTqYwrxotyM5>Ju)D(*#mffzNAF$| z@QZO#C?R9zS|@&JE;bMZG)McA{*xZG=We{s9z>Al;?MyXUwISjEA1gf)S2p=V5rg{ z>!9nzj@$s*d%EZxaZ&o|`89*Gw{imm6mD3k|0k)fz4ioJdlFqB zTD9Xce6}C4k?=xm=jBEfsQ`fIVn}h0Gr+j}*x{WDua#QwKrZE%GJPzRa~ZZ01cVfD z8g&-Kj4RAnwPFP7e`kB_DcM7sUwoS7zSkIK%ET5HgruflyqylDcKrK+!9V&dO7azw z1A5sO*Y@;&cKAUQ^{i6uAFf3wRNeB*J_$FmgIoM6hb7W3h9=h}{L)55r7QqE;iVj^ zw2k_9;?==FXn+L{dXwE@V?lMaBYxVAXuBv(Z{PZT3uBS1OTmfH*aFIp*GD~1pWsP$t`u36$@k_F4g_f#YKhEiq}}UZ7it#zvKzrD18QJ+fxZvxhImWwXeQ hr&pfjnJxd#opE9BMx>kv6?WeiprW7&FPAe9`9GU+tFZt8 literal 0 HcmV?d00001 diff --git a/doc/ui/meow_alarmset.png b/doc/ui/meow_alarmset.png new file mode 100644 index 0000000000000000000000000000000000000000..e0b4b3f787e9c0f363ef0747f25c7ea53c079eff GIT binary patch literal 6100 zcmXX~bySqy*PUS~kw&^(Bt$8xLAs>72bJ!U7-En{LQ+6Nx&EG7tCA2g5CH%H5_L5teXK>_e}wqhKiFs|6#$_9tga+) z7?8WaXyeE{okxK7c#k8(HbA@pXV!h$)J`6^Dep|wqQG|M4ykt4OmQmoZv7Z0sFj;O zb(pylnVQ&R$5_ohUuE~XGi2sRpkuB~^AycDMBw8wFfNk(4ZQ$eIIalfs|ci@c>6uZ z)^~${=Qdl;!Txs#<|+}mXWcDPD-8*$YwrM{ zc)32Si`14fO@{F7xIqJPxN`ak?TCOa7VLN6ev;G(q%i}lQV8EI@|)gPbN5`Mqsx&+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Q`zKyQ;@xzM6^!1vz=eQfg9@%UBuz)HAdp&3OxH~@5?l|fQpxvOJPIc2VA!D mhl+Mao&EJXc&0Ue6((6cL*JH-4#U3I1JsqZmFg5A@Ba^jAm%>+ literal 0 HcmV?d00001 From 48f182c25f840e457ceeeeae2305c9d4883c7bd1 Mon Sep 17 00:00:00 2001 From: ecarlett Date: Wed, 29 May 2024 16:21:07 +0200 Subject: [PATCH 2/9] update README with link to original repo --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 45b354a4..4ae71b8c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devices/pinetime/) with many features, written in modern C++. +Original repo : [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) + + ## Welcome to my InfiniTime fork ?! Branches : From 0c87bc27b21f343a815eed3d7b5817e3b24d2d1d Mon Sep 17 00:00:00 2001 From: Felipe Martinez Date: Sun, 2 Jun 2024 00:43:25 +0000 Subject: [PATCH 3/9] Move motorController.Init call to DisplayApp::Start --- src/displayapp/DisplayApp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index d9b2e9b3..3fd34b3a 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -125,6 +125,7 @@ void DisplayApp::Start(System::BootErrors error) { bootError = error; lvgl.Init(); + motorController.Init(); if (error == System::BootErrors::TouchController) { LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None); @@ -150,7 +151,6 @@ void DisplayApp::Process(void* instance) { void DisplayApp::InitHw() { brightnessController.Init(); ApplyBrightness(); - motorController.Init(); lcd.Init(); } From 9e406c70f95c2db93bbf84965c210ee274da1dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Mart=C3=ADnez?= Date: Sun, 12 May 2024 22:05:30 +0200 Subject: [PATCH 4/9] Remove unnecessary BMA421 reads --- src/drivers/Bma421.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/drivers/Bma421.cpp b/src/drivers/Bma421.cpp index aff62b8d..74d47d06 100644 --- a/src/drivers/Bma421.cpp +++ b/src/drivers/Bma421.cpp @@ -126,13 +126,6 @@ Bma421::Values Bma421::Process() { uint32_t steps = 0; bma423_step_counter_output(&steps, &bma); - int32_t temperature; - bma4_get_temperature(&temperature, BMA4_DEG, &bma); - temperature = temperature / 1000; - - uint8_t activity = 0; - bma423_activity_output(&activity, &bma); - // X and Y axis are swapped because of the way the sensor is mounted in the PineTime return {steps, data.y, data.x, data.z}; } From a449b272f77ea43733be4b3449f6ef57e6d09a02 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Thu, 28 Dec 2023 20:56:37 +0000 Subject: [PATCH 5/9] Continuous time updates --- src/components/ble/SimpleWeatherService.cpp | 2 +- src/components/ble/SimpleWeatherService.h | 4 +- .../datetime/DateTimeController.cpp | 43 +++++++++++++------ src/components/datetime/DateTimeController.h | 16 ++++--- src/displayapp/screens/WatchFaceAnalog.h | 2 +- src/systemtask/SystemTask.cpp | 2 - 6 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/components/ble/SimpleWeatherService.cpp b/src/components/ble/SimpleWeatherService.cpp index 146152f8..504cad14 100644 --- a/src/components/ble/SimpleWeatherService.cpp +++ b/src/components/ble/SimpleWeatherService.cpp @@ -80,7 +80,7 @@ int WeatherCallback(uint16_t /*connHandle*/, uint16_t /*attrHandle*/, struct ble return static_cast(arg)->OnCommand(ctxt); } -SimpleWeatherService::SimpleWeatherService(const DateTime& dateTimeController) : dateTimeController(dateTimeController) { +SimpleWeatherService::SimpleWeatherService(DateTime& dateTimeController) : dateTimeController(dateTimeController) { } void SimpleWeatherService::Init() { diff --git a/src/components/ble/SimpleWeatherService.h b/src/components/ble/SimpleWeatherService.h index 4bbefcfc..03d2f6ff 100644 --- a/src/components/ble/SimpleWeatherService.h +++ b/src/components/ble/SimpleWeatherService.h @@ -40,7 +40,7 @@ namespace Pinetime { class SimpleWeatherService { public: - explicit SimpleWeatherService(const DateTime& dateTimeController); + explicit SimpleWeatherService(DateTime& dateTimeController); void Init(); @@ -140,7 +140,7 @@ namespace Pinetime { uint16_t eventHandle {}; - const Pinetime::Controllers::DateTime& dateTimeController; + Pinetime::Controllers::DateTime& dateTimeController; std::optional currentWeather; std::optional forecast; diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index f0ccb5e5..39bba15f 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -1,6 +1,7 @@ #include "components/datetime/DateTimeController.h" #include #include +#include using namespace Pinetime::Controllers; @@ -12,11 +13,16 @@ namespace { } DateTime::DateTime(Controllers::Settings& settingsController) : settingsController {settingsController} { + mutex = xSemaphoreCreateMutex(); + ASSERT(mutex != nullptr); + xSemaphoreGive(mutex); } void DateTime::SetCurrentTime(std::chrono::time_point t) { + xSemaphoreTake(mutex, portMAX_DELAY); this->currentDateTime = t; - UpdateTime(previousSystickCounter); // Update internal state without updating the time + UpdateTime(previousSystickCounter, true); // Update internal state without updating the time + xSemaphoreGive(mutex); } void DateTime::SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second) { @@ -29,13 +35,15 @@ void DateTime::SetTime(uint16_t year, uint8_t month, uint8_t day, uint8_t hour, /* .tm_year = */ year - 1900, }; - tm.tm_isdst = -1; // Use DST value from local time zone - currentDateTime = std::chrono::system_clock::from_time_t(std::mktime(&tm)); - NRF_LOG_INFO("%d %d %d ", day, month, year); NRF_LOG_INFO("%d %d %d ", hour, minute, second); - UpdateTime(previousSystickCounter); + tm.tm_isdst = -1; // Use DST value from local time zone + + xSemaphoreTake(mutex, portMAX_DELAY); + currentDateTime = std::chrono::system_clock::from_time_t(std::mktime(&tm)); + UpdateTime(previousSystickCounter, true); + xSemaphoreGive(mutex); systemTask->PushMessage(System::Messages::OnNewTime); } @@ -45,25 +53,34 @@ void DateTime::SetTimeZone(int8_t timezone, int8_t dst) { dstOffset = dst; } -void DateTime::UpdateTime(uint32_t systickCounter) { +std::chrono::time_point DateTime::CurrentDateTime() { + xSemaphoreTake(mutex, portMAX_DELAY); + UpdateTime(nrf_rtc_counter_get(portNRF_RTC_REG), false); + xSemaphoreGive(mutex); + return currentDateTime; +} + +void DateTime::UpdateTime(uint32_t systickCounter, bool forceUpdate) { // Handle systick counter overflow uint32_t systickDelta = 0; if (systickCounter < previousSystickCounter) { - systickDelta = 0xffffff - previousSystickCounter; + systickDelta = static_cast(portNRF_RTC_MAXTICKS) - previousSystickCounter; systickDelta += systickCounter + 1; } else { systickDelta = systickCounter - previousSystickCounter; } - /* - * 1000 ms = 1024 ticks - */ - auto correctedDelta = systickDelta / 1024; - auto rest = systickDelta % 1024; + auto correctedDelta = systickDelta / configTICK_RATE_HZ; + // If a second hasn't passed, there is nothing to do + // If the time has been changed, set forceUpdate to trigger internal state updates + if (correctedDelta == 0 && !forceUpdate) { + return; + } + auto rest = systickDelta % configTICK_RATE_HZ; if (systickCounter >= rest) { previousSystickCounter = systickCounter - rest; } else { - previousSystickCounter = 0xffffff - (rest - systickCounter); + previousSystickCounter = static_cast(portNRF_RTC_MAXTICKS) - (rest - systickCounter - 1); } currentDateTime += std::chrono::seconds(correctedDelta); diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h index f719df7d..5a453f20 100644 --- a/src/components/datetime/DateTimeController.h +++ b/src/components/datetime/DateTimeController.h @@ -5,6 +5,8 @@ #include #include #include "components/settings/Settings.h" +#include +#include namespace Pinetime { namespace System { @@ -45,8 +47,6 @@ namespace Pinetime { */ void SetTimeZone(int8_t timezone, int8_t dst); - void UpdateTime(uint32_t systickCounter); - uint16_t Year() const { return 1900 + localTime.tm_year; } @@ -124,12 +124,10 @@ namespace Pinetime { static const char* MonthShortToStringLow(Months month); static const char* DayOfWeekShortToStringLow(Days day); - std::chrono::time_point CurrentDateTime() const { - return currentDateTime; - } + std::chrono::time_point CurrentDateTime(); - std::chrono::time_point UTCDateTime() const { - return currentDateTime - std::chrono::seconds((tzOffset + dstOffset) * 15 * 60); + std::chrono::time_point UTCDateTime() { + return CurrentDateTime() - std::chrono::seconds((tzOffset + dstOffset) * 15 * 60); } std::chrono::seconds Uptime() const { @@ -141,10 +139,14 @@ namespace Pinetime { std::string FormattedTime(); private: + void UpdateTime(uint32_t systickCounter, bool forceUpdate); + std::tm localTime; int8_t tzOffset = 0; int8_t dstOffset = 0; + SemaphoreHandle_t mutex = nullptr; + uint32_t previousSystickCounter = 0; std::chrono::time_point currentDateTime; std::chrono::seconds uptime {0}; diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index 2eee657e..958ff64d 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -75,7 +75,7 @@ namespace Pinetime { BatteryIcon batteryIcon; - const Controllers::DateTime& dateTimeController; + Controllers::DateTime& dateTimeController; const Controllers::Battery& batteryController; const Controllers::Ble& bleController; Controllers::NotificationManager& notificationManager; diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index e3d40d35..a56c2591 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -410,8 +410,6 @@ void SystemTask::Work() { } monitor.Process(); - uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(systick_counter); NoInit_BackUpTime = dateTimeController.CurrentDateTime(); if (nrf_gpio_pin_read(PinMap::Button) == 0) { watchdog.Reload(); From 4930c0cab70ab580542e381d9a6599f3866b35f4 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Sat, 30 Mar 2024 01:13:16 +0000 Subject: [PATCH 6/9] Include assert (fix sim) --- src/components/datetime/DateTimeController.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index 39bba15f..7f58c9b3 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -2,6 +2,7 @@ #include #include #include +#include "nrf_assert.h" using namespace Pinetime::Controllers; From f9a16feeaf144eceb0c1b13171f29cd07e0e9e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 9 Jun 2024 18:26:45 +0200 Subject: [PATCH 7/9] Continuous time updates Add TODO.md in src/components/datetime. This file give detailed information about a refactoring of the DateTimeController that would be nice to do in the future. --- src/components/datetime/TODO.md | 41 +++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/components/datetime/TODO.md diff --git a/src/components/datetime/TODO.md b/src/components/datetime/TODO.md new file mode 100644 index 00000000..e9590898 --- /dev/null +++ b/src/components/datetime/TODO.md @@ -0,0 +1,41 @@ +# Refactoring needed + +## Context + +The [PR #2041 - Continuous time updates](https://github.com/InfiniTimeOrg/InfiniTime/pull/2041) highlighted some +limitations in the design of DateTimeController: the granularity of the time returned by `DateTime::CurrentDateTime()` +is limited by the frequency at which SystemTask calls `DateTime::UpdateTime()`, which is currently set to 100ms. + +@mark9064 provided more details +in [this comment](https://github.com/InfiniTimeOrg/InfiniTime/pull/2041#issuecomment-2048528967). + +The [PR #2041 - Continuous time updates](https://github.com/InfiniTimeOrg/InfiniTime/pull/2041) provided some changes +to `DateTime` controller that improves the granularity of the time returned by `DateTime::CurrentDateTime()`. + +However, the review showed that `DateTime` cannot be `const` anymore, even when it's only used to get the current time, +since `DateTime::CurrentDateTime()` changes the internal state of the instance. + +We tried to identify alternative implementation that would have maintained the "const correctness" but we eventually +figured that this would lead to a re-design of `DateTime` which was out of scope of the initial PR (Continuous time +updates and always on display). + +So we decided to merge this PR #2041 and agree to fix/improve `DateTime` later on. + +## What needs to be done? + +Improve/redesign `DateTime` so that it + +* provides a very granular (ideally down to the millisecond) date and time via `CurrentDateTime()`. +* can be declared/passed as `const` when it's only used to **get** the time. +* limits the use of mutex as much as possible (an ideal implementation would not use any mutex, but this might not be + possible). +* improves the design of `DateTime::Seconds()`, `DateTime::Minutes()`, `DateTime::Hours()`, etc as + explained [in this comment](https://github.com/InfiniTimeOrg/InfiniTime/pull/2054#pullrequestreview-2037033105). + +Once this redesign is implemented, all instances/references to `DateTime` should be reviewed and updated to use `const` +where appropriate. + +Please check the following PR to get more context about this redesign: + +* [#2041 - Continuous time updates by @mark9064](https://github.com/InfiniTimeOrg/InfiniTime/pull/2041) +* [#2054 - Continuous time update - Alternative implementation to #2041 by @JF002](https://github.com/InfiniTimeOrg/InfiniTime/pull/2054) \ No newline at end of file From fdc3b8badbf5d11b50a378f0e572dfe3e443c08c Mon Sep 17 00:00:00 2001 From: Max Buchholz Date: Thu, 13 Jun 2024 08:41:00 +0200 Subject: [PATCH 8/9] README: Change links from Pine wiki to new documentation As the Wiki was replaced by a new documentation website and is read-only, we should update the links, to point to the most up-to-date documentation. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4f6707f..d3d1130f 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Fast open-source firmware for the [PineTime smartwatch](https://pine64.org/devic - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) - [Updating the software](doc/gettingStarted/updating-software.md) - [About the firmware and bootloader](doc/gettingStarted/about-software.md) -- [PineTimeStyle Watch face](https://wiki.pine64.org/wiki/PineTimeStyle) - - [Weather integration](https://wiki.pine64.org/wiki/Infinitime-Weather) +- [PineTimeStyle Watch face](https://pine64.org/documentation/PineTime/Watchfaces/PineTimeStyle) + - [Weather integration](https://pine64.org/documentation/PineTime/Software/InfiniTime_weather/) ### Companion apps From f8f8993fac0bdd022dc9ef41a67c0b558f29ba89 Mon Sep 17 00:00:00 2001 From: mark9064 <30447455+mark9064@users.noreply.github.com> Date: Thu, 4 Apr 2024 19:29:46 +0100 Subject: [PATCH 9/9] Batch display command arguments --- src/drivers/St7789.cpp | 58 ++++++++++++++++++++---------------------- src/drivers/St7789.h | 9 ++++--- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 12e95a41..c22f2199 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -1,3 +1,4 @@ +#include #include "drivers/St7789.h" #include #include @@ -16,10 +17,9 @@ void St7789::Init() { HardwareReset(); SoftwareReset(); SleepOut(); - ColMod(); + PixelFormat(); MemoryDataAccessControl(); - ColumnAddressSet(); - RowAddressSet(); + SetAddrWindow(0, 0, Width, Height); // P8B Mirrored version does not need display inversion. #ifndef DRIVER_DISPLAY_MIRROR DisplayInversionOn(); @@ -97,8 +97,9 @@ void St7789::SleepIn() { sleepIn = true; } -void St7789::ColMod() { - WriteCommand(static_cast(Commands::ColMod)); +void St7789::PixelFormat() { + WriteCommand(static_cast(Commands::PixelFormat)); + // 65K colours, 16-bit per pixel WriteData(0x55); } @@ -118,22 +119,6 @@ void St7789::MemoryDataAccessControl() { #endif } -void St7789::ColumnAddressSet() { - WriteCommand(static_cast(Commands::ColumnAddressSet)); - WriteData(0x00); - WriteData(0x00); - WriteData(Width >> 8u); - WriteData(Width & 0xffu); -} - -void St7789::RowAddressSet() { - WriteCommand(static_cast(Commands::RowAddressSet)); - WriteData(0x00); - WriteData(0x00); - WriteData(320u >> 8u); - WriteData(320u & 0xffu); -} - void St7789::DisplayInversionOn() { WriteCommand(static_cast(Commands::DisplayInversionOn)); } @@ -148,16 +133,23 @@ void St7789::DisplayOn() { void St7789::SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { WriteCommand(static_cast(Commands::ColumnAddressSet)); - WriteData(x0 >> 8); - WriteData(x0 & 0xff); - WriteData(x1 >> 8); - WriteData(x1 & 0xff); + uint8_t colArgs[] = { + static_cast(x0 >> 8), // x start MSB + static_cast(x0), // x start LSB + static_cast(x1 >> 8), // x end MSB + static_cast(x1) // x end LSB + }; + WriteData(colArgs, sizeof(colArgs)); WriteCommand(static_cast(Commands::RowAddressSet)); - WriteData(y0 >> 8); - WriteData(y0 & 0xff); - WriteData(y1 >> 8); - WriteData(y1 & 0xff); + uint8_t rowArgs[] = { + static_cast(y0 >> 8), // y start MSB + static_cast(y0), // y start LSB + static_cast(y1 >> 8), // y end MSB + static_cast(y1) // y end LSB + }; + memcpy(addrWindowArgs, rowArgs, sizeof(rowArgs)); + WriteData(addrWindowArgs, sizeof(addrWindowArgs)); } void St7789::WriteToRam(const uint8_t* data, size_t size) { @@ -179,8 +171,12 @@ void St7789::DisplayOff() { void St7789::VerticalScrollStartAddress(uint16_t line) { verticalScrollingStartAddress = line; WriteCommand(static_cast(Commands::VerticalScrollStartAddress)); - WriteData(line >> 8u); - WriteData(line & 0x00ffu); + uint8_t args[] = { + static_cast(line >> 8), // Frame memory line pointer MSB + static_cast(line) // Frame memory line pointer LSB + }; + memcpy(verticalScrollArgs, args, sizeof(args)); + WriteData(verticalScrollArgs, sizeof(verticalScrollArgs)); } void St7789::Uninit() { diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index 45d4b56d..844e0180 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -40,7 +40,7 @@ namespace Pinetime { void SleepOut(); void EnsureSleepOutPostDelay(); void SleepIn(); - void ColMod(); + void PixelFormat(); void MemoryDataAccessControl(); void DisplayInversionOn(); void NormalModeOn(); @@ -68,16 +68,17 @@ namespace Pinetime { MemoryDataAccessControl = 0x36, VerticalScrollDefinition = 0x33, VerticalScrollStartAddress = 0x37, - ColMod = 0x3a, + PixelFormat = 0x3a, VdvSet = 0xc4, }; void WriteData(uint8_t data); void WriteData(const uint8_t* data, size_t size); - void ColumnAddressSet(); static constexpr uint16_t Width = 240; static constexpr uint16_t Height = 320; - void RowAddressSet(); + + uint8_t addrWindowArgs[4]; + uint8_t verticalScrollArgs[2]; }; } }