From 46b664b5289f7ce7c4170d6d8a65cfd770dc855b Mon Sep 17 00:00:00 2001 From: Steve Amor Date: Mon, 28 Aug 2023 07:18:48 +0100 Subject: [PATCH 1/2] Corrects typo for make option for recovery-loader --- doc/buildAndProgram.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/buildAndProgram.md b/doc/buildAndProgram.md index ea1ddae1b8..29b9107619 100644 --- a/doc/buildAndProgram.md +++ b/doc/buildAndProgram.md @@ -98,4 +98,4 @@ Binary files are generated into the folder `src`: - **pinetime-mcuboot-app-image** : MCUBoot image of the firmware - **pinetime-mcuboot-app-dfu** : DFU file of the firmware -The same files are generated for **pinetime-recovery** and **pinetime-recoveryloader** +The same files are generated for **pinetime-recovery** and **pinetime-recovery-loader** From eac460f03094a357c679c5dede7295aa8b2e1fb1 Mon Sep 17 00:00:00 2001 From: FintasticMan Date: Fri, 6 Oct 2023 19:54:20 +0200 Subject: [PATCH 2/2] weather: Fix GetCurrent* functions returning future events (#1879) --- src/components/ble/weather/WeatherService.cpp | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/ble/weather/WeatherService.cpp b/src/components/ble/weather/WeatherService.cpp index 513bb2a16b..b9a6af556c 100644 --- a/src/components/ble/weather/WeatherService.cpp +++ b/src/components/ble/weather/WeatherService.cpp @@ -404,7 +404,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentClouds() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Clouds && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Clouds && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -415,7 +416,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentObscuration() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Obscuration && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Obscuration && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -426,7 +428,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentPrecipitation() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Precipitation && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Precipitation && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -437,7 +440,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentWind() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Wind && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Wind && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -448,7 +452,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentTemperature() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Temperature && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Temperature && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -459,7 +464,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentHumidity() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Humidity && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Humidity && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -470,7 +476,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentPressure() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Pressure && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Pressure && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -481,7 +488,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentLocation() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::Location && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::Location && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } } @@ -492,7 +500,8 @@ namespace Pinetime { std::unique_ptr& WeatherService::GetCurrentQuality() { uint64_t currentTimestamp = GetCurrentUnixTimestamp(); for (auto&& header : this->timeline) { - if (header->eventType == WeatherData::eventtype::AirQuality && IsEventStillValid(header, currentTimestamp)) { + if (header->eventType == WeatherData::eventtype::AirQuality && currentTimestamp >= header->timestamp && + IsEventStillValid(header, currentTimestamp)) { return reinterpret_cast&>(header); } }