From d5dfa8087679b644c13e1d420b8ef2fc894b3b51 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 25 Oct 2021 12:53:14 +0300 Subject: Newer buttonhandler diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a839e08..e727b2b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -507,6 +507,7 @@ list(APPEND SOURCE_FILES components/heartrate/Ptagc.cpp components/heartrate/HeartRateController.cpp + buttonhandler/ButtonHandler.cpp touchhandler/TouchHandler.cpp ) @@ -567,6 +568,7 @@ list(APPEND RECOVERY_SOURCE_FILES components/heartrate/Ptagc.cpp components/motor/MotorController.cpp components/fs/FS.cpp + buttonhandler/ButtonHandler.cpp touchhandler/TouchHandler.cpp ) @@ -681,6 +683,7 @@ set(INCLUDE_FILES components/heartrate/Ptagc.h components/heartrate/HeartRateController.h components/motor/MotorController.h + buttonhandler/ButtonHandler.h touchhandler/TouchHandler.h ) diff --git a/src/buttonhandler/ButtonHandler.cpp b/src/buttonhandler/ButtonHandler.cpp new file mode 100644 index 0000000..997409e --- /dev/null +++ b/src/buttonhandler/ButtonHandler.cpp @@ -0,0 +1,85 @@ +#include "ButtonHandler.h" + +using namespace Pinetime::Controllers; + +void ButtonTimerCallback(TimerHandle_t xTimer) { + auto* buttonHandler = static_cast(pvTimerGetTimerID(xTimer)); + buttonHandler->HandleEvent(ButtonHandler::Timer); +} + +void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) { + this->systemTask = systemTask; + buttonTimer = xTimerCreate("buttonTimer", 0, pdFALSE, this, ButtonTimerCallback); +} + +void ButtonHandler::HandleEvent(events event) { + static constexpr TickType_t doubleClickTime = pdMS_TO_TICKS(200); + static constexpr TickType_t longPressTime = pdMS_TO_TICKS(400); + static constexpr TickType_t longerPressTime = pdMS_TO_TICKS(2000); + + if (systemTask->IsSleeping()) { + // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping + systemTask->PushMessage(System::Messages::GoToRunning); + } else { + systemTask->PushMessage(System::Messages::ReloadIdleTimer); + } + + if (event == Press) { + buttonPressed = true; + } else if (event == Release) { + releaseTime = xTaskGetTickCount(); + buttonPressed = false; + } + + switch (state) { + case Idle: + if (event == Press) { + xTimerChangePeriod(buttonTimer, doubleClickTime, 0); + xTimerStart(buttonTimer, 0); + state = Pressed; + } + break; + case Pressed: + if (event == Press) { + if (xTaskGetTickCount() - releaseTime < doubleClickTime) { + systemTask->PushMessage(System::Messages::OnButtonDoubleClicked); + xTimerStop(buttonTimer, 0); + state = Idle; + } + } else if (event == Release) { + xTimerChangePeriod(buttonTimer, doubleClickTime, 0); + xTimerStart(buttonTimer, 0); + } else if (event == Timer) { + if (buttonPressed) { + xTimerChangePeriod(buttonTimer, longPressTime - doubleClickTime, 0); + xTimerStart(buttonTimer, 0); + state = Holding; + } else { + systemTask->PushMessage(System::Messages::OnButtonPushed); + state = Idle; + } + } + break; + case Holding: + if (event == Release) { + systemTask->PushMessage(System::Messages::OnButtonPushed); + xTimerStop(buttonTimer, 0); + state = Idle; + } else if (event == Timer) { + xTimerChangePeriod(buttonTimer, longerPressTime - longPressTime - doubleClickTime, 0); + xTimerStart(buttonTimer, 0); + systemTask->PushMessage(System::Messages::OnButtonLongPressed); + state = LongHeld; + } + break; + case LongHeld: + if (event == Release) { + xTimerStop(buttonTimer, 0); + state = Idle; + } else if (event == Timer) { + systemTask->PushMessage(System::Messages::OnButtonLongerPressed); + state = Idle; + } + break; + } +} diff --git a/src/buttonhandler/ButtonHandler.h b/src/buttonhandler/ButtonHandler.h new file mode 100644 index 0000000..5d5b57e --- /dev/null +++ b/src/buttonhandler/ButtonHandler.h @@ -0,0 +1,24 @@ +#pragma once + +#include "systemtask/SystemTask.h" +#include +#include + +namespace Pinetime { + namespace Controllers { + class ButtonHandler { + public: + enum events { Press, Release, Timer }; + void Init(Pinetime::System::SystemTask* systemTask); + void HandleEvent(events event); + + private: + Pinetime::System::SystemTask* systemTask = nullptr; + TickType_t releaseTime = 0; + TimerHandle_t buttonTimer; + bool buttonPressed = false; + enum states { Idle, Pressed, Holding, LongHeld }; + states state = Idle; + }; + } +} diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index abe5851..13ee004 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -260,6 +260,20 @@ void DisplayApp::Refresh() { } } break; + case Messages::ButtonLongPressed: + if (currentApp != Apps::Clock) { + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Down); + } + break; + case Messages::ButtonLongerPressed: + // Create reboot app and open it instead + LoadApp(Apps::SysInfo, DisplayApp::FullRefreshDirections::Up); + break; + case Messages::ButtonDoubleClicked: + if (currentApp != Apps::Notifications && currentApp != Apps::NotificationsPreview) { + LoadApp(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); + } + break; case Messages::BleFirmwareUpdateStarted: LoadApp(Apps::FirmwareUpdate, DisplayApp::FullRefreshDirections::Down); diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index d48b646..ab0a060 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -9,6 +9,9 @@ namespace Pinetime { UpdateBleConnection, TouchEvent, ButtonPushed, + ButtonLongPressed, + ButtonLongerPressed, + ButtonDoubleClicked, NewNotification, TimerDone, BleFirmwareUpdateStarted, diff --git a/src/main.cpp b/src/main.cpp index fc77235..b942fd4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -47,6 +47,7 @@ #include "systemtask/SystemTask.h" #include "drivers/PinMap.h" #include "touchhandler/TouchHandler.h" +#include "buttonhandler/ButtonHandler.h" #if NRF_LOG_ENABLED #include "logging/NrfLogger.h" @@ -96,8 +97,6 @@ TimerHandle_t debounceTimer; TimerHandle_t debounceChargeTimer; Pinetime::Controllers::Battery batteryController; Pinetime::Controllers::Ble bleController; -static constexpr uint8_t pinTouchIrq = Pinetime::PinMap::Cst816sIrq; -static constexpr uint8_t pinPowerPresentIrq = Pinetime::PinMap::PowerPresent; Pinetime::Controllers::HeartRateController heartRateController; Pinetime::Applications::HeartRateTask heartRateApp(heartRateSensor, heartRateController); @@ -110,6 +109,7 @@ Pinetime::Controllers::MotionController motionController; Pinetime::Controllers::TimerController timerController; Pinetime::Controllers::AlarmController alarmController {dateTimeController}; Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); +Pinetime::Controllers::ButtonHandler buttonHandler; Pinetime::Controllers::FS fs {spiNorFlash}; Pinetime::Controllers::Settings settingsController {fs}; @@ -153,7 +153,8 @@ Pinetime::System::SystemTask systemTask(spi, displayApp, heartRateApp, fs, - touchHandler); + touchHandler, + buttonHandler); /* Variable Declarations for variables in noinit SRAM Increment NoInit_MagicValue upon adding variables to this area @@ -176,11 +177,11 @@ void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action if (pin == Pinetime::PinMap::PowerPresent and action == NRF_GPIOTE_POLARITY_TOGGLE) { xTimerStartFromISR(debounceChargeTimer, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); - return; + } else if (pin == Pinetime::PinMap::Button) { + // This activates on button release as well due to bouncing + xTimerStartFromISR(debounceTimer, &xHigherPriorityTaskWoken); + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } - - xTimerStartFromISR(debounceTimer, &xHigherPriorityTaskWoken); - portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } void DebounceTimerChargeCallback(TimerHandle_t xTimer) { @@ -188,9 +189,8 @@ void DebounceTimerChargeCallback(TimerHandle_t xTimer) { systemTask.PushMessage(Pinetime::System::Messages::OnChargingEvent); } -void DebounceTimerCallback(TimerHandle_t xTimer) { - xTimerStop(xTimer, 0); - systemTask.OnButtonPushed(); +void DebounceTimerCallback(TimerHandle_t /*unused*/) { + systemTask.PushMessage(Pinetime::System::Messages::HandleButtonEvent); } void SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler(void) { @@ -319,8 +319,8 @@ int main(void) { } nrf_gpio_cfg_default(Pinetime::PinMap::TwiScl); - debounceTimer = xTimerCreate("debounceTimer", 200, pdFALSE, (void*) 0, DebounceTimerCallback); - debounceChargeTimer = xTimerCreate("debounceTimerCharge", 200, pdFALSE, (void*) 0, DebounceTimerChargeCallback); + debounceTimer = xTimerCreate("debounceTimer", 10, pdFALSE, nullptr, DebounceTimerCallback); + debounceChargeTimer = xTimerCreate("debounceTimerCharge", 200, pdFALSE, nullptr, DebounceTimerChargeCallback); // retrieve version stored by bootloader Pinetime::BootloaderVersion::SetVersion(NRF_TIMER2->CC[0]); diff --git a/src/systemtask/Messages.h b/src/systemtask/Messages.h index 5aa218d..b0bdbf3 100644 --- a/src/systemtask/Messages.h +++ b/src/systemtask/Messages.h @@ -15,12 +15,17 @@ namespace Pinetime { BleFirmwareUpdateStarted, BleFirmwareUpdateFinished, OnTouchEvent, - OnButtonEvent, + OnButtonPushed, + OnButtonLongPressed, + OnButtonLongerPressed, + OnButtonDoubleClicked, + HandleButtonEvent, OnDisplayTaskSleeping, EnableSleeping, DisableSleeping, OnNewDay, OnChargingEvent, + ReloadIdleTimer, SetOffAlarm, StopRinging, MeasureBatteryTimerExpired, diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index e0a5907..b7db0b9 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -25,7 +25,6 @@ #include "main.h" #include "BootErrors.h" - #include using namespace Pinetime::System; @@ -77,7 +76,8 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, Pinetime::Applications::DisplayApp& displayApp, Pinetime::Applications::HeartRateTask& heartRateApp, Pinetime::Controllers::FS& fs, - Pinetime::Controllers::TouchHandler& touchHandler) + Pinetime::Controllers::TouchHandler& touchHandler, + Pinetime::Controllers::ButtonHandler& buttonHandler) : spi {spi}, lcd {lcd}, spiNorFlash {spiNorFlash}, @@ -101,8 +101,15 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, heartRateApp(heartRateApp), fs {fs}, touchHandler {touchHandler}, - nimbleController(*this, bleController, dateTimeController, notificationManager, - batteryController, spiNorFlash, heartRateController, motionController) { + buttonHandler {buttonHandler}, + nimbleController(*this, + bleController, + dateTimeController, + notificationManager, + batteryController, + spiNorFlash, + heartRateController, + motionController) { } void SystemTask::Start() { @@ -163,6 +170,8 @@ void SystemTask::Work() { heartRateSensor.Disable(); heartRateApp.Start(); + buttonHandler.Init(this); + // Button nrf_gpio_cfg_output(15); nrf_gpio_pin_set(15); @@ -326,9 +335,32 @@ void SystemTask::Work() { ReloadIdleTimer(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::TouchEvent); break; - case Messages::OnButtonEvent: - ReloadIdleTimer(); - displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonPushed); + case Messages::OnButtonPushed: + if (!isSleeping && !isGoingToSleep) { + displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonPushed); + } + break; + case Messages::OnButtonLongPressed: + if (!isSleeping) { + displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonLongPressed); + } + break; + case Messages::OnButtonLongerPressed: + if (!isSleeping) { + displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonLongerPressed); + } + break; + case Messages::OnButtonDoubleClicked: + if (!isSleeping) { + displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonDoubleClicked); + } + break; + case Messages::HandleButtonEvent: + if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) { + buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Release); + } else { + buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Press); + } break; case Messages::OnDisplayTaskSleeping: if (BootloaderVersion::IsValid()) { @@ -366,6 +398,9 @@ void SystemTask::Work() { case Messages::BatteryPercentageUpdated: nimbleController.NotifyBatteryLevel(batteryController.PercentRemaining()); break; + case Messages::ReloadIdleTimer: + ReloadIdleTimer(); + break; default: break; @@ -414,20 +449,6 @@ void SystemTask::UpdateMotion() { } } -void SystemTask::OnButtonPushed() { - if (isGoingToSleep) - return; - if (!isSleeping) { - NRF_LOG_INFO("[systemtask] Button pushed"); - PushMessage(Messages::OnButtonEvent); - } else { - if (!isWakingUp) { - NRF_LOG_INFO("[systemtask] Button pushed, waking up"); - GoToRunning(); - } - } -} - void SystemTask::GoToRunning() { if (isGoingToSleep or (not isSleeping) or isWakingUp) return; diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 879c1be..9967f75 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -20,6 +20,7 @@ #include "components/alarm/AlarmController.h" #include "components/fs/FS.h" #include "touchhandler/TouchHandler.h" +#include "buttonhandler/ButtonHandler.h" #ifdef PINETIME_IS_RECOVERY #include "displayapp/DisplayAppRecovery.h" @@ -45,6 +46,7 @@ namespace Pinetime { } namespace Controllers { class TouchHandler; + class ButtonHandler; } namespace System { class SystemTask { @@ -71,12 +73,12 @@ namespace Pinetime { Pinetime::Applications::DisplayApp& displayApp, Pinetime::Applications::HeartRateTask& heartRateApp, Pinetime::Controllers::FS& fs, - Pinetime::Controllers::TouchHandler& touchHandler); + Pinetime::Controllers::TouchHandler& touchHandler, + Pinetime::Controllers::ButtonHandler& buttonHandler); void Start(); void PushMessage(Messages msg); - void OnButtonPushed(); void OnTouchEvent(); void OnIdle(); @@ -123,6 +125,7 @@ namespace Pinetime { Pinetime::Applications::HeartRateTask& heartRateApp; Pinetime::Controllers::FS& fs; Pinetime::Controllers::TouchHandler& touchHandler; + Pinetime::Controllers::ButtonHandler& buttonHandler; Pinetime::Controllers::NimbleController nimbleController; static void Process(void* instance); -- cgit v0.10.2 From b19a2a760b74f27c8d3db262bf43437f722f74bd Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 25 Oct 2021 13:40:43 +0300 Subject: Use enum classes, remove old comment diff --git a/src/buttonhandler/ButtonHandler.cpp b/src/buttonhandler/ButtonHandler.cpp index 997409e..b6067d2 100644 --- a/src/buttonhandler/ButtonHandler.cpp +++ b/src/buttonhandler/ButtonHandler.cpp @@ -4,7 +4,7 @@ using namespace Pinetime::Controllers; void ButtonTimerCallback(TimerHandle_t xTimer) { auto* buttonHandler = static_cast(pvTimerGetTimerID(xTimer)); - buttonHandler->HandleEvent(ButtonHandler::Timer); + buttonHandler->HandleEvent(ButtonHandler::Events::Timer); } void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) { @@ -12,7 +12,7 @@ void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) { buttonTimer = xTimerCreate("buttonTimer", 0, pdFALSE, this, ButtonTimerCallback); } -void ButtonHandler::HandleEvent(events event) { +void ButtonHandler::HandleEvent(Events event) { static constexpr TickType_t doubleClickTime = pdMS_TO_TICKS(200); static constexpr TickType_t longPressTime = pdMS_TO_TICKS(400); static constexpr TickType_t longerPressTime = pdMS_TO_TICKS(2000); @@ -24,61 +24,61 @@ void ButtonHandler::HandleEvent(events event) { systemTask->PushMessage(System::Messages::ReloadIdleTimer); } - if (event == Press) { + if (event == Events::Press) { buttonPressed = true; - } else if (event == Release) { + } else if (event == Events::Release) { releaseTime = xTaskGetTickCount(); buttonPressed = false; } switch (state) { - case Idle: - if (event == Press) { + case States::Idle: + if (event == Events::Press) { xTimerChangePeriod(buttonTimer, doubleClickTime, 0); xTimerStart(buttonTimer, 0); - state = Pressed; + state = States::Pressed; } break; - case Pressed: - if (event == Press) { + case States::Pressed: + if (event == Events::Press) { if (xTaskGetTickCount() - releaseTime < doubleClickTime) { systemTask->PushMessage(System::Messages::OnButtonDoubleClicked); xTimerStop(buttonTimer, 0); - state = Idle; + state = States::Idle; } - } else if (event == Release) { + } else if (event == Events::Release) { xTimerChangePeriod(buttonTimer, doubleClickTime, 0); xTimerStart(buttonTimer, 0); - } else if (event == Timer) { + } else if (event == Events::Timer) { if (buttonPressed) { xTimerChangePeriod(buttonTimer, longPressTime - doubleClickTime, 0); xTimerStart(buttonTimer, 0); - state = Holding; + state = States::Holding; } else { systemTask->PushMessage(System::Messages::OnButtonPushed); - state = Idle; + state = States::Idle; } } break; - case Holding: - if (event == Release) { + case States::Holding: + if (event == Events::Release) { systemTask->PushMessage(System::Messages::OnButtonPushed); xTimerStop(buttonTimer, 0); - state = Idle; - } else if (event == Timer) { + state = States::Idle; + } else if (event == Events::Timer) { xTimerChangePeriod(buttonTimer, longerPressTime - longPressTime - doubleClickTime, 0); xTimerStart(buttonTimer, 0); systemTask->PushMessage(System::Messages::OnButtonLongPressed); - state = LongHeld; + state = States::LongHeld; } break; - case LongHeld: - if (event == Release) { + case States::LongHeld: + if (event == Events::Release) { xTimerStop(buttonTimer, 0); - state = Idle; - } else if (event == Timer) { + state = States::Idle; + } else if (event == Events::Timer) { systemTask->PushMessage(System::Messages::OnButtonLongerPressed); - state = Idle; + state = States::Idle; } break; } diff --git a/src/buttonhandler/ButtonHandler.h b/src/buttonhandler/ButtonHandler.h index 5d5b57e..b4c36bd 100644 --- a/src/buttonhandler/ButtonHandler.h +++ b/src/buttonhandler/ButtonHandler.h @@ -8,17 +8,17 @@ namespace Pinetime { namespace Controllers { class ButtonHandler { public: - enum events { Press, Release, Timer }; + enum class Events : uint8_t { Press, Release, Timer }; void Init(Pinetime::System::SystemTask* systemTask); - void HandleEvent(events event); + void HandleEvent(Events event); private: + enum class States : uint8_t { Idle, Pressed, Holding, LongHeld }; Pinetime::System::SystemTask* systemTask = nullptr; TickType_t releaseTime = 0; TimerHandle_t buttonTimer; bool buttonPressed = false; - enum states { Idle, Pressed, Holding, LongHeld }; - states state = Idle; + States state = States::Idle; }; } } diff --git a/src/main.cpp b/src/main.cpp index b942fd4..53f78ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -178,7 +178,6 @@ void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action xTimerStartFromISR(debounceChargeTimer, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } else if (pin == Pinetime::PinMap::Button) { - // This activates on button release as well due to bouncing xTimerStartFromISR(debounceTimer, &xHigherPriorityTaskWoken); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index b7db0b9..8a4f894 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -357,9 +357,9 @@ void SystemTask::Work() { break; case Messages::HandleButtonEvent: if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) { - buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Release); + buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Events::Release); } else { - buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Press); + buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Events::Press); } break; case Messages::OnDisplayTaskSleeping: -- cgit v0.10.2 From 351c60a13167c05dfdbb0516f84077a4cd6adeec Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 25 Oct 2021 16:57:29 +0300 Subject: Return button action instead of pushing messages diff --git a/src/buttonhandler/ButtonActions.h b/src/buttonhandler/ButtonActions.h new file mode 100644 index 0000000..21be441 --- /dev/null +++ b/src/buttonhandler/ButtonActions.h @@ -0,0 +1,7 @@ +#pragma once + +namespace Pinetime { + namespace Controllers { + enum class ButtonActions { None, Click, DoubleClick, LongPress, LongerPress }; + } +} diff --git a/src/buttonhandler/ButtonHandler.cpp b/src/buttonhandler/ButtonHandler.cpp index b6067d2..91e8bbd 100644 --- a/src/buttonhandler/ButtonHandler.cpp +++ b/src/buttonhandler/ButtonHandler.cpp @@ -3,27 +3,19 @@ using namespace Pinetime::Controllers; void ButtonTimerCallback(TimerHandle_t xTimer) { - auto* buttonHandler = static_cast(pvTimerGetTimerID(xTimer)); - buttonHandler->HandleEvent(ButtonHandler::Events::Timer); + auto* sysTask = static_cast(pvTimerGetTimerID(xTimer)); + sysTask->PushMessage(Pinetime::System::Messages::HandleButtonTimerEvent); } void ButtonHandler::Init(Pinetime::System::SystemTask* systemTask) { - this->systemTask = systemTask; - buttonTimer = xTimerCreate("buttonTimer", 0, pdFALSE, this, ButtonTimerCallback); + buttonTimer = xTimerCreate("buttonTimer", 0, pdFALSE, systemTask, ButtonTimerCallback); } -void ButtonHandler::HandleEvent(Events event) { +ButtonActions ButtonHandler::HandleEvent(Events event) { static constexpr TickType_t doubleClickTime = pdMS_TO_TICKS(200); static constexpr TickType_t longPressTime = pdMS_TO_TICKS(400); static constexpr TickType_t longerPressTime = pdMS_TO_TICKS(2000); - if (systemTask->IsSleeping()) { - // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping - systemTask->PushMessage(System::Messages::GoToRunning); - } else { - systemTask->PushMessage(System::Messages::ReloadIdleTimer); - } - if (event == Events::Press) { buttonPressed = true; } else if (event == Events::Release) { @@ -42,9 +34,9 @@ void ButtonHandler::HandleEvent(Events event) { case States::Pressed: if (event == Events::Press) { if (xTaskGetTickCount() - releaseTime < doubleClickTime) { - systemTask->PushMessage(System::Messages::OnButtonDoubleClicked); xTimerStop(buttonTimer, 0); state = States::Idle; + return ButtonActions::DoubleClick; } } else if (event == Events::Release) { xTimerChangePeriod(buttonTimer, doubleClickTime, 0); @@ -55,21 +47,21 @@ void ButtonHandler::HandleEvent(Events event) { xTimerStart(buttonTimer, 0); state = States::Holding; } else { - systemTask->PushMessage(System::Messages::OnButtonPushed); state = States::Idle; + return ButtonActions::Click; } } break; case States::Holding: if (event == Events::Release) { - systemTask->PushMessage(System::Messages::OnButtonPushed); xTimerStop(buttonTimer, 0); state = States::Idle; + return ButtonActions::Click; } else if (event == Events::Timer) { xTimerChangePeriod(buttonTimer, longerPressTime - longPressTime - doubleClickTime, 0); xTimerStart(buttonTimer, 0); - systemTask->PushMessage(System::Messages::OnButtonLongPressed); state = States::LongHeld; + return ButtonActions::LongPress; } break; case States::LongHeld: @@ -77,9 +69,10 @@ void ButtonHandler::HandleEvent(Events event) { xTimerStop(buttonTimer, 0); state = States::Idle; } else if (event == Events::Timer) { - systemTask->PushMessage(System::Messages::OnButtonLongerPressed); state = States::Idle; + return ButtonActions::LongerPress; } break; } + return ButtonActions::None; } diff --git a/src/buttonhandler/ButtonHandler.h b/src/buttonhandler/ButtonHandler.h index b4c36bd..44b20f1 100644 --- a/src/buttonhandler/ButtonHandler.h +++ b/src/buttonhandler/ButtonHandler.h @@ -1,5 +1,6 @@ #pragma once +#include "ButtonActions.h" #include "systemtask/SystemTask.h" #include #include @@ -10,11 +11,10 @@ namespace Pinetime { public: enum class Events : uint8_t { Press, Release, Timer }; void Init(Pinetime::System::SystemTask* systemTask); - void HandleEvent(Events event); + ButtonActions HandleEvent(Events event); private: enum class States : uint8_t { Idle, Pressed, Holding, LongHeld }; - Pinetime::System::SystemTask* systemTask = nullptr; TickType_t releaseTime = 0; TimerHandle_t buttonTimer; bool buttonPressed = false; diff --git a/src/systemtask/Messages.h b/src/systemtask/Messages.h index b0bdbf3..b714270 100644 --- a/src/systemtask/Messages.h +++ b/src/systemtask/Messages.h @@ -15,17 +15,13 @@ namespace Pinetime { BleFirmwareUpdateStarted, BleFirmwareUpdateFinished, OnTouchEvent, - OnButtonPushed, - OnButtonLongPressed, - OnButtonLongerPressed, - OnButtonDoubleClicked, HandleButtonEvent, + HandleButtonTimerEvent, OnDisplayTaskSleeping, EnableSleeping, DisableSleeping, OnNewDay, OnChargingEvent, - ReloadIdleTimer, SetOffAlarm, StopRinging, MeasureBatteryTimerExpired, diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 8a4f894..85cefb6 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -335,33 +335,25 @@ void SystemTask::Work() { ReloadIdleTimer(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::TouchEvent); break; - case Messages::OnButtonPushed: - if (!isSleeping && !isGoingToSleep) { - displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonPushed); - } - break; - case Messages::OnButtonLongPressed: - if (!isSleeping) { - displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonLongPressed); - } - break; - case Messages::OnButtonLongerPressed: - if (!isSleeping) { - displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonLongerPressed); - } - break; - case Messages::OnButtonDoubleClicked: - if (!isSleeping) { - displayApp.PushMessage(Pinetime::Applications::Display::Messages::ButtonDoubleClicked); + case Messages::HandleButtonEvent: { + // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping + if (IsSleeping()) { + GoToRunning(); + break; } - break; - case Messages::HandleButtonEvent: + + Controllers::ButtonActions action; if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) { - buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Events::Release); + action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release); } else { - buttonHandler.HandleEvent(Pinetime::Controllers::ButtonHandler::Events::Press); + action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press); } - break; + HandleButtonAction(action); + } break; + case Messages::HandleButtonTimerEvent: { + auto action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Timer); + HandleButtonAction(action); + } break; case Messages::OnDisplayTaskSleeping: if (BootloaderVersion::IsValid()) { // First versions of the bootloader do not expose their version and cannot initialize the SPI NOR FLASH @@ -398,9 +390,6 @@ void SystemTask::Work() { case Messages::BatteryPercentageUpdated: nimbleController.NotifyBatteryLevel(batteryController.PercentRemaining()); break; - case Messages::ReloadIdleTimer: - ReloadIdleTimer(); - break; default: break; @@ -449,6 +438,35 @@ void SystemTask::UpdateMotion() { } } +void SystemTask::HandleButtonAction(Controllers::ButtonActions action) { + if (IsSleeping()) { + return; + } + + ReloadIdleTimer(); + + using Actions = Controllers::ButtonActions; + + switch (action) { + case Actions::Click: + if (!isGoingToSleep) { + displayApp.PushMessage(Applications::Display::Messages::ButtonPushed); + } + break; + case Actions::DoubleClick: + displayApp.PushMessage(Applications::Display::Messages::ButtonDoubleClicked); + break; + case Actions::LongPress: + displayApp.PushMessage(Applications::Display::Messages::ButtonLongPressed); + break; + case Actions::LongerPress: + displayApp.PushMessage(Applications::Display::Messages::ButtonLongerPressed); + break; + default: + break; + } +} + void SystemTask::GoToRunning() { if (isGoingToSleep or (not isSleeping) or isWakingUp) return; diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 9967f75..d6045e9 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -21,6 +21,7 @@ #include "components/fs/FS.h" #include "touchhandler/TouchHandler.h" #include "buttonhandler/ButtonHandler.h" +#include "buttonhandler/ButtonActions.h" #ifdef PINETIME_IS_RECOVERY #include "displayapp/DisplayAppRecovery.h" @@ -138,6 +139,7 @@ namespace Pinetime { TimerHandle_t measureBatteryTimer; bool doNotGoToSleep = false; + void HandleButtonAction(Controllers::ButtonActions action); void GoToRunning(); void UpdateMotion(); bool stepCounterMustBeReset = false; -- cgit v0.10.2 From 887c409b135bb2f21f2fb5ae70a4d8831049d14d Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 25 Oct 2021 17:13:02 +0300 Subject: Only wake up on press. Fixes issue with longer press and sleep diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 85cefb6..51dbc3e 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -337,15 +337,14 @@ void SystemTask::Work() { break; case Messages::HandleButtonEvent: { // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping - if (IsSleeping()) { - GoToRunning(); - break; - } - Controllers::ButtonActions action; if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) { action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release); } else { + if (IsSleeping()) { + GoToRunning(); + break; + } action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press); } HandleButtonAction(action); -- cgit v0.10.2 From 60a717b1a2272e61dfc4d297998da1c7672a8316 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 25 Oct 2021 17:45:48 +0300 Subject: Make it so special actions can be input while sleeping, like in #480 diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 51dbc3e..0a3f995 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -336,16 +336,17 @@ void SystemTask::Work() { displayApp.PushMessage(Pinetime::Applications::Display::Messages::TouchEvent); break; case Messages::HandleButtonEvent: { - // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping Controllers::ButtonActions action; if (nrf_gpio_pin_read(Pinetime::PinMap::Button) == 0) { action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Release); } else { + action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press); + // This is for faster wakeup, sacrificing special longpress and doubleclick handling while sleeping if (IsSleeping()) { + fastWakeUpDone = true; GoToRunning(); break; } - action = buttonHandler.HandleEvent(Controllers::ButtonHandler::Events::Press); } HandleButtonAction(action); } break; @@ -448,7 +449,8 @@ void SystemTask::HandleButtonAction(Controllers::ButtonActions action) { switch (action) { case Actions::Click: - if (!isGoingToSleep) { + // If the first action after fast wakeup is a click, it should be ignored. + if (!fastWakeUpDone && !isGoingToSleep) { displayApp.PushMessage(Applications::Display::Messages::ButtonPushed); } break; @@ -462,8 +464,10 @@ void SystemTask::HandleButtonAction(Controllers::ButtonActions action) { displayApp.PushMessage(Applications::Display::Messages::ButtonLongerPressed); break; default: - break; + return; } + + fastWakeUpDone = false; } void SystemTask::GoToRunning() { diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index d6045e9..412878b 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -140,6 +140,8 @@ namespace Pinetime { bool doNotGoToSleep = false; void HandleButtonAction(Controllers::ButtonActions action); + bool fastWakeUpDone = false; + void GoToRunning(); void UpdateMotion(); bool stepCounterMustBeReset = false; -- cgit v0.10.2 From 456084499464e242faf36606edada10ab6056939 Mon Sep 17 00:00:00 2001 From: "James A. Jerkins" Date: Thu, 28 Oct 2021 20:38:59 -0500 Subject: Fix recovery firmware build diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 9f5fb13..7286815 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include "BootErrors.h" #include "TouchEvents.h" #include "Apps.h" #include "Messages.h" -- cgit v0.10.2 From 30520d262b8bae9868645462e196027389dce246 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 29 Oct 2021 13:10:34 +0300 Subject: Memory savings by replacing strings diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 343b72b..dd223b2 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -209,7 +209,7 @@ std::unique_ptr SystemInfo::CreateScreen4() { static constexpr uint8_t maxTaskCount = 9; TaskStatus_t tasksStatus[maxTaskCount]; - lv_obj_t* infoTask = lv_table_create(lv_scr_act(), NULL); + lv_obj_t* infoTask = lv_table_create(lv_scr_act(), nullptr); lv_table_set_col_cnt(infoTask, 4); lv_table_set_row_cnt(infoTask, maxTaskCount + 1); lv_obj_set_style_local_pad_all(infoTask, LV_TABLE_PART_CELL1, LV_STATE_DEFAULT, 0); @@ -227,35 +227,37 @@ std::unique_ptr SystemInfo::CreateScreen4() { auto nb = uxTaskGetSystemState(tasksStatus, maxTaskCount, nullptr); std::sort(tasksStatus, tasksStatus + nb, sortById); for (uint8_t i = 0; i < nb && i < maxTaskCount; i++) { + char buffer[7] = {0}; - lv_table_set_cell_value(infoTask, i + 1, 0, std::to_string(tasksStatus[i].xTaskNumber).c_str()); - char state[2] = {0}; + sprintf(buffer, "%lu", tasksStatus[i].xTaskNumber); + lv_table_set_cell_value(infoTask, i + 1, 0, buffer); switch (tasksStatus[i].eCurrentState) { case eReady: case eRunning: - state[0] = 'R'; + buffer[0] = 'R'; break; case eBlocked: - state[0] = 'B'; + buffer[0] = 'B'; break; case eSuspended: - state[0] = 'S'; + buffer[0] = 'S'; break; case eDeleted: - state[0] = 'D'; + buffer[0] = 'D'; break; default: - state[0] = 'I'; // Invalid + buffer[0] = 'I'; // Invalid break; } - lv_table_set_cell_value(infoTask, i + 1, 1, state); + buffer[1] = '\0'; + lv_table_set_cell_value(infoTask, i + 1, 1, buffer); lv_table_set_cell_value(infoTask, i + 1, 2, tasksStatus[i].pcTaskName); if (tasksStatus[i].usStackHighWaterMark < 20) { - std::string str1 = std::to_string(tasksStatus[i].usStackHighWaterMark) + " low"; - lv_table_set_cell_value(infoTask, i + 1, 3, str1.c_str()); + sprintf(buffer, "%d low", tasksStatus[i].usStackHighWaterMark); } else { - lv_table_set_cell_value(infoTask, i + 1, 3, std::to_string(tasksStatus[i].usStackHighWaterMark).c_str()); + sprintf(buffer, "%d", tasksStatus[i].usStackHighWaterMark); } + lv_table_set_cell_value(infoTask, i + 1, 3, buffer); } return std::make_unique(3, 5, app, infoTask); } diff --git a/src/displayapp/screens/Twos.cpp b/src/displayapp/screens/Twos.cpp index 4201d50..d12ef90 100644 --- a/src/displayapp/screens/Twos.cpp +++ b/src/displayapp/screens/Twos.cpp @@ -1,10 +1,10 @@ #include "Twos.h" -#include -#include -#include #include -#include +#include +#include +#include #include +#include using namespace Pinetime::Applications::Screens; @@ -265,7 +265,9 @@ void Twos::updateGridDisplay(Tile grid[][4]) { for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { if (grid[row][col].value) { - lv_table_set_cell_value(gridDisplay, row, col, (std::to_string(grid[row][col].value)).c_str()); + char buffer[7]; + sprintf(buffer, "%d", grid[row][col].value); + lv_table_set_cell_value(gridDisplay, row, col, buffer); } else { lv_table_set_cell_value(gridDisplay, row, col, ""); } -- cgit v0.10.2 From e9c7ab4cfc82172a07c19a0c4877b4afd11412f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sat, 6 Nov 2021 19:01:19 +0100 Subject: Add data validity check and retries in CST816S driver. See https://github.com/InfiniTimeOrg/InfiniTime/issues/763#issuecomment-962436976. diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 7fc8eca..46dd96d 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -32,6 +32,18 @@ bool Cst816S::Init() { twiMaster.Read(twiAddress, 0xa7, &dummy, 1); vTaskDelay(5); + static constexpr uint8_t maxRetries = 3; + bool isDeviceOk = false; + uint8_t retries = 0; + do { + isDeviceOk = CheckDeviceIds(); + retries++; + } while(!isDeviceOk && retries < maxRetries); + + if(!isDeviceOk) { + return false; + } + /* [2] EnConLR - Continuous operation can slide around [1] EnConUD - Slide up and down to enable continuous operation @@ -50,21 +62,7 @@ bool Cst816S::Init() { static constexpr uint8_t irqCtl = 0b01110000; twiMaster.Write(twiAddress, 0xFA, &irqCtl, 1); - // There's mixed information about which register contains which information - if (twiMaster.Read(twiAddress, 0xA7, &chipId, 1) == TwiMaster::ErrorCodes::TransactionFailed) { - chipId = 0xFF; - return false; - } - if (twiMaster.Read(twiAddress, 0xA8, &vendorId, 1) == TwiMaster::ErrorCodes::TransactionFailed) { - vendorId = 0xFF; - return false; - } - if (twiMaster.Read(twiAddress, 0xA9, &fwVersion, 1) == TwiMaster::ErrorCodes::TransactionFailed) { - fwVersion = 0xFF; - return false; - } - - return chipId == 0xb4 && vendorId == 0 && fwVersion == 1; + return true; } Cst816S::TouchInfos Cst816S::GetTouchInfo() { @@ -79,18 +77,33 @@ Cst816S::TouchInfos Cst816S::GetTouchInfo() { // This can only be 0 or 1 uint8_t nbTouchPoints = touchData[touchPointNumIndex] & 0x0f; - uint8_t xHigh = touchData[touchXHighIndex] & 0x0f; uint8_t xLow = touchData[touchXLowIndex]; - info.x = (xHigh << 8) | xLow; - + uint16_t x = (xHigh << 8) | xLow; uint8_t yHigh = touchData[touchYHighIndex] & 0x0f; uint8_t yLow = touchData[touchYLowIndex]; - info.y = (yHigh << 8) | yLow; + uint16_t y = (yHigh << 8) | yLow; + Gestures gesture = static_cast(touchData[gestureIndex]); + + // Validity check + if(x >= maxX || y >= maxY || + (gesture != Gestures::None && + gesture != Gestures::SlideDown && + gesture != Gestures::SlideUp && + gesture != Gestures::SlideLeft && + gesture != Gestures::SlideRight && + gesture != Gestures::SingleTap && + gesture != Gestures::DoubleTap && + gesture != Gestures::LongPress)) { + info.isValid = false; + return info; + } + info.x = x; + info.y = y; info.touching = (nbTouchPoints > 0); - info.gesture = static_cast(touchData[gestureIndex]); - + info.gesture = gesture; + info.isValid = true; return info; } @@ -108,3 +121,21 @@ void Cst816S::Wakeup() { Init(); NRF_LOG_INFO("[TOUCHPANEL] Wakeup"); } + +bool Cst816S::CheckDeviceIds() { + // There's mixed information about which register contains which information + if (twiMaster.Read(twiAddress, 0xA7, &chipId, 1) == TwiMaster::ErrorCodes::TransactionFailed) { + chipId = 0xFF; + return false; + } + if (twiMaster.Read(twiAddress, 0xA8, &vendorId, 1) == TwiMaster::ErrorCodes::TransactionFailed) { + vendorId = 0xFF; + return false; + } + if (twiMaster.Read(twiAddress, 0xA9, &fwVersion, 1) == TwiMaster::ErrorCodes::TransactionFailed) { + fwVersion = 0xFF; + return false; + } + + return chipId == 0xb4 && vendorId == 0 && fwVersion == 1; +} diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h index 0fec841..507dd4f 100644 --- a/src/drivers/Cst816s.h +++ b/src/drivers/Cst816s.h @@ -21,7 +21,7 @@ namespace Pinetime { uint16_t y = 0; Gestures gesture = Gestures::None; bool touching = false; - bool isValid = true; + bool isValid = false; }; Cst816S(TwiMaster& twiMaster, uint8_t twiAddress); @@ -45,6 +45,8 @@ namespace Pinetime { return fwVersion; } private: + bool CheckDeviceIds(); + // Unused/Unavailable commented out static constexpr uint8_t gestureIndex = 1; static constexpr uint8_t touchPointNumIndex = 2; @@ -58,6 +60,9 @@ namespace Pinetime { //static constexpr uint8_t touchXYIndex = 7; //static constexpr uint8_t touchMiscIndex = 8; + static constexpr uint8_t maxX = 240; + static constexpr uint8_t maxY = 240; + TwiMaster& twiMaster; uint8_t twiAddress; -- cgit v0.10.2 From 8d61419836bffa7c59cb41c33fe747bafe841af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 7 Nov 2021 16:19:06 +0100 Subject: Fix formatting following the code review. diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 46dd96d..4aac19f 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -33,14 +33,14 @@ bool Cst816S::Init() { vTaskDelay(5); static constexpr uint8_t maxRetries = 3; - bool isDeviceOk = false; + bool isDeviceOk; uint8_t retries = 0; do { isDeviceOk = CheckDeviceIds(); retries++; - } while(!isDeviceOk && retries < maxRetries); + } while (!isDeviceOk && retries < maxRetries); - if(!isDeviceOk) { + if (!isDeviceOk) { return false; } -- cgit v0.10.2 From e6edf2155296864114a62cecbd0244c65c020a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 7 Nov 2021 18:00:34 +0100 Subject: Disable the warning that is displayed when the initialization of the touch controller fails, as some users reported that it was displayed when a valid touch controller was installed. diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 0a3f995..f2cc1df 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -144,9 +144,14 @@ void SystemTask::Work() { lcd.Init(); twiMaster.Init(); + /* + * TODO We disable this warning message until we ensure it won't be displayed + * on legitimate PineTime equipped with a compatible touch controller. + * (some users reported false positive). See https://github.com/InfiniTimeOrg/InfiniTime/issues/763 if (!touchPanel.Init()) { bootError = BootErrors::TouchController; } + */ dateTimeController.Register(this); batteryController.Register(this); motorController.Init(); -- cgit v0.10.2 From 76c43ebc82eb1d6580a10f292c83b0b18da135e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 7 Nov 2021 20:13:22 +0100 Subject: Fix previous commit, call touchPanel.Init() even if we disabled the touch controller boot error. diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index f2cc1df..4b03f9a 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -152,6 +152,7 @@ void SystemTask::Work() { bootError = BootErrors::TouchController; } */ + touchPanel.Init(); dateTimeController.Register(this); batteryController.Register(this); motorController.Init(); -- cgit v0.10.2 From 1d6455c28943efc0e51a91e6e7daa9045a372e50 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Tue, 9 Nov 2021 11:38:19 +0200 Subject: Fix Alarm app crashing on buttonpress diff --git a/src/displayapp/screens/Alarm.h b/src/displayapp/screens/Alarm.h index 32a14d2..487ba1d 100644 --- a/src/displayapp/screens/Alarm.h +++ b/src/displayapp/screens/Alarm.h @@ -40,7 +40,9 @@ namespace Pinetime { Controllers::AlarmController& alarmController; lv_obj_t *time, *btnEnable, *txtEnable, *btnMinutesUp, *btnMinutesDown, *btnHoursUp, *btnHoursDown, *txtMinUp, *txtMinDown, - *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnMessage, *txtMessage, *btnInfo, *txtInfo; + *txtHrUp, *txtHrDown, *btnRecur, *txtRecur, *btnInfo, *txtInfo; + lv_obj_t* txtMessage = nullptr; + lv_obj_t* btnMessage = nullptr; enum class EnableButtonState { On, Off, Alerting }; void SetEnableButtonState(); -- cgit v0.10.2 From bdf7e5293f2fe9eb061940dc841d2b6e4dbe13b2 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 10 Nov 2021 13:45:49 +0200 Subject: Fix animation when long pressing on screens adjacent to watch face diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 13ee004..63afec1 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -262,7 +262,13 @@ void DisplayApp::Refresh() { break; case Messages::ButtonLongPressed: if (currentApp != Apps::Clock) { - LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Down); + if (currentApp == Apps::Notifications) { + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Up); + } else if (currentApp == Apps::QuickSettings) { + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::LeftAnim); + } else { + LoadApp(Apps::Clock, DisplayApp::FullRefreshDirections::Down); + } } break; case Messages::ButtonLongerPressed: -- cgit v0.10.2 From a57fda6ba4a29866083a1254ffdf92939d00e182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Thu, 11 Nov 2021 09:54:30 +0100 Subject: Set version to 1.7.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index a8ecb81..63257ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(pinetime VERSION 1.6.0 LANGUAGES C CXX ASM) +project(pinetime VERSION 1.7.0 LANGUAGES C CXX ASM) set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 14) -- cgit v0.10.2 From 71a64974c0783b425efefd091ab7127c42c8724a Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 13 Nov 2021 13:37:52 +0200 Subject: Remove some clang-tidy checks diff --git a/.clang-tidy b/.clang-tidy index df52357..88ca6c5 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,6 +1,7 @@ Checks: '*, -altera-unroll-loops, -llvmlibc-callee-namespace, + -llvmlibc-implementation-in-namespace, -llvmlibc-restrict-system-libc-headers, -llvm-header-guard, -llvm-namespace-comment, @@ -8,6 +9,7 @@ Checks: '*, -google-runtime-int, -google-readability-namespace-comments, -fuchsia-statically-constructed-objects, + -cppcoreguidelines-prefer-member-initializer, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-type-static-cast-downcast, -- cgit v0.10.2 From 9671a8451fc0bc49fcd06521906d8be53959a74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sun, 14 Nov 2021 20:32:25 +0100 Subject: Fix unresponsive touch panel after update to 1.7 : don't care if device ids are not the ones we expected (until we know more about these communication and IDs issues). diff --git a/CMakeLists.txt b/CMakeLists.txt index 63257ff..b588066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(pinetime VERSION 1.7.0 LANGUAGES C CXX ASM) +project(pinetime VERSION 1.7.1 LANGUAGES C CXX ASM) set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 14) diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 4aac19f..bf51a8b 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -32,17 +32,11 @@ bool Cst816S::Init() { twiMaster.Read(twiAddress, 0xa7, &dummy, 1); vTaskDelay(5); - static constexpr uint8_t maxRetries = 3; - bool isDeviceOk; - uint8_t retries = 0; - do { - isDeviceOk = CheckDeviceIds(); - retries++; - } while (!isDeviceOk && retries < maxRetries); - - if (!isDeviceOk) { - return false; - } + // TODO This function check that the device IDs from the controller are equal to the ones + // we expect. However, it seems to return false positive (probably in case of communication issue). + // Also, it seems that some users have pinetimes that works correctly but that report different device IDs + // Until we know more about this, we'll just read the IDs but not take any action in case they are not 'valid' + CheckDeviceIds(); /* [2] EnConLR - Continuous operation can slide around -- cgit v0.10.2 From a631fa351858f722f8c4ba7992901722acf3f0c9 Mon Sep 17 00:00:00 2001 From: mabuch Date: Mon, 15 Nov 2021 20:41:32 +0100 Subject: fix Motion Service UUID in doc and code comments diff --git a/doc/MotionService.md b/doc/MotionService.md index 0d0a551..7cec3fb 100644 --- a/doc/MotionService.md +++ b/doc/MotionService.md @@ -3,13 +3,13 @@ The motion service exposes step count and raw X/Y/Z motion value as READ and NOTIFY characteristics. ## Service -The service UUID is **00020000-78fc-48fe-8e23-433b3a1942d0** +The service UUID is **00030000-78fc-48fe-8e23-433b3a1942d0** ## Characteristics -### Step count (UUID 00020001-78fc-48fe-8e23-433b3a1942d0) +### Step count (UUID 00030001-78fc-48fe-8e23-433b3a1942d0) The current number of steps represented as a single `uint32_t` (4 bytes) value. -### Raw motion values (UUID 00020002-78fc-48fe-8e23-433b3a1942d0) +### Raw motion values (UUID 00030002-78fc-48fe-8e23-433b3a1942d0) The current raw motion values. This is a 3 `int16_t` array: - [0] : X diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index b4786ab..284c60d 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -5,7 +5,7 @@ using namespace Pinetime::Controllers; namespace { - // 0002yyxx-78fc-48fe-8e23-433b3a1942d0 + // 0003yyxx-78fc-48fe-8e23-433b3a1942d0 constexpr ble_uuid128_t CharUuid(uint8_t x, uint8_t y) { return ble_uuid128_t{ .u = {.type = BLE_UUID_TYPE_128}, @@ -13,7 +13,7 @@ namespace { }; } - // 00020000-78fc-48fe-8e23-433b3a1942d0 + // 00030000-78fc-48fe-8e23-433b3a1942d0 constexpr ble_uuid128_t BaseUuid() { return CharUuid(0x00, 0x00); } -- cgit v0.10.2 From c4f2fb2fa478ccd404afc0220e3e8cfe127e58e7 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Mon, 15 Nov 2021 21:09:59 +0100 Subject: BatteryInfo: remove unused FreeRTOS.h and timer.h includes diff --git a/src/displayapp/screens/BatteryInfo.h b/src/displayapp/screens/BatteryInfo.h index 63454a2..aaa741c 100644 --- a/src/displayapp/screens/BatteryInfo.h +++ b/src/displayapp/screens/BatteryInfo.h @@ -1,8 +1,6 @@ #pragma once #include -#include -#include #include "Screen.h" #include -- cgit v0.10.2 From ac7b2da611fa5ef4cc989a9feb027f66c0ebfc6c Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 13 Oct 2021 22:08:35 +0200 Subject: Update includes to to be relative to src directory Don't use relative imports like `../foo.h` as those depend on the relative position of both files. Rather than that use imports relative to the `src` directory, which explicitly is part of the include directories. diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index 67ca05a..28b328d 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "AlarmController.h" +#include "components/alarm/AlarmController.h" #include "systemtask/SystemTask.h" #include "app_timer.h" #include "task.h" diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index e807f03..c875cb8 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -1,4 +1,4 @@ -#include "BatteryController.h" +#include "components/battery/BatteryController.h" #include "drivers/PinMap.h" #include #include diff --git a/src/components/ble/AlertNotificationClient.cpp b/src/components/ble/AlertNotificationClient.cpp index 5e5c25c..0f85087 100644 --- a/src/components/ble/AlertNotificationClient.cpp +++ b/src/components/ble/AlertNotificationClient.cpp @@ -1,6 +1,6 @@ -#include "AlertNotificationClient.h" +#include "components/ble/AlertNotificationClient.h" #include -#include "NotificationManager.h" +#include "components/ble/NotificationManager.h" #include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/AlertNotificationClient.h b/src/components/ble/AlertNotificationClient.h index dfba814..2d6a387 100644 --- a/src/components/ble/AlertNotificationClient.h +++ b/src/components/ble/AlertNotificationClient.h @@ -7,7 +7,7 @@ #include #undef max #undef min -#include "BleClient.h" +#include "components/ble/BleClient.h" namespace Pinetime { diff --git a/src/components/ble/AlertNotificationService.cpp b/src/components/ble/AlertNotificationService.cpp index 56fc595..f616cce 100644 --- a/src/components/ble/AlertNotificationService.cpp +++ b/src/components/ble/AlertNotificationService.cpp @@ -1,8 +1,8 @@ -#include "AlertNotificationService.h" +#include "components/ble/AlertNotificationService.h" #include #include #include -#include "NotificationManager.h" +#include "components/ble/NotificationManager.h" #include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp index 2917866..b95a88d 100644 --- a/src/components/ble/BatteryInformationService.cpp +++ b/src/components/ble/BatteryInformationService.cpp @@ -1,5 +1,5 @@ #include -#include "BatteryInformationService.h" +#include "components/ble/BatteryInformationService.h" #include "components/battery/BatteryController.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp index 7c14aeb..a80c971 100644 --- a/src/components/ble/BleController.cpp +++ b/src/components/ble/BleController.cpp @@ -1,4 +1,4 @@ -#include "BleController.h" +#include "components/ble/BleController.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/CurrentTimeClient.cpp b/src/components/ble/CurrentTimeClient.cpp index 90d1f0c..dd8171b 100644 --- a/src/components/ble/CurrentTimeClient.cpp +++ b/src/components/ble/CurrentTimeClient.cpp @@ -1,4 +1,4 @@ -#include "CurrentTimeClient.h" +#include "components/ble/CurrentTimeClient.h" #include #include #include "components/datetime/DateTimeController.h" diff --git a/src/components/ble/CurrentTimeClient.h b/src/components/ble/CurrentTimeClient.h index 6424c03..9e48be7 100644 --- a/src/components/ble/CurrentTimeClient.h +++ b/src/components/ble/CurrentTimeClient.h @@ -5,7 +5,7 @@ #undef max #undef min #include -#include "BleClient.h" +#include "components/ble/BleClient.h" namespace Pinetime { namespace Controllers { diff --git a/src/components/ble/CurrentTimeService.cpp b/src/components/ble/CurrentTimeService.cpp index eefb7ec..e509aea 100644 --- a/src/components/ble/CurrentTimeService.cpp +++ b/src/components/ble/CurrentTimeService.cpp @@ -1,4 +1,4 @@ -#include "CurrentTimeService.h" +#include "components/ble/CurrentTimeService.h" #include #include diff --git a/src/components/ble/DeviceInformationService.cpp b/src/components/ble/DeviceInformationService.cpp index 778d6e3..0f47c90 100644 --- a/src/components/ble/DeviceInformationService.cpp +++ b/src/components/ble/DeviceInformationService.cpp @@ -1,4 +1,4 @@ -#include "DeviceInformationService.h" +#include "components/ble/DeviceInformationService.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/DfuService.cpp b/src/components/ble/DfuService.cpp index 3d6416f..71dcc7e 100644 --- a/src/components/ble/DfuService.cpp +++ b/src/components/ble/DfuService.cpp @@ -1,4 +1,4 @@ -#include "DfuService.h" +#include "components/ble/DfuService.h" #include #include "components/ble/BleController.h" #include "drivers/SpiNorFlash.h" diff --git a/src/components/ble/HeartRateService.cpp b/src/components/ble/HeartRateService.cpp index 75a038a..f178af7 100644 --- a/src/components/ble/HeartRateService.cpp +++ b/src/components/ble/HeartRateService.cpp @@ -1,4 +1,4 @@ -#include "HeartRateService.h" +#include "components/ble/HeartRateService.h" #include "components/heartrate/HeartRateController.h" #include "systemtask/SystemTask.h" diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp index 17ed1a9..c80b378 100644 --- a/src/components/ble/ImmediateAlertService.cpp +++ b/src/components/ble/ImmediateAlertService.cpp @@ -1,6 +1,6 @@ -#include "ImmediateAlertService.h" +#include "components/ble/ImmediateAlertService.h" #include -#include "NotificationManager.h" +#include "components/ble/NotificationManager.h" #include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/MotionService.cpp b/src/components/ble/MotionService.cpp index b4786ab..0146ae8 100644 --- a/src/components/ble/MotionService.cpp +++ b/src/components/ble/MotionService.cpp @@ -1,4 +1,4 @@ -#include "MotionService.h" +#include "components/ble/MotionService.h" #include "components/motion//MotionController.h" #include "systemtask/SystemTask.h" diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp index 74fe952..3457ce4 100644 --- a/src/components/ble/MusicService.cpp +++ b/src/components/ble/MusicService.cpp @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "MusicService.h" +#include "components/ble/MusicService.h" #include "systemtask/SystemTask.h" namespace { diff --git a/src/components/ble/NavigationService.cpp b/src/components/ble/NavigationService.cpp index b49148d..5418b9e 100644 --- a/src/components/ble/NavigationService.cpp +++ b/src/components/ble/NavigationService.cpp @@ -16,7 +16,7 @@ along with this program. If not, see . */ -#include "NavigationService.h" +#include "components/ble/NavigationService.h" #include "systemtask/SystemTask.h" diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index 1bcae1b..43a8b0d 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -1,4 +1,4 @@ -#include "NimbleController.h" +#include "components/ble/NimbleController.h" #include #define min // workaround: nimble's min/max macros conflict with libstdc++ #define max diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 76f89ba..895b87f 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -7,19 +7,19 @@ #include #undef max #undef min -#include "AlertNotificationClient.h" -#include "AlertNotificationService.h" -#include "BatteryInformationService.h" -#include "CurrentTimeClient.h" -#include "CurrentTimeService.h" -#include "DeviceInformationService.h" -#include "DfuService.h" -#include "ImmediateAlertService.h" -#include "MusicService.h" -#include "NavigationService.h" -#include "ServiceDiscovery.h" -#include "HeartRateService.h" -#include "MotionService.h" +#include "components/ble/AlertNotificationClient.h" +#include "components/ble/AlertNotificationService.h" +#include "components/ble/BatteryInformationService.h" +#include "components/ble/CurrentTimeClient.h" +#include "components/ble/CurrentTimeService.h" +#include "components/ble/DeviceInformationService.h" +#include "components/ble/DfuService.h" +#include "components/ble/ImmediateAlertService.h" +#include "components/ble/MusicService.h" +#include "components/ble/NavigationService.h" +#include "components/ble/ServiceDiscovery.h" +#include "components/ble/HeartRateService.h" +#include "components/ble/MotionService.h" namespace Pinetime { namespace Drivers { diff --git a/src/components/ble/NotificationManager.cpp b/src/components/ble/NotificationManager.cpp index 7ffed30..ec99c4e 100644 --- a/src/components/ble/NotificationManager.cpp +++ b/src/components/ble/NotificationManager.cpp @@ -1,4 +1,4 @@ -#include "NotificationManager.h" +#include "components/ble/NotificationManager.h" #include #include diff --git a/src/components/ble/ServiceDiscovery.cpp b/src/components/ble/ServiceDiscovery.cpp index b36b241..03bcfeb 100644 --- a/src/components/ble/ServiceDiscovery.cpp +++ b/src/components/ble/ServiceDiscovery.cpp @@ -1,6 +1,6 @@ -#include "ServiceDiscovery.h" +#include "components/ble/ServiceDiscovery.h" #include -#include "BleClient.h" +#include "components/ble/BleClient.h" using namespace Pinetime::Controllers; diff --git a/src/components/brightness/BrightnessController.cpp b/src/components/brightness/BrightnessController.cpp index 6c52467..2d9f980 100644 --- a/src/components/brightness/BrightnessController.cpp +++ b/src/components/brightness/BrightnessController.cpp @@ -1,4 +1,4 @@ -#include "BrightnessController.h" +#include "components/brightness/BrightnessController.h" #include #include "displayapp/screens/Symbols.h" #include "drivers/PinMap.h" diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index e9c5d87..4ac9e1f 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -1,4 +1,4 @@ -#include "DateTimeController.h" +#include "components/datetime/DateTimeController.h" #include #include #include diff --git a/src/components/firmwarevalidator/FirmwareValidator.cpp b/src/components/firmwarevalidator/FirmwareValidator.cpp index 68e66d3..5a63b6b 100644 --- a/src/components/firmwarevalidator/FirmwareValidator.cpp +++ b/src/components/firmwarevalidator/FirmwareValidator.cpp @@ -1,4 +1,4 @@ -#include "FirmwareValidator.h" +#include "components/firmwarevalidator/FirmwareValidator.h" #include #include "drivers/InternalFlash.h" diff --git a/src/components/fs/FS.cpp b/src/components/fs/FS.cpp index 857e6bf..1cad4f0 100644 --- a/src/components/fs/FS.cpp +++ b/src/components/fs/FS.cpp @@ -1,4 +1,4 @@ -#include "FS.h" +#include "components/fs/FS.h" #include #include #include diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index cf27103..3eaaa3f 100644 --- a/src/components/gfx/Gfx.cpp +++ b/src/components/gfx/Gfx.cpp @@ -1,4 +1,4 @@ -#include "Gfx.h" +#include "components/gfx/Gfx.h" #include "drivers/St7789.h" using namespace Pinetime::Components; diff --git a/src/components/heartrate/Biquad.cpp b/src/components/heartrate/Biquad.cpp index 0341eda..b7edd40 100644 --- a/src/components/heartrate/Biquad.cpp +++ b/src/components/heartrate/Biquad.cpp @@ -4,7 +4,7 @@ C++ port Copyright (C) 2021 Jean-François Milants */ -#include "Biquad.h" +#include "components/heartrate/Biquad.h" using namespace Pinetime::Controllers; diff --git a/src/components/heartrate/HeartRateController.cpp b/src/components/heartrate/HeartRateController.cpp index 716813b..e0d6927 100644 --- a/src/components/heartrate/HeartRateController.cpp +++ b/src/components/heartrate/HeartRateController.cpp @@ -1,4 +1,4 @@ -#include "HeartRateController.h" +#include "components/heartrate/HeartRateController.h" #include #include diff --git a/src/components/heartrate/Ppg.cpp b/src/components/heartrate/Ppg.cpp index fcba381..c247d1f 100644 --- a/src/components/heartrate/Ppg.cpp +++ b/src/components/heartrate/Ppg.cpp @@ -6,7 +6,7 @@ #include #include -#include "Ppg.h" +#include "components/heartrate/Ppg.h" using namespace Pinetime::Controllers; /** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ diff --git a/src/components/heartrate/Ppg.h b/src/components/heartrate/Ppg.h index 0001416..ed79b08 100644 --- a/src/components/heartrate/Ppg.h +++ b/src/components/heartrate/Ppg.h @@ -1,8 +1,8 @@ #pragma once #include -#include "Biquad.h" -#include "Ptagc.h" +#include "components/heartrate/Biquad.h" +#include "components/heartrate/Ptagc.h" namespace Pinetime { namespace Controllers { diff --git a/src/components/heartrate/Ptagc.cpp b/src/components/heartrate/Ptagc.cpp index e358371..db496a1 100644 --- a/src/components/heartrate/Ptagc.cpp +++ b/src/components/heartrate/Ptagc.cpp @@ -5,7 +5,7 @@ */ #include -#include "Ptagc.h" +#include "components/heartrate/Ptagc.h" using namespace Pinetime::Controllers; diff --git a/src/components/motion/MotionController.cpp b/src/components/motion/MotionController.cpp index a2384d7..cae4910 100644 --- a/src/components/motion/MotionController.cpp +++ b/src/components/motion/MotionController.cpp @@ -1,4 +1,4 @@ -#include "MotionController.h" +#include "components/motion/MotionController.h" using namespace Pinetime::Controllers; diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index f596c71..c794a02 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -1,4 +1,4 @@ -#include "MotorController.h" +#include "components/motor/MotorController.h" #include #include "systemtask/SystemTask.h" #include "app_timer.h" diff --git a/src/components/rle/RleDecoder.cpp b/src/components/rle/RleDecoder.cpp index df2bcb6..19ebfec 100644 --- a/src/components/rle/RleDecoder.cpp +++ b/src/components/rle/RleDecoder.cpp @@ -1,4 +1,4 @@ -#include "RleDecoder.h" +#include "components/rle/RleDecoder.h" using namespace Pinetime::Tools; diff --git a/src/components/settings/Settings.cpp b/src/components/settings/Settings.cpp index 37c09f9..ef73ad1 100644 --- a/src/components/settings/Settings.cpp +++ b/src/components/settings/Settings.cpp @@ -1,4 +1,4 @@ -#include "Settings.h" +#include "components/settings/Settings.h" #include #include diff --git a/src/components/timer/TimerController.cpp b/src/components/timer/TimerController.cpp index 8d5f5c3..79e44d6 100644 --- a/src/components/timer/TimerController.cpp +++ b/src/components/timer/TimerController.cpp @@ -2,7 +2,7 @@ // Created by florian on 16.05.21. // -#include "TimerController.h" +#include "components/timer/TimerController.h" #include "systemtask/SystemTask.h" #include "app_timer.h" #include "task.h" diff --git a/src/displayapp/Colors.cpp b/src/displayapp/Colors.cpp index f45f072..93b1aa0 100644 --- a/src/displayapp/Colors.cpp +++ b/src/displayapp/Colors.cpp @@ -1,4 +1,4 @@ -#include "Colors.h" +#include "displayapp/Colors.h" using namespace Pinetime::Applications; using namespace Pinetime::Controllers; diff --git a/src/displayapp/Colors.h b/src/displayapp/Colors.h index 9db7dd2..43e2b80 100644 --- a/src/displayapp/Colors.h +++ b/src/displayapp/Colors.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include "components/settings/Settings.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 13ee004..f4d0ce4 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -1,9 +1,9 @@ -#include "DisplayApp.h" +#include "displayapp/DisplayApp.h" #include -#include -#include -#include -#include +#include "displayapp/screens/HeartRate.h" +#include "displayapp/screens/Motion.h" +#include "displayapp/screens/Timer.h" +#include "displayapp/screens/Alarm.h" #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" #include "components/datetime/DateTimeController.h" diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index a87cab0..39fe631 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -5,9 +5,9 @@ #include #include #include -#include "Apps.h" -#include "LittleVgl.h" -#include "TouchEvents.h" +#include "displayapp/Apps.h" +#include "displayapp/LittleVgl.h" +#include "displayapp/TouchEvents.h" #include "components/brightness/BrightnessController.h" #include "components/motor/MotorController.h" #include "components/firmwarevalidator/FirmwareValidator.h" @@ -17,7 +17,7 @@ #include "components/alarm/AlarmController.h" #include "touchhandler/TouchHandler.h" -#include "Messages.h" +#include "displayapp/Messages.h" #include "BootErrors.h" namespace Pinetime { diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index a42d81a..fd7017a 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -1,9 +1,9 @@ -#include "DisplayAppRecovery.h" +#include "displayapp/DisplayAppRecovery.h" #include #include #include -#include -#include +#include "components/rle/RleDecoder.h" +#include "touchhandler/TouchHandler.h" #include "displayapp/icons/infinitime/infinitime-nb.c" #include "components/ble/BleController.h" diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 7286815..86e956d 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -11,10 +11,10 @@ #include #include #include "BootErrors.h" -#include "TouchEvents.h" -#include "Apps.h" -#include "Messages.h" -#include "DummyLittleVgl.h" +#include "displayapp/TouchEvents.h" +#include "displayapp/Apps.h" +#include "displayapp/Messages.h" +#include "displayapp/DummyLittleVgl.h" namespace Pinetime { namespace Drivers { diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index 2bd5e57..e7b58c1 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -1,5 +1,5 @@ -#include "LittleVgl.h" -#include "lv_pinetime_theme.h" +#include "displayapp/LittleVgl.h" +#include "displayapp/lv_pinetime_theme.h" #include #include diff --git a/src/displayapp/lv_pinetime_theme.c b/src/displayapp/lv_pinetime_theme.c index 1b8b198..1780e64 100644 --- a/src/displayapp/lv_pinetime_theme.c +++ b/src/displayapp/lv_pinetime_theme.c @@ -6,7 +6,7 @@ /********************* * INCLUDES *********************/ -#include "lv_pinetime_theme.h" +#include "displayapp/lv_pinetime_theme.h" /********************* * DEFINES diff --git a/src/displayapp/screens/Alarm.cpp b/src/displayapp/screens/Alarm.cpp index 6b45a36..772e5d4 100644 --- a/src/displayapp/screens/Alarm.cpp +++ b/src/displayapp/screens/Alarm.cpp @@ -15,9 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Alarm.h" -#include "Screen.h" -#include "Symbols.h" +#include "displayapp/screens/Alarm.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; using Pinetime::Controllers::AlarmController; diff --git a/src/displayapp/screens/Alarm.h b/src/displayapp/screens/Alarm.h index 487ba1d..4b301ce 100644 --- a/src/displayapp/screens/Alarm.h +++ b/src/displayapp/screens/Alarm.h @@ -17,9 +17,9 @@ */ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "systemtask/SystemTask.h" -#include "../LittleVgl.h" +#include "displayapp/LittleVgl.h" #include "components/alarm/AlarmController.h" namespace Pinetime { diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 5c582f6..29c8aff 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -1,10 +1,10 @@ -#include "ApplicationList.h" +#include "displayapp/screens/ApplicationList.h" #include #include -#include "Symbols.h" -#include "Tile.h" +#include "displayapp/screens/Symbols.h" +#include "displayapp/screens/Tile.h" #include "displayapp/Apps.h" -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index 103c38a..f430a89 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -2,8 +2,8 @@ #include -#include "Screen.h" -#include "ScreenList.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/ScreenList.h" #include "components/datetime/DateTimeController.h" #include "components/settings/Settings.h" #include "components/battery/BatteryController.h" diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index c67bcb2..114b08f 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -1,6 +1,6 @@ #include -#include "BatteryIcon.h" -#include "Symbols.h" +#include "displayapp/screens/BatteryIcon.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/BatteryInfo.cpp b/src/displayapp/screens/BatteryInfo.cpp index 44ea7f5..e17de9a 100644 --- a/src/displayapp/screens/BatteryInfo.cpp +++ b/src/displayapp/screens/BatteryInfo.cpp @@ -1,5 +1,5 @@ -#include "BatteryInfo.h" -#include "../DisplayApp.h" +#include "displayapp/screens/BatteryInfo.h" +#include "displayapp/DisplayApp.h" #include "components/battery/BatteryController.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/BatteryInfo.h b/src/displayapp/screens/BatteryInfo.h index 63454a2..d7600af 100644 --- a/src/displayapp/screens/BatteryInfo.h +++ b/src/displayapp/screens/BatteryInfo.h @@ -3,7 +3,7 @@ #include #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/BleIcon.cpp b/src/displayapp/screens/BleIcon.cpp index da3d15e..5058f3e 100644 --- a/src/displayapp/screens/BleIcon.cpp +++ b/src/displayapp/screens/BleIcon.cpp @@ -1,5 +1,5 @@ -#include "BleIcon.h" -#include "Symbols.h" +#include "displayapp/screens/BleIcon.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; const char* BleIcon::GetIcon(bool isConnected) { diff --git a/src/displayapp/screens/Brightness.cpp b/src/displayapp/screens/Brightness.cpp index 1278cd6..d9901ae 100644 --- a/src/displayapp/screens/Brightness.cpp +++ b/src/displayapp/screens/Brightness.cpp @@ -1,4 +1,4 @@ -#include "Brightness.h" +#include "displayapp/screens/Brightness.h" #include using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Brightness.h b/src/displayapp/screens/Brightness.h index 14e4859..693570c 100644 --- a/src/displayapp/screens/Brightness.h +++ b/src/displayapp/screens/Brightness.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/brightness/BrightnessController.h" namespace Pinetime { diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 5a5cd18..71f01b9 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -1,4 +1,4 @@ -#include "Clock.h" +#include "displayapp/screens/Clock.h" #include #include @@ -6,10 +6,10 @@ #include "components/motion/MotionController.h" #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" -#include "../DisplayApp.h" -#include "WatchFaceDigital.h" -#include "WatchFaceAnalog.h" -#include "PineTimeStyle.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/WatchFaceDigital.h" +#include "displayapp/screens/WatchFaceAnalog.h" +#include "displayapp/screens/PineTimeStyle.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 648f72d..2fad1e2 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -5,7 +5,7 @@ #include #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" namespace Pinetime { diff --git a/src/displayapp/screens/DropDownDemo.cpp b/src/displayapp/screens/DropDownDemo.cpp index 9043c20..cf239a2 100644 --- a/src/displayapp/screens/DropDownDemo.cpp +++ b/src/displayapp/screens/DropDownDemo.cpp @@ -1,7 +1,7 @@ -#include "DropDownDemo.h" +#include "displayapp/screens/DropDownDemo.h" #include #include -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/DropDownDemo.h b/src/displayapp/screens/DropDownDemo.h index ff388c5..bcf0f45 100644 --- a/src/displayapp/screens/DropDownDemo.h +++ b/src/displayapp/screens/DropDownDemo.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/Error.cpp b/src/displayapp/screens/Error.cpp index 75946ab..1dbc344 100644 --- a/src/displayapp/screens/Error.cpp +++ b/src/displayapp/screens/Error.cpp @@ -1,4 +1,4 @@ -#include "Error.h" +#include "displayapp/screens/Error.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Error.h b/src/displayapp/screens/Error.h index 20dde7e..2316754 100644 --- a/src/displayapp/screens/Error.h +++ b/src/displayapp/screens/Error.h @@ -1,6 +1,6 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "BootErrors.h" #include diff --git a/src/displayapp/screens/FirmwareUpdate.cpp b/src/displayapp/screens/FirmwareUpdate.cpp index 79bda0b..373fcae 100644 --- a/src/displayapp/screens/FirmwareUpdate.cpp +++ b/src/displayapp/screens/FirmwareUpdate.cpp @@ -1,7 +1,7 @@ -#include "FirmwareUpdate.h" +#include "displayapp/screens/FirmwareUpdate.h" #include #include "components/ble/BleController.h" -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/FirmwareUpdate.h b/src/displayapp/screens/FirmwareUpdate.h index 8fc86d8..a61178c 100644 --- a/src/displayapp/screens/FirmwareUpdate.h +++ b/src/displayapp/screens/FirmwareUpdate.h @@ -1,6 +1,6 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include #include "FreeRTOS.h" diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp index eef8f91..ea41713 100644 --- a/src/displayapp/screens/FirmwareValidation.cpp +++ b/src/displayapp/screens/FirmwareValidation.cpp @@ -1,8 +1,8 @@ -#include "FirmwareValidation.h" +#include "displayapp/screens/FirmwareValidation.h" #include #include "Version.h" #include "components/firmwarevalidator/FirmwareValidator.h" -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/FirmwareValidation.h b/src/displayapp/screens/FirmwareValidation.h index bfdb096..278c4ad 100644 --- a/src/displayapp/screens/FirmwareValidation.h +++ b/src/displayapp/screens/FirmwareValidation.h @@ -1,6 +1,6 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/FlashLight.cpp b/src/displayapp/screens/FlashLight.cpp index dcb31a7..c4d0264 100644 --- a/src/displayapp/screens/FlashLight.cpp +++ b/src/displayapp/screens/FlashLight.cpp @@ -1,6 +1,6 @@ -#include "FlashLight.h" -#include "../DisplayApp.h" -#include "Symbols.h" +#include "displayapp/screens/FlashLight.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/FlashLight.h b/src/displayapp/screens/FlashLight.h index f2c65bb..e91a103 100644 --- a/src/displayapp/screens/FlashLight.h +++ b/src/displayapp/screens/FlashLight.h @@ -1,6 +1,6 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/brightness/BrightnessController.h" #include "systemtask/SystemTask.h" #include diff --git a/src/displayapp/screens/HeartRate.cpp b/src/displayapp/screens/HeartRate.cpp index b6ece27..65d1aa2 100644 --- a/src/displayapp/screens/HeartRate.cpp +++ b/src/displayapp/screens/HeartRate.cpp @@ -1,8 +1,8 @@ -#include -#include "HeartRate.h" +#include +#include "displayapp/screens/HeartRate.h" #include -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/HeartRate.h b/src/displayapp/screens/HeartRate.h index 7f7d3ad..d06415c 100644 --- a/src/displayapp/screens/HeartRate.h +++ b/src/displayapp/screens/HeartRate.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include #include "systemtask/SystemTask.h" #include diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp index 85a5e82..00d224e 100644 --- a/src/displayapp/screens/InfiniPaint.cpp +++ b/src/displayapp/screens/InfiniPaint.cpp @@ -1,6 +1,6 @@ -#include "InfiniPaint.h" -#include "../DisplayApp.h" -#include "../LittleVgl.h" +#include "displayapp/screens/InfiniPaint.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/LittleVgl.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h index 0a70e03..322ce75 100644 --- a/src/displayapp/screens/InfiniPaint.h +++ b/src/displayapp/screens/InfiniPaint.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" namespace Pinetime { namespace Components { diff --git a/src/displayapp/screens/Label.cpp b/src/displayapp/screens/Label.cpp index 1761a7b..62ec1f0 100644 --- a/src/displayapp/screens/Label.cpp +++ b/src/displayapp/screens/Label.cpp @@ -1,4 +1,4 @@ -#include "Label.h" +#include "displayapp/screens/Label.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Label.h b/src/displayapp/screens/Label.h index f1e4907..3fe5111 100644 --- a/src/displayapp/screens/Label.h +++ b/src/displayapp/screens/Label.h @@ -1,6 +1,6 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/List.cpp b/src/displayapp/screens/List.cpp index 064b47a..af3f30f 100644 --- a/src/displayapp/screens/List.cpp +++ b/src/displayapp/screens/List.cpp @@ -1,6 +1,6 @@ -#include "List.h" -#include "../DisplayApp.h" -#include "Symbols.h" +#include "displayapp/screens/List.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/List.h b/src/displayapp/screens/List.h index d9f61f2..023de3a 100644 --- a/src/displayapp/screens/List.h +++ b/src/displayapp/screens/List.h @@ -3,8 +3,8 @@ #include #include #include -#include "Screen.h" -#include "../Apps.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/Apps.h" #include "components/settings/Settings.h" #define MAXLISTITEMS 4 diff --git a/src/displayapp/screens/Meter.cpp b/src/displayapp/screens/Meter.cpp index 57cde9c..9c85310 100644 --- a/src/displayapp/screens/Meter.cpp +++ b/src/displayapp/screens/Meter.cpp @@ -1,6 +1,6 @@ -#include "Meter.h" +#include "displayapp/screens/Meter.h" #include -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Meter.h b/src/displayapp/screens/Meter.h index 9b3d1d4..50d9f83 100644 --- a/src/displayapp/screens/Meter.h +++ b/src/displayapp/screens/Meter.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include #include diff --git a/src/displayapp/screens/Metronome.cpp b/src/displayapp/screens/Metronome.cpp index 52cb851..8347e1b 100644 --- a/src/displayapp/screens/Metronome.cpp +++ b/src/displayapp/screens/Metronome.cpp @@ -1,5 +1,5 @@ -#include "Metronome.h" -#include "Symbols.h" +#include "displayapp/screens/Metronome.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp index 2f1f7c2..3641110 100644 --- a/src/displayapp/screens/Motion.cpp +++ b/src/displayapp/screens/Motion.cpp @@ -1,6 +1,6 @@ #include -#include "Motion.h" -#include "../DisplayApp.h" +#include "displayapp/screens/Motion.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Motion.h b/src/displayapp/screens/Motion.h index 20a18d0..f6202b5 100644 --- a/src/displayapp/screens/Motion.h +++ b/src/displayapp/screens/Motion.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include #include #include diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp index 47ddb65..8a01a6f 100644 --- a/src/displayapp/screens/Music.cpp +++ b/src/displayapp/screens/Music.cpp @@ -15,10 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Music.h" -#include "Symbols.h" +#include "displayapp/screens/Music.h" +#include "displayapp/screens/Symbols.h" #include -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" #include "components/ble/MusicService.h" #include "displayapp/icons/music/disc.cpp" #include "displayapp/icons/music/disc_f_1.cpp" diff --git a/src/displayapp/screens/Music.h b/src/displayapp/screens/Music.h index 6f2d80a..f9b4eaa 100644 --- a/src/displayapp/screens/Music.h +++ b/src/displayapp/screens/Music.h @@ -20,7 +20,7 @@ #include #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" namespace Pinetime { namespace Controllers { diff --git a/src/displayapp/screens/Navigation.cpp b/src/displayapp/screens/Navigation.cpp index d437cc6..674362a 100644 --- a/src/displayapp/screens/Navigation.cpp +++ b/src/displayapp/screens/Navigation.cpp @@ -15,9 +15,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "Navigation.h" +#include "displayapp/screens/Navigation.h" #include -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" #include "components/ble/NavigationService.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Navigation.h b/src/displayapp/screens/Navigation.h index 48f00a7..07674ef 100644 --- a/src/displayapp/screens/Navigation.h +++ b/src/displayapp/screens/Navigation.h @@ -20,7 +20,7 @@ #include #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/NotificationIcon.cpp b/src/displayapp/screens/NotificationIcon.cpp index d8792f9..0e913ae 100644 --- a/src/displayapp/screens/NotificationIcon.cpp +++ b/src/displayapp/screens/NotificationIcon.cpp @@ -1,5 +1,5 @@ -#include "NotificationIcon.h" -#include "Symbols.h" +#include "displayapp/screens/NotificationIcon.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; const char* NotificationIcon::GetIcon(bool newNotificationAvailable) { diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 4f47581..569c422 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -1,8 +1,8 @@ -#include "Notifications.h" -#include +#include "displayapp/screens/Notifications.h" +#include "displayapp/DisplayApp.h" #include "components/ble/MusicService.h" #include "components/ble/AlertNotificationService.h" -#include "Symbols.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index 0b5271e..cbb7af6 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -3,7 +3,7 @@ #include #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/ble/NotificationManager.h" #include "components/motor/MotorController.h" diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 26c2368..aa3420d 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -1,6 +1,6 @@ -#include "Paddle.h" -#include "../DisplayApp.h" -#include "../LittleVgl.h" +#include "displayapp/screens/Paddle.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/LittleVgl.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index fc2131a..3a30eee 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" namespace Pinetime { namespace Components { diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index fa88d45..781a359 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -19,21 +19,21 @@ * Style/layout copied from TimeStyle for Pebble by Dan Tilden (github.com/tilden) */ -#include "PineTimeStyle.h" +#include "displayapp/screens/PineTimeStyle.h" #include #include #include #include -#include "BatteryIcon.h" -#include "BleIcon.h" -#include "NotificationIcon.h" -#include "Symbols.h" +#include "displayapp/screens/BatteryIcon.h" +#include "displayapp/screens/BleIcon.h" +#include "displayapp/screens/NotificationIcon.h" +#include "displayapp/screens/Symbols.h" #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" #include "components/motion/MotionController.h" #include "components/settings/Settings.h" -#include "../DisplayApp.h" +#include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/PineTimeStyle.h b/src/displayapp/screens/PineTimeStyle.h index ba47380..f8c7c8b 100644 --- a/src/displayapp/screens/PineTimeStyle.h +++ b/src/displayapp/screens/PineTimeStyle.h @@ -4,8 +4,8 @@ #include #include #include -#include "Screen.h" -#include "ScreenList.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/ScreenList.h" #include "components/datetime/DateTimeController.h" namespace Pinetime { diff --git a/src/displayapp/screens/Screen.cpp b/src/displayapp/screens/Screen.cpp index 6ae5b7b..bc4cc43 100644 --- a/src/displayapp/screens/Screen.cpp +++ b/src/displayapp/screens/Screen.cpp @@ -1,4 +1,4 @@ -#include "Screen.h" +#include "displayapp/screens/Screen.h" using namespace Pinetime::Applications::Screens; void Screen::RefreshTaskCallback(lv_task_t* task) { diff --git a/src/displayapp/screens/Screen.h b/src/displayapp/screens/Screen.h index ce5741b..04bb152 100644 --- a/src/displayapp/screens/Screen.h +++ b/src/displayapp/screens/Screen.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../TouchEvents.h" +#include "displayapp/TouchEvents.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/ScreenList.h b/src/displayapp/screens/ScreenList.h index a9d747a..e316e36 100644 --- a/src/displayapp/screens/ScreenList.h +++ b/src/displayapp/screens/ScreenList.h @@ -3,8 +3,8 @@ #include #include #include -#include "Screen.h" -#include "../DisplayApp.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/DisplayApp.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Steps.cpp b/src/displayapp/screens/Steps.cpp index c41163a..916138e 100644 --- a/src/displayapp/screens/Steps.cpp +++ b/src/displayapp/screens/Steps.cpp @@ -1,7 +1,7 @@ -#include "Steps.h" +#include "displayapp/screens/Steps.h" #include -#include "../DisplayApp.h" -#include "Symbols.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Steps.h b/src/displayapp/screens/Steps.h index d7cf31e..68daf16 100644 --- a/src/displayapp/screens/Steps.h +++ b/src/displayapp/screens/Steps.h @@ -2,7 +2,7 @@ #include #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include namespace Pinetime { diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp index 9b27a89..a260d29 100644 --- a/src/displayapp/screens/StopWatch.cpp +++ b/src/displayapp/screens/StopWatch.cpp @@ -1,8 +1,8 @@ #include "StopWatch.h" -#include "Screen.h" -#include "Symbols.h" -#include "lvgl/lvgl.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/Symbols.h" +#include #include "projdefs.h" #include "FreeRTOSConfig.h" #include "task.h" diff --git a/src/displayapp/screens/StopWatch.h b/src/displayapp/screens/StopWatch.h index 25634e9..0720a58 100644 --- a/src/displayapp/screens/StopWatch.h +++ b/src/displayapp/screens/StopWatch.h @@ -1,8 +1,8 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" -#include "../LittleVgl.h" +#include "displayapp/LittleVgl.h" #include "FreeRTOS.h" #include "portmacro_cmsis.h" diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index dd223b2..350c15c 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -1,7 +1,7 @@ -#include "SystemInfo.h" +#include "displayapp/screens/SystemInfo.h" #include -#include "../DisplayApp.h" -#include "Label.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/Label.h" #include "Version.h" #include "BootloaderVersion.h" #include "components/battery/BatteryController.h" diff --git a/src/displayapp/screens/SystemInfo.h b/src/displayapp/screens/SystemInfo.h index bfcc3aa..a382ed8 100644 --- a/src/displayapp/screens/SystemInfo.h +++ b/src/displayapp/screens/SystemInfo.h @@ -1,8 +1,8 @@ #pragma once #include -#include "Screen.h" -#include "ScreenList.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/ScreenList.h" namespace Pinetime { namespace Controllers { diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index 1d4f0d0..ba764a2 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -1,6 +1,6 @@ -#include "Tile.h" -#include "../DisplayApp.h" -#include "BatteryIcon.h" +#include "displayapp/screens/Tile.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/screens/BatteryIcon.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index 83d3fdf..4869fef 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -3,8 +3,8 @@ #include #include #include -#include "Screen.h" -#include "../Apps.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/Apps.h" #include "components/datetime/DateTimeController.h" #include "components/settings/Settings.h" #include "components/datetime/DateTimeController.h" diff --git a/src/displayapp/screens/Timer.cpp b/src/displayapp/screens/Timer.cpp index ff3099d..a5e4019 100644 --- a/src/displayapp/screens/Timer.cpp +++ b/src/displayapp/screens/Timer.cpp @@ -1,8 +1,8 @@ -#include "Timer.h" +#include "displayapp/screens/Timer.h" -#include "Screen.h" -#include "Symbols.h" -#include "lvgl/lvgl.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/Symbols.h" +#include using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Timer.h b/src/displayapp/screens/Timer.h index d0fc8ed..23c8734 100644 --- a/src/displayapp/screens/Timer.h +++ b/src/displayapp/screens/Timer.h @@ -1,9 +1,9 @@ #pragma once -#include "Screen.h" +#include "displayapp/screens/Screen.h" #include "components/datetime/DateTimeController.h" #include "systemtask/SystemTask.h" -#include "../LittleVgl.h" +#include "displayapp/LittleVgl.h" #include "components/timer/TimerController.h" diff --git a/src/displayapp/screens/Twos.cpp b/src/displayapp/screens/Twos.cpp index d12ef90..a1f0ba2 100644 --- a/src/displayapp/screens/Twos.cpp +++ b/src/displayapp/screens/Twos.cpp @@ -1,4 +1,4 @@ -#include "Twos.h" +#include "displayapp/screens/Twos.h" #include #include #include diff --git a/src/displayapp/screens/Twos.h b/src/displayapp/screens/Twos.h index 6d85cff..48ea079 100644 --- a/src/displayapp/screens/Twos.h +++ b/src/displayapp/screens/Twos.h @@ -1,7 +1,7 @@ #pragma once #include -#include "Screen.h" +#include "displayapp/screens/Screen.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 53e7faf..510d113 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -1,9 +1,9 @@ #include -#include "WatchFaceAnalog.h" -#include "BatteryIcon.h" -#include "BleIcon.h" -#include "Symbols.h" -#include "NotificationIcon.h" +#include "displayapp/screens/WatchFaceAnalog.h" +#include "displayapp/screens/BatteryIcon.h" +#include "displayapp/screens/BleIcon.h" +#include "displayapp/screens/Symbols.h" +#include "displayapp/screens/NotificationIcon.h" LV_IMG_DECLARE(bg_clock); diff --git a/src/displayapp/screens/WatchFaceAnalog.h b/src/displayapp/screens/WatchFaceAnalog.h index 001414a..ca0462a 100644 --- a/src/displayapp/screens/WatchFaceAnalog.h +++ b/src/displayapp/screens/WatchFaceAnalog.h @@ -4,8 +4,8 @@ #include #include #include -#include "Screen.h" -#include "ScreenList.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/ScreenList.h" #include "components/datetime/DateTimeController.h" #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 2ecab60..2894812 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -1,12 +1,12 @@ -#include "WatchFaceDigital.h" +#include "displayapp/screens/WatchFaceDigital.h" #include #include #include -#include "BatteryIcon.h" -#include "BleIcon.h" -#include "NotificationIcon.h" -#include "Symbols.h" +#include "displayapp/screens/BatteryIcon.h" +#include "displayapp/screens/BleIcon.h" +#include "displayapp/screens/NotificationIcon.h" +#include "displayapp/screens/Symbols.h" #include "components/battery/BatteryController.h" #include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index e27545f..7134efb 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -4,8 +4,8 @@ #include #include #include -#include "Screen.h" -#include "ScreenList.h" +#include "displayapp/screens/Screen.h" +#include "displayapp/screens/ScreenList.h" #include "components/datetime/DateTimeController.h" namespace Pinetime { diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp index dd62607..5d3a983 100644 --- a/src/displayapp/screens/settings/QuickSettings.cpp +++ b/src/displayapp/screens/settings/QuickSettings.cpp @@ -1,4 +1,4 @@ -#include "QuickSettings.h" +#include "displayapp/screens/settings/QuickSettings.h" #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" #include "displayapp/screens/BatteryIcon.h" diff --git a/src/displayapp/screens/settings/SettingDisplay.cpp b/src/displayapp/screens/settings/SettingDisplay.cpp index d8d6c76..666dfb8 100644 --- a/src/displayapp/screens/settings/SettingDisplay.cpp +++ b/src/displayapp/screens/settings/SettingDisplay.cpp @@ -1,4 +1,4 @@ -#include "SettingDisplay.h" +#include "displayapp/screens/settings/SettingDisplay.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/Messages.h" diff --git a/src/displayapp/screens/settings/SettingPineTimeStyle.cpp b/src/displayapp/screens/settings/SettingPineTimeStyle.cpp index c9af19b..f38ec3b 100644 --- a/src/displayapp/screens/settings/SettingPineTimeStyle.cpp +++ b/src/displayapp/screens/settings/SettingPineTimeStyle.cpp @@ -1,4 +1,4 @@ -#include "SettingPineTimeStyle.h" +#include "displayapp/screens/settings/SettingPineTimeStyle.h" #include #include #include "displayapp/DisplayApp.h" diff --git a/src/displayapp/screens/settings/SettingSetDate.cpp b/src/displayapp/screens/settings/SettingSetDate.cpp index ba3413e..8bfded3 100644 --- a/src/displayapp/screens/settings/SettingSetDate.cpp +++ b/src/displayapp/screens/settings/SettingSetDate.cpp @@ -1,4 +1,4 @@ -#include "SettingSetDate.h" +#include "displayapp/screens/settings/SettingSetDate.h" #include #include #include diff --git a/src/displayapp/screens/settings/SettingSetTime.cpp b/src/displayapp/screens/settings/SettingSetTime.cpp index 194bf5e..5351ade 100644 --- a/src/displayapp/screens/settings/SettingSetTime.cpp +++ b/src/displayapp/screens/settings/SettingSetTime.cpp @@ -1,4 +1,4 @@ -#include "SettingSetTime.h" +#include "displayapp/screens/settings/SettingSetTime.h" #include #include #include diff --git a/src/displayapp/screens/settings/SettingSteps.cpp b/src/displayapp/screens/settings/SettingSteps.cpp index bec7972..149840d 100644 --- a/src/displayapp/screens/settings/SettingSteps.cpp +++ b/src/displayapp/screens/settings/SettingSteps.cpp @@ -1,4 +1,4 @@ -#include "SettingSteps.h" +#include "displayapp/screens/settings/SettingSteps.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Symbols.h" diff --git a/src/displayapp/screens/settings/SettingTimeFormat.cpp b/src/displayapp/screens/settings/SettingTimeFormat.cpp index c99e3a0..c6bdf40 100644 --- a/src/displayapp/screens/settings/SettingTimeFormat.cpp +++ b/src/displayapp/screens/settings/SettingTimeFormat.cpp @@ -1,4 +1,4 @@ -#include "SettingTimeFormat.h" +#include "displayapp/screens/settings/SettingTimeFormat.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Screen.h" diff --git a/src/displayapp/screens/settings/SettingWakeUp.cpp b/src/displayapp/screens/settings/SettingWakeUp.cpp index d999004..8339d9a 100644 --- a/src/displayapp/screens/settings/SettingWakeUp.cpp +++ b/src/displayapp/screens/settings/SettingWakeUp.cpp @@ -1,4 +1,4 @@ -#include "SettingWakeUp.h" +#include "displayapp/screens/settings/SettingWakeUp.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Screen.h" diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp index cdec704..8e6e7cf 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.cpp +++ b/src/displayapp/screens/settings/SettingWatchFace.cpp @@ -1,4 +1,4 @@ -#include "SettingWatchFace.h" +#include "displayapp/screens/settings/SettingWatchFace.h" #include #include "displayapp/DisplayApp.h" #include "displayapp/screens/Screen.h" diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 1daf311..392c12e 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -1,4 +1,4 @@ -#include "Settings.h" +#include "displayapp/screens/settings/Settings.h" #include #include #include "displayapp/screens/List.h" diff --git a/src/drivers/Bma421.cpp b/src/drivers/Bma421.cpp index dd28400..8db64ad 100644 --- a/src/drivers/Bma421.cpp +++ b/src/drivers/Bma421.cpp @@ -1,7 +1,7 @@ #include #include -#include "Bma421.h" -#include "TwiMaster.h" +#include "drivers/Bma421.h" +#include "drivers/TwiMaster.h" #include using namespace Pinetime::Drivers; diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index bf51a8b..e9573df 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -1,4 +1,4 @@ -#include "Cst816s.h" +#include "drivers/Cst816s.h" #include #include #include diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h index 507dd4f..4a548d4 100644 --- a/src/drivers/Cst816s.h +++ b/src/drivers/Cst816s.h @@ -1,6 +1,6 @@ #pragma once -#include "TwiMaster.h" +#include "drivers/TwiMaster.h" namespace Pinetime { namespace Drivers { diff --git a/src/drivers/DebugPins.cpp b/src/drivers/DebugPins.cpp index 56fd145..9209128 100644 --- a/src/drivers/DebugPins.cpp +++ b/src/drivers/DebugPins.cpp @@ -1,4 +1,4 @@ -#include "DebugPins.h" +#include "drivers/DebugPins.h" #include #ifdef USE_DEBUG_PINS diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index edb9e81..cecef14 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -6,7 +6,7 @@ #include #include -#include "Hrs3300.h" +#include "drivers/Hrs3300.h" #include #include diff --git a/src/drivers/Hrs3300.h b/src/drivers/Hrs3300.h index c4f2890..01310c6 100644 --- a/src/drivers/Hrs3300.h +++ b/src/drivers/Hrs3300.h @@ -1,6 +1,6 @@ #pragma once -#include "TwiMaster.h" +#include "drivers/TwiMaster.h" namespace Pinetime { namespace Drivers { diff --git a/src/drivers/InternalFlash.cpp b/src/drivers/InternalFlash.cpp index 0840c6e..ec5885d 100644 --- a/src/drivers/InternalFlash.cpp +++ b/src/drivers/InternalFlash.cpp @@ -1,4 +1,4 @@ -#include "InternalFlash.h" +#include "drivers/InternalFlash.h" #include using namespace Pinetime::Drivers; diff --git a/src/drivers/Spi.cpp b/src/drivers/Spi.cpp index a55d288..e477622 100644 --- a/src/drivers/Spi.cpp +++ b/src/drivers/Spi.cpp @@ -1,4 +1,4 @@ -#include "Spi.h" +#include "drivers/Spi.h" #include #include diff --git a/src/drivers/Spi.h b/src/drivers/Spi.h index 6875710..9b6a30f 100644 --- a/src/drivers/Spi.h +++ b/src/drivers/Spi.h @@ -1,7 +1,7 @@ #pragma once #include #include -#include "SpiMaster.h" +#include "drivers/SpiMaster.h" namespace Pinetime { namespace Drivers { diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp index c45e129..747dbc8 100644 --- a/src/drivers/SpiMaster.cpp +++ b/src/drivers/SpiMaster.cpp @@ -1,4 +1,4 @@ -#include "SpiMaster.h" +#include "drivers/SpiMaster.h" #include #include #include diff --git a/src/drivers/SpiNorFlash.cpp b/src/drivers/SpiNorFlash.cpp index 068d1d0..ebe3174 100644 --- a/src/drivers/SpiNorFlash.cpp +++ b/src/drivers/SpiNorFlash.cpp @@ -1,8 +1,8 @@ -#include "SpiNorFlash.h" +#include "drivers/SpiNorFlash.h" #include #include #include -#include "Spi.h" +#include "drivers/Spi.h" using namespace Pinetime::Drivers; diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index 4d81cf2..fd1366f 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -1,8 +1,8 @@ -#include "St7789.h" +#include "drivers/St7789.h" #include #include #include -#include "Spi.h" +#include "drivers/Spi.h" using namespace Pinetime::Drivers; diff --git a/src/drivers/TwiMaster.cpp b/src/drivers/TwiMaster.cpp index 7600927..9b456d5 100644 --- a/src/drivers/TwiMaster.cpp +++ b/src/drivers/TwiMaster.cpp @@ -1,4 +1,4 @@ -#include "TwiMaster.h" +#include "drivers/TwiMaster.h" #include #include #include diff --git a/src/drivers/Watchdog.cpp b/src/drivers/Watchdog.cpp index a6ad263..d0907a6 100644 --- a/src/drivers/Watchdog.cpp +++ b/src/drivers/Watchdog.cpp @@ -1,4 +1,4 @@ -#include "Watchdog.h" +#include "drivers/Watchdog.h" #include using namespace Pinetime::Drivers; diff --git a/src/heartratetask/HeartRateTask.cpp b/src/heartratetask/HeartRateTask.cpp index fddc05d..213ab4a 100644 --- a/src/heartratetask/HeartRateTask.cpp +++ b/src/heartratetask/HeartRateTask.cpp @@ -1,4 +1,4 @@ -#include "HeartRateTask.h" +#include "heartratetask/HeartRateTask.h" #include #include #include diff --git a/src/logging/DummyLogger.h b/src/logging/DummyLogger.h index 8732dff..1b050b3 100644 --- a/src/logging/DummyLogger.h +++ b/src/logging/DummyLogger.h @@ -1,5 +1,5 @@ #pragma once -#include "Logger.h" +#include "logging/Logger.h" namespace Pinetime { namespace Logging { diff --git a/src/logging/NrfLogger.cpp b/src/logging/NrfLogger.cpp index 1c048f2..ab54afe 100644 --- a/src/logging/NrfLogger.cpp +++ b/src/logging/NrfLogger.cpp @@ -1,4 +1,4 @@ -#include "NrfLogger.h" +#include "logging/NrfLogger.h" #include #include diff --git a/src/logging/NrfLogger.h b/src/logging/NrfLogger.h index 060c4e7..21183a3 100644 --- a/src/logging/NrfLogger.h +++ b/src/logging/NrfLogger.h @@ -1,5 +1,5 @@ #pragma once -#include "Logger.h" +#include "logging/Logger.h" #include #include diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 4b03f9a..1120b80 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -1,4 +1,4 @@ -#include "SystemTask.h" +#include "systemtask/SystemTask.h" #define min // workaround: nimble's min/max macros conflict with libstdc++ #define max #include diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 412878b..e2e6de7 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -11,7 +11,7 @@ #include #include -#include "SystemMonitor.h" +#include "systemtask/SystemMonitor.h" #include "components/battery/BatteryController.h" #include "components/ble/NimbleController.h" #include "components/ble/NotificationManager.h" @@ -33,7 +33,7 @@ #endif #include "drivers/Watchdog.h" -#include "Messages.h" +#include "systemtask/Messages.h" extern std::chrono::time_point NoInit_BackUpTime; namespace Pinetime { diff --git a/src/touchhandler/TouchHandler.cpp b/src/touchhandler/TouchHandler.cpp index 735b311..0be3347 100644 --- a/src/touchhandler/TouchHandler.cpp +++ b/src/touchhandler/TouchHandler.cpp @@ -1,4 +1,4 @@ -#include "TouchHandler.h" +#include "touchhandler/TouchHandler.h" using namespace Pinetime::Controllers; -- cgit v0.10.2 From f2918709d92dd49e7e1fffe22be04fc2b47f928b Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 3 Nov 2021 23:02:30 +0100 Subject: Add missing standard includes diff --git a/src/BootloaderVersion.h b/src/BootloaderVersion.h index f812741..309c23c 100644 --- a/src/BootloaderVersion.h +++ b/src/BootloaderVersion.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + namespace Pinetime { class BootloaderVersion { public: diff --git a/src/Version.h.in b/src/Version.h.in index 8cd39c9..0d6219c 100644 --- a/src/Version.h.in +++ b/src/Version.h.in @@ -2,6 +2,8 @@ @VERSION_EDIT_WARNING@ +#include + namespace Pinetime { class Version { public: diff --git a/src/components/ble/DeviceInformationService.h b/src/components/ble/DeviceInformationService.h index 54b3e96..a269afb 100644 --- a/src/components/ble/DeviceInformationService.h +++ b/src/components/ble/DeviceInformationService.h @@ -1,4 +1,5 @@ #pragma once +#include #define min // workaround: nimble's min/max macros conflict with libstdc++ #define max #include diff --git a/src/displayapp/Messages.h b/src/displayapp/Messages.h index ab0a060..29e09eb 100644 --- a/src/displayapp/Messages.h +++ b/src/displayapp/Messages.h @@ -1,4 +1,5 @@ #pragma once +#include namespace Pinetime { namespace Applications { namespace Display { diff --git a/src/displayapp/screens/BatteryIcon.h b/src/displayapp/screens/BatteryIcon.h index b370b33..bec2e4e 100644 --- a/src/displayapp/screens/BatteryIcon.h +++ b/src/displayapp/screens/BatteryIcon.h @@ -1,4 +1,5 @@ #pragma once +#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h index 322ce75..bc0bca2 100644 --- a/src/displayapp/screens/InfiniPaint.h +++ b/src/displayapp/screens/InfiniPaint.h @@ -2,6 +2,7 @@ #include #include +#include // std::fill #include "displayapp/screens/Screen.h" namespace Pinetime { diff --git a/src/drivers/PinMap.h b/src/drivers/PinMap.h index 5796402..579bf38 100644 --- a/src/drivers/PinMap.h +++ b/src/drivers/PinMap.h @@ -1,4 +1,5 @@ #pragma once +#include namespace Pinetime { namespace PinMap { -- cgit v0.10.2 From 1b937a77b981557015a614c7b806f8ddf62c614e Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Wed, 3 Nov 2021 23:08:57 +0100 Subject: remove unused libs/ prefix from lvgl includes as not needed diff --git a/src/displayapp/DummyLittleVgl.h b/src/displayapp/DummyLittleVgl.h index 1db5134..47c9e02 100644 --- a/src/displayapp/DummyLittleVgl.h +++ b/src/displayapp/DummyLittleVgl.h @@ -1,8 +1,8 @@ #pragma once -#include -#include -#include +#include +#include +#include #include #include diff --git a/src/displayapp/screens/HeartRate.h b/src/displayapp/screens/HeartRate.h index d06415c..baa0ccd 100644 --- a/src/displayapp/screens/HeartRate.h +++ b/src/displayapp/screens/HeartRate.h @@ -5,8 +5,8 @@ #include "displayapp/screens/Screen.h" #include #include "systemtask/SystemTask.h" -#include -#include +#include +#include namespace Pinetime { namespace Controllers { diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp index 3641110..8162e02 100644 --- a/src/displayapp/screens/Motion.cpp +++ b/src/displayapp/screens/Motion.cpp @@ -1,4 +1,4 @@ -#include +#include #include "displayapp/screens/Motion.h" #include "displayapp/DisplayApp.h" diff --git a/src/displayapp/screens/Motion.h b/src/displayapp/screens/Motion.h index f6202b5..d699740 100644 --- a/src/displayapp/screens/Motion.h +++ b/src/displayapp/screens/Motion.h @@ -4,8 +4,8 @@ #include #include "displayapp/screens/Screen.h" #include -#include -#include +#include +#include #include namespace Pinetime { diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 510d113..470fc8e 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -1,4 +1,4 @@ -#include +#include #include "displayapp/screens/WatchFaceAnalog.h" #include "displayapp/screens/BatteryIcon.h" #include "displayapp/screens/BleIcon.h" -- cgit v0.10.2 From 241d36471daaea03215c289f3dc2bdc2860b5053 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Fri, 5 Nov 2021 23:55:34 +0100 Subject: Move up file header include to top diff --git a/src/components/ble/BatteryInformationService.cpp b/src/components/ble/BatteryInformationService.cpp index b95a88d..9a3f86f 100644 --- a/src/components/ble/BatteryInformationService.cpp +++ b/src/components/ble/BatteryInformationService.cpp @@ -1,5 +1,5 @@ -#include #include "components/ble/BatteryInformationService.h" +#include #include "components/battery/BatteryController.h" using namespace Pinetime::Controllers; diff --git a/src/components/heartrate/Ppg.cpp b/src/components/heartrate/Ppg.cpp index c247d1f..a5d8369 100644 --- a/src/components/heartrate/Ppg.cpp +++ b/src/components/heartrate/Ppg.cpp @@ -4,9 +4,9 @@ C++ port Copyright (C) 2021 Jean-François Milants */ +#include "components/heartrate/Ppg.h" #include #include -#include "components/heartrate/Ppg.h" using namespace Pinetime::Controllers; /** Original implementation from wasp-os : https://github.com/daniel-thompson/wasp-os/blob/master/wasp/ppg.py */ diff --git a/src/components/heartrate/Ptagc.cpp b/src/components/heartrate/Ptagc.cpp index db496a1..1c60bc2 100644 --- a/src/components/heartrate/Ptagc.cpp +++ b/src/components/heartrate/Ptagc.cpp @@ -4,8 +4,8 @@ C++ port Copyright (C) 2021 Jean-François Milants */ -#include #include "components/heartrate/Ptagc.h" +#include using namespace Pinetime::Controllers; diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index 114b08f..08aaab7 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -1,5 +1,5 @@ -#include #include "displayapp/screens/BatteryIcon.h" +#include #include "displayapp/screens/Symbols.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/HeartRate.cpp b/src/displayapp/screens/HeartRate.cpp index 65d1aa2..513c40b 100644 --- a/src/displayapp/screens/HeartRate.cpp +++ b/src/displayapp/screens/HeartRate.cpp @@ -1,5 +1,5 @@ -#include #include "displayapp/screens/HeartRate.h" +#include #include #include "displayapp/DisplayApp.h" diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp index 8162e02..23eb276 100644 --- a/src/displayapp/screens/Motion.cpp +++ b/src/displayapp/screens/Motion.cpp @@ -1,5 +1,5 @@ -#include #include "displayapp/screens/Motion.h" +#include #include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp index 470fc8e..4540c1a 100644 --- a/src/displayapp/screens/WatchFaceAnalog.cpp +++ b/src/displayapp/screens/WatchFaceAnalog.cpp @@ -1,5 +1,5 @@ -#include #include "displayapp/screens/WatchFaceAnalog.h" +#include #include "displayapp/screens/BatteryIcon.h" #include "displayapp/screens/BleIcon.h" #include "displayapp/screens/Symbols.h" diff --git a/src/drivers/Bma421.cpp b/src/drivers/Bma421.cpp index 8db64ad..2f60f42 100644 --- a/src/drivers/Bma421.cpp +++ b/src/drivers/Bma421.cpp @@ -1,6 +1,6 @@ +#include "drivers/Bma421.h" #include #include -#include "drivers/Bma421.h" #include "drivers/TwiMaster.h" #include diff --git a/src/drivers/Hrs3300.cpp b/src/drivers/Hrs3300.cpp index cecef14..c14fe7a 100644 --- a/src/drivers/Hrs3300.cpp +++ b/src/drivers/Hrs3300.cpp @@ -4,9 +4,9 @@ C++ port Copyright (C) 2021 Jean-François Milants */ +#include "drivers/Hrs3300.h" #include #include -#include "drivers/Hrs3300.h" #include #include -- cgit v0.10.2 From 3a41bff9eaf9cbae6d3864664ad08859ec2d2c44 Mon Sep 17 00:00:00 2001 From: Reinhold Gschweicher Date: Sat, 6 Nov 2021 00:02:17 +0100 Subject: docs: add non-relative includes to coding standard diff --git a/doc/contribute.md b/doc/contribute.md index 595a599..f7b8ea3 100644 --- a/doc/contribute.md +++ b/doc/contribute.md @@ -94,6 +94,7 @@ If there are no preconfigured rules for your IDE, you can use one of the existin - **Includes** : - files from the project : `#include "relative/path/to/the/file.h"` - external files and std : `#include ` + - use includes relative to included directories like `src`, not relative to the current file. Don't do: `#include "../file.h"` - Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative) - Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name. - Examples: -- cgit v0.10.2 From 4aaf3d06bceadb05de0d3a9b0de94e4aba215131 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 6 Nov 2021 14:38:11 +0200 Subject: Documentation cleanup and reorganization diff --git a/README.md b/README.md index 765aa86..22c91b5 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,18 @@ -# InfiniTime +# [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) [![Build PineTime Firmware](https://github.com/InfiniTimeOrg/InfiniTime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master)](https://github.com/InfiniTimeOrg/InfiniTime/actions) -![InfiniTime logo](images/infinitime-logo.jpg "InfiniTime Logo") +![InfiniTime logo](images/infinitime-logo-small.jpg "InfiniTime Logo") -The goal of this project is to design an open-source firmware for the [Pinetime smartwatch](https://www.pine64.org/pinetime/) : - - - Code written in **modern C++**; - - Build system based on **CMake**; - - Based on **[FreeRTOS 10.0.0](https://freertos.org)** real-time OS. - - Using **[LittleVGL/LVGL 7](https://lvgl.io/)** as UI library... - - ... and **[NimBLE 1.3.0](https://github.com/apache/mynewt-nimble)** as BLE stack. +InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www.pine64.org/pinetime/) ## New to InfiniTime? - - [Getting started with InfiniTime 1.0 (quick user guide, update bootloader and InfiniTime,...)](doc/gettingStarted/gettingStarted-1.0.md) - - [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/ota-gadgetbridge-nrfconnect.md) - -## Overview - -![Pinetime screens](images/1.0.0/collage.png "PinetimeScreens") - -As of now, here is the list of achievements of this project: - - - Fast and optimized LCD driver - - BLE communication - - Rich user interface via display, touchscreen and pushbutton - - Time synchronization via BLE - - Notification via BLE - - Heart rate measurements - - Step counting - - Wake-up on wrist rotation - - Quick actions - * Disable vibration on notification - * Brightness settings - * Flashlight - * Settings - - 3 watch faces: - * Digital - * Analog - * [PineTimeStyle](https://wiki.pine64.org/wiki/PineTimeStyle) - - Multiple 'apps' : - * Music (control the playback of music on your phone) - * Heart rate (measure your heart rate) - * Navigation (displays navigation instructions coming from the companion app) - * Notification (displays the last notification received) - * Paddle (single player pong-like game) - * Twos (2048 clone game) - * Stopwatch - * Steps (displays the number of steps taken) - * Timer (set a countdown timer that will notify you when it expires) - * Metronome (vibrates to a given bpm with a customizable beats per bar) - - User settings: - * Display timeout - * Wake-up condition - * Time format (12/24h) - * Default watch face - * Daily step goal - * Battery status - * Firmware validation - * System information - - Supported by 3 companion apps (development is in progress): - * [Gadgetbridge](https://codeberg.org/Freeyourgadget/Gadgetbridge/) (on Android via F-Droid) - * [Amazfish](https://openrepos.net/content/piggz/amazfish) (on SailfishOS and Linux) - * [Siglo](https://github.com/alexr4535/siglo) (on Linux) - * **[Experimental]** [WebBLEWatch](https://hubmartin.github.io/WebBLEWatch/) Synchronize time directly from your web browser. [video](https://youtu.be/IakiuhVDdrY) - * **[Experimental]** [InfiniLink](https://github.com/xan-m/InfiniLink) (on iOS) - - OTA (Over-the-air) update via BLE - - [Bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader) based on [MCUBoot](https://www.mcuboot.com) + - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) + - [About the software and updating](doc/gettingStarted/updating-software.md) + - Companion apps: + - [Gadgetbridge](doc/companionapps/Gadgetbridge.md) + - [AmazFish](doc/companionapps/Amazfish.md) ## Documentation @@ -84,16 +29,11 @@ As of now, here is the list of achievements of this project: - [Files included in the release notes](doc/filesInReleaseNotes.md) - [Build the project](doc/buildAndProgram.md) - [Flash the firmware using OpenOCD and STLinkV2](doc/openOCD.md) + - [Flash the firmware using SWD interface](doc/SWD.md) - [Build the project with Docker](doc/buildWithDocker.md) - [Build the project with VSCode](doc/buildWithVScode.md) - [Bootloader, OTA and DFU](./bootloader/README.md) - [Stub using NRF52-DK](./doc/PinetimeStubWithNrf52DK.md) - - Logging with JLink RTT. - - Using files from the releases - -### Contribute - - - [How to contribute ?](doc/contribute.md) ### API @@ -103,29 +43,13 @@ As of now, here is the list of achievements of this project: - [Memory analysis](./doc/MemoryAnalysis.md) -### Using the firmware - - - [Integration with Gadgetbridge](doc/companionapps/Gadgetbridge.md) - - [Integration with AmazFish](doc/companionapps/Amazfish.md) - - [Firmware update, OTA](doc/companionapps/NrfconnectOTA.md) - -## TODO - contribute +## Contributing This project is far from being finished, and there are still a lot of things to do for this project to become a firmware usable by the general public. -Here a quick list out of my head of things to do for this project: - - - Improve BLE communication stability and reliability - - Improve OTA and MCUBoot bootloader - - Add more functionalities : Alarm, chronometer, configuration, activities, heart rate logging, games,... - - Add more BLE functionalities : call notifications, agenda, configuration, data logging,... - - Measure power consumption and improve battery life - - Improve documentation, take better pictures and video than mine - - Improve the UI - - Create companion app for multiple OSes (Linux, Android, iOS) and platforms (desktop, ARM, mobile). Do not forget the other devices from Pine64 like [the Pinephone](https://www.pine64.org/pinephone/) and the [Pinebook Pro](https://www.pine64.org/pinebook-pro/). - - Design a simple CI (preferably self-hosted and easy to reproduce). +Do not hesitate to fork the code, hack it and create pull-requests! -Do not hesitate to clone/fork the code, hack it and create pull-requests. I'll do my best to review and merge them :) +Read this page for more information on how you can help: [How to contribute?](doc/contribute.md) ## Licenses diff --git a/doc/SWD.md b/doc/SWD.md new file mode 100644 index 0000000..4146e6a --- /dev/null +++ b/doc/SWD.md @@ -0,0 +1,14 @@ +# How to flash InfiniTime using the SWD interface +Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page: + +![Image file](imageFile.png) + +The bootloader reads a boot logo from the external SPI flash memory. The first step consists of flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommended (the bootloader will display garbage on screen for a few second if you don't do it). +Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display. + +Then, using your SWD tool, flash those file at specific offset: + + - bootloader.bin : **0x0000** + - image-x.y.z.bin : **0x8000** + +Reset and voilà, you're running InfiniTime on your PineTime! diff --git a/doc/companionapps/Gadgetbridge.md b/doc/companionapps/Gadgetbridge.md index 974e282..678fe7a 100644 --- a/doc/companionapps/Gadgetbridge.md +++ b/doc/companionapps/Gadgetbridge.md @@ -1,13 +1,7 @@ # Integration with Gadgetbridge [Gadgetbridge](https://gadgetbridge.org/) is an Android application that supports many smartwatches and fitness trackers. -The integration of InfiniTime (previously Pinetime-JF) is now merged into the master branch (https://codeberg.org/Freeyourgadget/Gadgetbridge/) and initial support is available [starting with version 0.47](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/CHANGELOG.md). Note that the official version is only available on F-Droid (as of May 2021), and the unofficial fork available on the Play Store is outdated and does not support Infinitime. +Gadgetbridge supports InfiniTime [starting with version 0.47](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/CHANGELOG.md). Note that the official version is only available on F-Droid (as of May 2021), and the unofficial fork available on the Play Store is outdated and does not support InfiniTime. -## Features -The following features are implemented: - - Scanning & detection of Pinetime-JF / InfiniTime - - Connection / disconnection - - Notifications - ## Demo -[This video](https://seafile.codingfield.com/f/0a2920b9d765462385e4/) shows how to scan, connect, send notification (using the debug screen) and disconnect from the Pinetime. +[This video](https://seafile.codingfield.com/f/0a2920b9d765462385e4/) shows how to scan, connect, send notification (using the debug screen) and disconnect from the PineTime. diff --git a/doc/companionapps/NrfconnectOTA.md b/doc/companionapps/NrfconnectOTA.md deleted file mode 100644 index 0fa3cd0..0000000 --- a/doc/companionapps/NrfconnectOTA.md +++ /dev/null @@ -1,12 +0,0 @@ -# OTA using NRFConnect -[NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) is a powerful application (running on Android and iOS) which allows to scan and connect to BLE devices. - -## Features - - Scanning, connect, disconnect - - Time synchronization - - OTA - -InfiniTime implements the Nordic DFU protocol for the OTA functionality. NRFConnect also supports this protocol. - -# Demo -[This video](https://seafile.codingfield.com/f/a52b69683a05472a90c7/) shows how to use NRFConnect to update the firmware running on the Pinetime. \ No newline at end of file diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md index 409b7c7..a688193 100644 --- a/doc/gettingStarted/gettingStarted-1.0.md +++ b/doc/gettingStarted/gettingStarted-1.0.md @@ -1,91 +1,23 @@ -# Getting started with InfiniTime 1.0 +# Getting started with InfiniTime 1.0.0 -On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime. +On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime. -## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it? +It is highly recommended to update the firmware to the latest version when you receive your watch and when a new InfiniTime version is released. More information on updating the firmware [here](/doc/gettingStarted/updating-software.md). -You might have already seen these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and, you may find them misleading if you're not familiar with the project. +## InfiniTime 1.0.0 quick user guide -Basically, a **firmware** is just a software running on the embedded hardware of a device, the PineTime in this case. -**InfiniTime** is based on 3 distinct **firmwares**: - - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** itself, this is the *application firmware* running on the PineTime. This is the main firmware which provides most of the functionalities you'll use on a daily basis : bluetooth low-energy (BLE) connectivity, applications, watchfaces,... - - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying **updates** of the *application firmware*, reverting them in case of issues and load the recovery firmware when requested. - - **The recovery firmware** is a specific *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. Currently, this recovery firmware is based on [InfiniTime 0.14.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1). - -**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**evice **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). - -## How to check the version of InfiniTime and the bootloader? - -Since September 2020, all PineTimes (devkits or sealed) are flashed using the **[first iteration of the bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/releases/tag/v4.1.7)** and **[InfiniTime 0.7.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.7.1)**. There was no recovery firmware at that time. - -The bootloader only runs when the watch starts (from an empty battery, for example) or after a reset (after a successful OTA or a manual reset - long push on the button). - -You can recognize this first iteration of the bootloader with it greenish **PINETIME** logo. - -![Old bootloader logo](oldbootloaderlogo.jpg) - -You can check the version of InfiniTime by opening the app *SystemInfo*. For version < 1.0: - -![InfiniTime 0.7.1 Application menu](appmenu-071.jpg) -![InfiniTime 0.7.1 version](version-071.jpg) - -And for version >= 1.0 : - -![InfiniTime 1.0 version](version-1.0.jpg) - -PineTime shipped from June 2021 (to be confirmed) will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.0.0). - -The bootloader is easily recognizable with it white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now). - -![Bootloader 1.0](bootloader-1.0.jpg) - -## How to update your PineTime? - -To update your PineTime, you can use one of the compatible companion applications. Here are the main ones: - - - **[Amazfish](https://github.com/piggz/harbour-amazfish)** (Desktop Linux, mobile Linux, SailfishOS, runs on the PinebookPro and the Pinephone) - - **[Gadgetbridge](https://www.gadgetbridge.org/)** (Android) - - **[Siglo](https://github.com/alexr4535/siglo)** (Linux, GTK based) - - **NRFConnect** (closed source, Android & iOS). - -See [this page](ota-gadgetbridge-nrfconnect.md) for more info about the OTA procedure using Gadgetbridge and NRFConnect. - -### From InfiniTime 0.7.1 / old bootloader - -If your PineTime is currently running InfiniTime 0.7.1 and the old bootloader, we strongly recommend you update them to more recent version (Bootloader 1.0.0 and InfiniTime 1.0.0 as of now). We also recommend you install the recovery firmware once the bootloader is up-do-date. - -Using the companion app of your choice, you'll need to apply the OTA procedure for these 3 firmwares in this sequence (failing to follow this specific order might temporarily or permanently brick your device): - - 1. Flash the latest version of InfiniTime. The file to upload is named **pinetime-mcuboot-app-dfu-x.y.z.zip**. Here is the link to [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/download/1.0.0/pinetime-mcuboot-app-dfu-1.0.0.zip). - 2. Update the bootloader by applying the OTA procedure with the file named [**reloader-mcuboot.zip** from the repo of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/download/1.0.0/reloader-mcuboot.zip). - 3. Install the recovery firmware by applying the OTA procedure with the file named [**pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip** from the version 0.14.1 of InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime/releases/download/0.14.1/pinetime-mcuboot-recovery-loader-dfu-0.14.1.zip). - -You'll find more info about this process in [this wiki page](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0). You can also see the procedure in video [here](https://video.codingfield.com/videos/watch/831077c5-16f3-47b4-9b2b-c4bbfecc6529) and [here (from Amazfish)](https://video.codingfield.com/videos/watch/f7bffb3d-a6a1-43c4-8f01-f4aeff4adf9e) - -### From version > 1.0 - -If you are already running the new "1.0.0" bootloader, all you have to do is update your version of InfiniTime when it'll be available. We'll write specific instructions when (if) we release a new version of the bootloader. - -### Firmware validation - -The bootloader requires a (manual) validation of the firmware. If the watch reset with an updated firmware that was not validated, the bootloader will consider it as non-functioning and will revert to the previous version of the firmware. This is a safety feature to prevent bricking your device with a faulty firmware. - -You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure: - - - From the watchface, swipe **right** to display the *Quick Actions menu* - - Open the **Settings** app by tapping the *gear* icon on the bottom right - - Swipe down and tap on the entry named **Firmware** - - This app shows the version that is currently running. If it's not validated yet, it displays 2 buttons: - - **Validate** to validate your firmware - - **Reset** to reset the watch and revert to the previously running version of the firmware +### Setting the time -## InfiniTime 1.0 quick user guide +By default, InfiniTime starts on the digital watchface. It'll probably display the epoch time (1 Jan 1970, 00:00). -### Setting the time +You can sync the time using companion apps. -By default, InfiniTime starts on the digital watchface. It'll probably display the epoch time (1 Jan 1970, 00:00). The time will be automatically synchronized once you connect on of the companion app to your PineTime using BLE connectivity. InfiniTime does not provide any way to manually set the time for now. + - Gadgetbridge automatically synchronizes the time when you connect it to your watch. More information on Gadgetbridge [here](/doc/gettingStarted/ota-gadgetbridge.md) + - You can use NRFConnect to [sync the time](/doc/gettingStarted/time-nrfconnect.md) + - Sync the time with your browser https://hubmartin.github.io/WebBLEWatch/ + - Since InfiniTime 1.7.0, you can set the time in the settings without needing to use a companion app -### Navigation in the menu +## Navigation in the menu ![Quick actions](quickactions.jpg) ![Settings](settings.jpg) @@ -98,14 +30,7 @@ By default, InfiniTime starts on the digital watchface. It'll probably display t - Start the **flashlight** app - Enable/disable vibrations on notifications (Do Not Disturb mode) - Enter the **settings** menu - - Settings - - Display timeout - - Wake up event (Tap, wrist rotation) - - Time format (12/24H) - - Default watchface (digital / analog) - - Battery info - - Firmware validation - - About (system info, firmware version,...) + - Swipe up and down to see all options ### Bootloader diff --git a/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md b/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md deleted file mode 100644 index 57d1621..0000000 --- a/doc/gettingStarted/ota-gadgetbridge-nrfconnect.md +++ /dev/null @@ -1,109 +0,0 @@ -# Flash and upgrade InfiniTime -If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you! - -- [InfiniTime releases and versions](#infinitime-releases-and-versions) -- [How to upgrade Over-The-Air (OTA)](#how-to-upgrade-over-the-air-ota) - - [Using Gadgetbridge](#using-gadgetbridge) - - [Using NRFConnect](#Using-nrfconnect) -- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface) - -## InfiniTime releases and versions -All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). - -Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version. - -Release files are available under the *Assets* button. - -## How to upgrade Over-The-Air (OTA) -OTA is the easiest method to upgrade InfiniTime. Note that it's only possible is your PineTime is already running InfiniTime (>= 0.7.1). - -2 companion apps provide support for OTA : - - [Gadgetbridge](https://gadgetbridge.org/) (open source, runs on Android, [available on F-Droid](https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/)). - - [NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) (close source, runs on Android and iOS). - -Both applications need you to download the **DFU file** of InfiniTime. This file contains the new version of InfiniTime that will be flashed into your device. It's called **dfu-x.y.z.zip** (ex: dfu-0.9.0.zip) in the release note. -![Dfu file](dfuFile.png ) - -### Using Gadgetbridge -Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device: - -![Gadgetbridge 0](gadgetbridge0.jpg) - -Wait for the scan to complete, your PineTime should be detected: - -![Gadgetbridge 1](gadgetbridge1.jpg) - -Tap on it. Gadgdetbridge will pair and connect to your device: - -![Gadgetbridge 2](gadgetbridge2.jpg) - -Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: - -![Gadgetbridge 3](gadgetbridge3.jpg) - -Read carefully the warning and tap **Install**: - -![Gadgetbridge 4](gadgetbridge4.jpg) - -Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime! - -Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used. - -![Gadgetbridge 5](gadgetbridge5.jpg) - -### Using NRFConnect -Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear: - -![NRFConnect 0](nrfconnect0.jpg) - -Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right: - -![NRFConnect 1](nrfconnect1.jpg) - -Select **Distribution packet (ZIP)**: - -![NRFConnect 2](nrfconnect2.jpg) - -Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! - -Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used. - -![NRFConnect 3](nrfconnect3.jpg) - -## How to flash InfiniTime using the SWD interface -Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page: - -![Image file](imageFile.png ) - -The bootloader reads a boot logo from the external SPI flash memory. The first step consists in flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommanded (the bootloader will display garbage on screen for a few second if you don't do it). -Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display. - -Then, using your SWD tool, flash those file at specific offset: - - - bootloader.bin : **0x0000** - - image-x.y.z.bin : **0x8000** - -Reset and voilà, you're running InfiniTime on your PineTime! - -If you are using OpenOCD with a STLinkV2, you can find more info [on this page](../openOCD.md). - -## How to synchronize the time - -### Using Gadgetbridge -Good news! Gadgetbridge **automatically** synchronizes the time when connecting to your PineTime! - -### Using any Chromium-based web browser -You can use it from your PC, Mac, Android. Browsers now have BLE support. -https://hubmartin.github.io/WebBLEWatch/ - -### Using NRFConnect -You must enable the **CTS** *GATT server* into NRFConnect so that InfiniTime can synchronize the time with your smartphone. - -Launch NRFConnect, tap the sandwich button on the top left and select *Configure GATT server*: - -![NRFConnect CTS 0](nrfconnectcts0.jpg) - - -Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established! - -![NRFConnect CTS 1](nrfconnectcts1.jpg) diff --git a/doc/gettingStarted/ota-gadgetbridge.md b/doc/gettingStarted/ota-gadgetbridge.md new file mode 100644 index 0000000..971eaad --- /dev/null +++ b/doc/gettingStarted/ota-gadgetbridge.md @@ -0,0 +1,39 @@ +# Connecting to Gadgetbridge + +Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device: + +![Gadgetbridge 0](gadgetbridge0.jpg) + +Wait for the scan to complete, your PineTime should be detected: + +![Gadgetbridge 1](gadgetbridge1.jpg) + +Tap on it. Gadgdetbridge will pair and connect to your device: + +![Gadgetbridge 2](gadgetbridge2.jpg) + +# Updating with Gadgetbridge + +## Preparation + +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). + +Release files are available under the *Assets* button. + +You need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip` + +## Gadgetbridge + +Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: + +![Gadgetbridge 3](gadgetbridge3.jpg) + +Read carefully the warning and tap **Install**: + +![Gadgetbridge 4](gadgetbridge4.jpg) + +Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime! + +Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used. + +![Gadgetbridge 5](gadgetbridge5.jpg) diff --git a/doc/gettingStarted/ota-nrfconnect.md b/doc/gettingStarted/ota-nrfconnect.md new file mode 100644 index 0000000..dbc7829 --- /dev/null +++ b/doc/gettingStarted/ota-nrfconnect.md @@ -0,0 +1,32 @@ +# Updating with NRFConnect + +## Preparation + +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). + +Release files are available under the *Assets* button. + +You need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip` + +## NRFConnect + +Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear: + +![NRFConnect 0](nrfconnect0.jpg) + +Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right: + +![NRFConnect 1](nrfconnect1.jpg) + +Select **Distribution packet (ZIP)**: + +![NRFConnect 2](nrfconnect2.jpg) + +Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! + +Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used. + +![NRFConnect 3](nrfconnect3.jpg) + +# Demo +[This video](https://seafile.codingfield.com/f/a52b69683a05472a90c7/) shows how to use NRFConnect to update the firmware running on the Pinetime. diff --git a/doc/gettingStarted/time-nrfconnect.md b/doc/gettingStarted/time-nrfconnect.md new file mode 100644 index 0000000..a30d98f --- /dev/null +++ b/doc/gettingStarted/time-nrfconnect.md @@ -0,0 +1,11 @@ +### Syncing time + +You must enable the **CTS** *GATT server* in NRFConnect so that InfiniTime can synchronize the time with your smartphone. + +Launch NRFConnect, tap the sandwich button on the top left and select *Configure GATT server*: + +![NRFConnect CTS 0](nrfconnectcts0.jpg) + +Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established! + +![NRFConnect CTS 1](nrfconnectcts1.jpg) diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md new file mode 100644 index 0000000..1ad0040 --- /dev/null +++ b/doc/gettingStarted/updating-software.md @@ -0,0 +1,50 @@ +## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it? + +You might have already seen these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and, you may find them confusing if you're not familiar with the project. + +Basically, a **firmware** is just a software running on the embedded hardware of a device, the PineTime in this case. +**InfiniTime OS** is based on 3 distinct **firmwares**: + - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** itself, this is the *application firmware* running on the PineTime. This is the main firmware which provides most of the functionalities you'll use on a daily basis : bluetooth low-energy (BLE) connectivity, applications, watchfaces,... + - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying **updates** of the *application firmware*, reverting them in case of issues and load the recovery firmware when requested. + - **The recovery firmware** is a specific *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. Currently, this recovery firmware is based on [InfiniTime 0.14.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1). + +**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**evice **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). + +## How to check the version of InfiniTime and the bootloader? + +You can check the InfiniTime version by first swiping right on the watchface to open quick settings, tapping the cogwheel to open settings, swipe up until you find an entry named "About" and tap on it. + +![InfiniTime 1.0 version](version-1.0.jpg) + +PineTimes shipped after June 2021 will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.0.0). + +The bootloader only runs when the watch starts (from an empty battery, for example) or after a reset (after a successful OTA or a manual reset - long push on the button). + +The bootloader is easily recognizable with its white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now). + +![Bootloader 1.0](bootloader-1.0.jpg) + +## How to update your PineTime? + +To update your PineTime, you can use one of the compatible companion applications. Here are the main ones: + + - **[Amazfish](https://github.com/piggz/harbour-amazfish)** (Desktop Linux, mobile Linux, SailfishOS, runs on the PinebookPro and the Pinephone) + - **[Gadgetbridge](https://www.gadgetbridge.org/)** (Android) + - **[Siglo](https://github.com/alexr4535/siglo)** (Linux, GTK based) + - **NRFConnect** (closed source, Android & iOS) + +We have instructions for updating the software with Gadgetbridge and NRFConnect. + + - [Updating with Gadgetbridge](/doc/gettingStarted/ota-gadgetbridge.md) + - [Updating with NRFConnect](/doc/gettingStarted/ota-nrfconnect.md) + +### Firmware validation + +The bootloader requires a manual validation of the firmware. If the watch reset with an updated firmware that was not validated, the bootloader will consider it as non-functioning and will revert to the previous version of the firmware. This is a safety feature to prevent bricking your device with a faulty firmware. + +You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure: + + - From the watchface, swipe **right** to display the *quick settings menu* + - Open settings by tapping the cogwheel on the bottom right + - Swipe up until you find an entry named **Firmware** and tap on it + - This app shows the version that is currently running. If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version diff --git a/images/infinitime-logo-github.jpg b/images/infinitime-logo-github.jpg deleted file mode 100644 index cf19e35..0000000 Binary files a/images/infinitime-logo-github.jpg and /dev/null differ diff --git a/images/infinitime-logo-small.jpg b/images/infinitime-logo-small.jpg new file mode 100644 index 0000000..9949f5b Binary files /dev/null and b/images/infinitime-logo-small.jpg differ -- cgit v0.10.2 From cf9332f0e502007fa04e0a4cdf9f0b1a2d97508f Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 6 Nov 2021 14:48:51 +0200 Subject: Crop and shrink photos diff --git a/doc/gettingStarted/appmenu.jpg b/doc/gettingStarted/appmenu.jpg index 1e52fe7..5e3d6a8 100644 Binary files a/doc/gettingStarted/appmenu.jpg and b/doc/gettingStarted/appmenu.jpg differ diff --git a/doc/gettingStarted/bootloader-1.0.jpg b/doc/gettingStarted/bootloader-1.0.jpg index 7b63918..a21f88f 100644 Binary files a/doc/gettingStarted/bootloader-1.0.jpg and b/doc/gettingStarted/bootloader-1.0.jpg differ diff --git a/doc/gettingStarted/quickactions.jpg b/doc/gettingStarted/quickactions.jpg index 0d92b13..3bbe162 100644 Binary files a/doc/gettingStarted/quickactions.jpg and b/doc/gettingStarted/quickactions.jpg differ diff --git a/doc/gettingStarted/settings.jpg b/doc/gettingStarted/settings.jpg index 510b29e..075708a 100644 Binary files a/doc/gettingStarted/settings.jpg and b/doc/gettingStarted/settings.jpg differ diff --git a/doc/gettingStarted/version-1.0.jpg b/doc/gettingStarted/version-1.0.jpg index bcfc8c6..59655b1 100644 Binary files a/doc/gettingStarted/version-1.0.jpg and b/doc/gettingStarted/version-1.0.jpg differ -- cgit v0.10.2 From c3c5ab347308d820843d2076db5543ffa93934d1 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 6 Nov 2021 14:58:10 +0200 Subject: Reorganization diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md index a688193..074c34a 100644 --- a/doc/gettingStarted/gettingStarted-1.0.md +++ b/doc/gettingStarted/gettingStarted-1.0.md @@ -13,11 +13,12 @@ By default, InfiniTime starts on the digital watchface. It'll probably display t You can sync the time using companion apps. - Gadgetbridge automatically synchronizes the time when you connect it to your watch. More information on Gadgetbridge [here](/doc/gettingStarted/ota-gadgetbridge.md) - - You can use NRFConnect to [sync the time](/doc/gettingStarted/time-nrfconnect.md) + - [Sync the time with NRFConnect](/doc/gettingStarted/time-nrfconnect.md) - Sync the time with your browser https://hubmartin.github.io/WebBLEWatch/ - - Since InfiniTime 1.7.0, you can set the time in the settings without needing to use a companion app -## Navigation in the menu +Since InfiniTime 1.7.0, you can set the time in the settings without needing to use a companion app + +### Navigation in the menu ![Quick actions](quickactions.jpg) ![Settings](settings.jpg) @@ -31,14 +32,3 @@ You can sync the time using companion apps. - Enable/disable vibrations on notifications (Do Not Disturb mode) - Enter the **settings** menu - Swipe up and down to see all options - -### Bootloader - -Most of the time, the bootloader just runs without your intervention (update and load the firmware). - -However, you can enable 2 functionalities using the push button: - - - Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one - - Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality. - -More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md). diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md index 1ad0040..52d3516 100644 --- a/doc/gettingStarted/updating-software.md +++ b/doc/gettingStarted/updating-software.md @@ -48,3 +48,14 @@ You can validate your updated firmware on InfiniTime >= 1.0 by following this si - Open settings by tapping the cogwheel on the bottom right - Swipe up until you find an entry named **Firmware** and tap on it - This app shows the version that is currently running. If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version + +## Bootloader + +Most of the time, the bootloader just runs without your intervention (update and load the firmware). + +However, you can enable 2 functionalities using the push button: + + - Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one + - Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality. + +More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md). -- cgit v0.10.2 From 1d3098baa772176476febb05531a074c0d133b56 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sat, 6 Nov 2021 15:04:37 +0200 Subject: Update ui_guidelines diff --git a/README.md b/README.md index 22c91b5..ecda014 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. - [How to implement an application](doc/code/Apps.md) - [Generate the fonts and symbols](src/displayapp/fonts/README.md) - [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html) + - [Tips on designing an app UI](doc/ui_guidelines.md) ### Build, flash and debug diff --git a/doc/ui_guidelines.md b/doc/ui_guidelines.md index c267b79..0cbd39f 100644 --- a/doc/ui_guidelines.md +++ b/doc/ui_guidelines.md @@ -4,13 +4,10 @@ - Buttons should generally be at least 50px high - Buttons should generally be on the bottom edge - Make interactable objects **big** -- Recommendations for inner padding, aka distance between buttons: - - When aligning 4 objects: 4px, e.g. Settings - - When aligning 3 objects: 6px, e.g. App list - - When aligning 2 objects: 10px, e.g. Quick settings - When using a page indicator, leave 8px for it on the right side - It is acceptable to leave 8px on the left side as well to center the content - Top bar takes at least 20px + padding - Top bar right icons move 8px to the left when using a page indicator +- A black background helps to hide the screen border, allowing the UI to look less cramped when utilizing the entire display area. ![example layouts](./ui/example.png) -- cgit v0.10.2 From 52d19065893f6af66fa0e1c426852b820358f3b5 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 7 Nov 2021 18:30:29 +0200 Subject: Separate and update coding conventions and contributing pages diff --git a/README.md b/README.md index ecda014..4b80ef3 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. ## Documentation ### Develop + - [Coding conventions](/doc/coding-convention.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) @@ -48,9 +49,9 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. This project is far from being finished, and there are still a lot of things to do for this project to become a firmware usable by the general public. -Do not hesitate to fork the code, hack it and create pull-requests! +Do not hesitate to fork the code, hack it and create pull-requests! Make sure to read the [coding conventions](/doc/coding-convention.md) -Read this page for more information on how you can help: [How to contribute?](doc/contribute.md) +You don't need to be a programmer to contribute. Read this page for more information on how you can help: [How to contribute?](doc/contribute.md) ## Licenses diff --git a/doc/coding-convention.md b/doc/coding-convention.md new file mode 100644 index 0000000..6672d54 --- /dev/null +++ b/doc/coding-convention.md @@ -0,0 +1,40 @@ +# Coding convention + +## Language + +The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction. + +C code is accepted if it comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK. + +## Coding style + +The most important rule to follow is to try to keep the code as easy to read and maintain as possible. + +Using an autoformatter is highly recommended, but make sure it's configured properly. + +There are preconfigured autoformatter rules for: + + * CLion (IntelliJ) in [.idea/codeStyles/Project.xml](/.idea/codeStyles/Project.xml) + * `clang-format` + +Also use `clang-tidy` to check the code for other issues. + +If there are no preconfigured rules for your IDE, you can use one of the existing ones to configure your IDE. + + - **Indentation** : 2 spaces, no tabulation + - **Opening brace** at the end of the line + - **Naming** : Choose self-describing variable name + - **class** : PascalCase + - **namespace** : PascalCase + - **variable** : camelCase, **no** prefix/suffix ('_', 'm_',...) for class members + - **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`) + - **Includes** : + - files from the project : `#include "relative/path/to/the/file.h"` + - external files and std : `#include ` + - Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative) + - Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name. + - Examples: + - `auto* app = static_cast(instance);` + - `auto number = static_cast(variable);` + - `uint8_t returnValue = MyFunction();` + - Use nullptr instead of NULL diff --git a/doc/contribute.md b/doc/contribute.md index 595a599..70fc567 100644 --- a/doc/contribute.md +++ b/doc/contribute.md @@ -14,10 +14,6 @@ As the documentation is part of the source code, you can submit your improvement You want to fix a bug, add a cool new functionality or improve the code? See *How to submit a pull request below*. -## Spread the word - -The Pinetime is a cool open source project that deserves to be known. Talk about it around you, on social networks, on your blog,... and let people know that we are working on an open source firmware for a smartwatch! - # How to submit a pull request? ## TL;DR @@ -25,7 +21,7 @@ The Pinetime is a cool open source project that deserves to be known. Talk about - Create a branch from develop - Work on a single subject in this branch. Create multiple branches/pulls-requests if you want to work on multiple subjects (bugs, features,...) - Test your modifications on the actual hardware - - Check the code formatting against our coding conventions and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) + - Check your code against the [coding conventions](/doc/coding-convention.md) and [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) - Clean your code and remove files that are not needed - Write documentation related to your new feature if applicable - Create a pull request and write a great description about it: what does your PR do, why, how,... Add pictures and video if possible @@ -38,9 +34,9 @@ If you want to fix a bug, add functionality or improve the code, you'll first ne When your feature branch is ready, **make sure it actually works** and **do not forget to write documentation** about it if it's relevant. -**Creating a pull request containing modifications that haven't been tested is strongly discouraged.** If, for any reason, you cannot test your modifications but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code. +**Creating a pull request containing modifications that haven't been tested is strongly discouraged.** If for any reason you cannot test your modifications, but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code. -Also, before submitting your PR, check the coding style of your code against the **coding conventions** detailed below. This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You can use them to ensure correct formatting of your code. +Before submitting a PR, check your code against our [coding conventions](/doc/coding-convention.md). This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You should use them to ensure correct formatting of your code. Don't forget to check the files you are going to commit and remove those which aren't necessary (config files from your IDE, for example). Remove old comments, commented code,... @@ -52,52 +48,14 @@ Once the pull request is reviewed and accepted, it'll be merged into **develop** ## Why all these rules? -Reviewing pull requests is a **very time consuming task** for the creator of this project ([JF002](https://github.com/JF002)) and for other contributors who take the time to review them. Everything you do to make reviewing easier will **get your PR merged faster**. +Reviewing pull requests is a **very time consuming task**. Everything you do to make reviewing easier will **get your PR merged faster**. -When reviewing PRs, the author and contributors will first look at the **description**. If it's easy to understand what the PR does, why the modification is needed or interesting and how it's done, a good part of the work is already done : we understand the PR and its context. +Reviewers will first look at the **description**. If it's easy to understand what the PR does, why the modification is needed or interesting and how it's done, a good part of the work is already done : we understand the PR and its context. -Then, reviewing **a few files that were modified for a single purpose** is a lot more easier than to review 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all these changes make sense. Also, it's possible that we agree on some modification but not on some other, so we won't be able to merge the PR because of the changes that are not accepted. +Reviewing **a few files that were modified for a single purpose** is a lot easier than reviewing 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all the changes make sense. Also, it's possible that we agree on some modification but not on another, so we won't be able to merge the PR because of the changes that are not accepted. -We do our best to keep the code as consistent as possible. If the formatting of the code in your PR is not consistent with our code base, we'll ask you to review it, which will take more time. +We do our best to keep the code as consistent as possible. If the formatting of your code is not consistent with our code base, we'll ask you to review it. -The last step of the review consists of **testing** the modification. If it doesn't work out of the box, we'll ask your to review your code and to ensure that it works as expected. +Lastly the changes are tested. If it doesn't work out of the box, we'll ask your to review your code and to ensure that it works as expected. It's totally normal for a PR to need some more work even after it was created, that's why we review them. But every round trip takes time, so it's good practice to try to reduce them as much as possible by following those simple rules. - -# Coding convention - -## Language - -The language of this project is **C++**, and all new code must be written in C++. (Modern) C++ provides a lot of useful tools and functionalities that are beneficial for embedded software development like `constexpr`, `template` and anything that provides zero-cost abstraction. - -C code is accepted if it comes from another library like FreeRTOS, NimBLE, LVGL or the NRF-SDK. - -## Coding style - -The most important rule to follow is to try to keep the code as easy to read and maintain as possible. - -Using an autoformatter is highly recommended, but make sure it's configured properly. - -There are preconfigured autoformatter rules for: - - * CLion (IntelliJ) in .idea/codeStyles/Project.xml - -If there are no preconfigured rules for your IDE, you can use one of the existing ones to configure your IDE. - - - **Indentation** : 2 spaces, no tabulation - - **Opening brace** at the end of the line - - **Naming** : Choose self-describing variable name - - **class** : PascalCase - - **namespace** : PascalCase - - **variable** : camelCase, **no** prefix/suffix ('_', 'm_',...) for class members - - **Include guard** : `#pragma once` (no `#ifdef __MODULE__ / #define __MODULE__ / #endif`) - - **Includes** : - - files from the project : `#include "relative/path/to/the/file.h"` - - external files and std : `#include ` - - Only use [primary spellings for operators and tokens](https://en.cppreference.com/w/cpp/language/operator_alternative) - - Use auto sparingly. Don't use auto for [fundamental/built-in types](https://en.cppreference.com/w/cpp/language/types) and [fixed width integer types](https://en.cppreference.com/w/cpp/types/integer), except when initializing with a cast to avoid duplicating the type name. - - Examples: - - `auto* app = static_cast(instance);` - - `auto number = static_cast(variable);` - - `uint8_t returnValue = MyFunction();` - - Use nullptr instead of NULL -- cgit v0.10.2 From 2314c41ad66836fe4142d73895ad0ae2ad18651c Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 7 Nov 2021 18:45:24 +0200 Subject: Reorganize bootloader readme diff --git a/bootloader/README.md b/bootloader/README.md index 9f99602..1a02ebd 100644 --- a/bootloader/README.md +++ b/bootloader/README.md @@ -115,8 +115,6 @@ sudo dfu.py -z /home/jf/nrf52/bootloader/dfu.zip -a --leg **Note** : dfu.py is a slightly modified version of [this repo](https://github.com/daniel-thompson/ota-dfu-python). -See [this page](../doc/CompanionApps/NrfconnectOTA.md) for more info about OTA with NRFConect - ### Firmware validation Once the OTA is done, InfiniTime will reset the watch to apply the update. When the watch reboots, the new firmware is running. @@ -126,12 +124,12 @@ If the new firmware is working correctly, open the application menu and tap on t Firmware validation application in the menu: -![Firmware Validation App](../doc/CompanionApps/firmwareValidationApp.jpg "Firmware Validation App") +![Firmware Validation App](../doc/bootloader/firmwareValidationApp.jpg "Firmware Validation App") The firmware is not validated yet. Tap 'Validate' to validate it, or 'Reset' to rollback to the previous version. -![Firmware Not Validated](../doc/CompanionApps/firmwareNoValidated.jpg "Firmware Not Validated") +![Firmware Not Validated](../doc/bootloader/firmwareNoValidated.jpg "Firmware Not Validated") The firmware is validated! -![Firmware Validated](../doc/CompanionApps/firmwareValidated.jpg "Firmware Validated") +![Firmware Validated](../doc/bootloader/firmwareValidated.jpg "Firmware Validated") diff --git a/doc/bootloader/firmwareNoValidated.jpg b/doc/bootloader/firmwareNoValidated.jpg new file mode 100644 index 0000000..28df7ea Binary files /dev/null and b/doc/bootloader/firmwareNoValidated.jpg differ diff --git a/doc/bootloader/firmwareValidated.jpg b/doc/bootloader/firmwareValidated.jpg new file mode 100644 index 0000000..0d6f99b Binary files /dev/null and b/doc/bootloader/firmwareValidated.jpg differ diff --git a/doc/bootloader/firmwareValidationApp.jpg b/doc/bootloader/firmwareValidationApp.jpg new file mode 100644 index 0000000..d78ad0c Binary files /dev/null and b/doc/bootloader/firmwareValidationApp.jpg differ diff --git a/doc/companionapps/firmwareNoValidated.jpg b/doc/companionapps/firmwareNoValidated.jpg deleted file mode 100644 index 28df7ea..0000000 Binary files a/doc/companionapps/firmwareNoValidated.jpg and /dev/null differ diff --git a/doc/companionapps/firmwareValidated.jpg b/doc/companionapps/firmwareValidated.jpg deleted file mode 100644 index 0d6f99b..0000000 Binary files a/doc/companionapps/firmwareValidated.jpg and /dev/null differ diff --git a/doc/companionapps/firmwareValidationApp.jpg b/doc/companionapps/firmwareValidationApp.jpg deleted file mode 100644 index d78ad0c..0000000 Binary files a/doc/companionapps/firmwareValidationApp.jpg and /dev/null differ -- cgit v0.10.2 From a0c7b48b8eb6f2b59dcaec846c5ed46aeabf1e6a Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 7 Nov 2021 18:55:51 +0200 Subject: Replace companionapp pages with links. Add companion apps diff --git a/README.md b/README.md index 4b80ef3..2214a35 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,10 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) - [About the software and updating](doc/gettingStarted/updating-software.md) - Companion apps: - - [Gadgetbridge](doc/companionapps/Gadgetbridge.md) - - [AmazFish](doc/companionapps/Amazfish.md) + - [Gadgetbridge](https://gadgetbridge.org/) (Android) + - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) + - [Siglo](https://github.com/alexr4535/siglo) (Linux) + - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS) ## Documentation diff --git a/doc/companionapps/Amazfish.md b/doc/companionapps/Amazfish.md deleted file mode 100644 index 90ad20c..0000000 --- a/doc/companionapps/Amazfish.md +++ /dev/null @@ -1,16 +0,0 @@ -# Amazfish -[Amazfish](https://openrepos.net/content/piggz/amazfish) is a companion app that supports many smartwatches and activity trackers running on [SailfishOS](https://sailfishos.org/). - -## Features -The following features are implemented: - - Scanning & detection of Pinetime-JF / InfiniTime - - Connection / disconnection - - Time synchronization - - Notifications - - Music control - - Navigation with Puremaps - -## Demo -[This video](https://seafile.codingfield.com/f/21c5d023452740279e36/) shows how to connect to the Pinetime and control the playback of the music on the phone. -Amazfish and Sailfish OS are running on the [Pinephone](https://www.pine64.org/pinephone/), another awesome device from Pine64. - diff --git a/doc/companionapps/Gadgetbridge.md b/doc/companionapps/Gadgetbridge.md deleted file mode 100644 index 678fe7a..0000000 --- a/doc/companionapps/Gadgetbridge.md +++ /dev/null @@ -1,7 +0,0 @@ -# Integration with Gadgetbridge -[Gadgetbridge](https://gadgetbridge.org/) is an Android application that supports many smartwatches and fitness trackers. - -Gadgetbridge supports InfiniTime [starting with version 0.47](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/branch/master/CHANGELOG.md). Note that the official version is only available on F-Droid (as of May 2021), and the unofficial fork available on the Play Store is outdated and does not support InfiniTime. - -## Demo -[This video](https://seafile.codingfield.com/f/0a2920b9d765462385e4/) shows how to scan, connect, send notification (using the debug screen) and disconnect from the PineTime. -- cgit v0.10.2 From 88e55b2504f52c7d89f733bf5141bc67e525d908 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 7 Nov 2021 19:38:54 +0200 Subject: Update updating instructions diff --git a/doc/gettingStarted/ota-gadgetbridge.md b/doc/gettingStarted/ota-gadgetbridge.md index 971eaad..022b5e4 100644 --- a/doc/gettingStarted/ota-gadgetbridge.md +++ b/doc/gettingStarted/ota-gadgetbridge.md @@ -14,17 +14,7 @@ Tap on it. Gadgdetbridge will pair and connect to your device: # Updating with Gadgetbridge -## Preparation - -All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). - -Release files are available under the *Assets* button. - -You need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip` - -## Gadgetbridge - -Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: +Now that Gadgetbridge is connected to your PineTime, use a file browser application and find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: ![Gadgetbridge 3](gadgetbridge3.jpg) diff --git a/doc/gettingStarted/ota-nrfconnect.md b/doc/gettingStarted/ota-nrfconnect.md index dbc7829..800bd6b 100644 --- a/doc/gettingStarted/ota-nrfconnect.md +++ b/doc/gettingStarted/ota-nrfconnect.md @@ -1,15 +1,5 @@ # Updating with NRFConnect -## Preparation - -All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). - -Release files are available under the *Assets* button. - -You need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip` - -## NRFConnect - Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear: ![NRFConnect 0](nrfconnect0.jpg) @@ -22,7 +12,7 @@ Select **Distribution packet (ZIP)**: ![NRFConnect 2](nrfconnect2.jpg) -Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! +Find the DFU file (`pinetime-mcuboot-app-dfu-x.x.x.zip`) you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! Don't forget to **validate** your firmware. In the InfiniTime go to the settings (swipe right, select gear icon) and Firmware option and click **validate**. Otherwise after reboot the previous firmware will be used. diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md index 52d3516..214200a 100644 --- a/doc/gettingStarted/updating-software.md +++ b/doc/gettingStarted/updating-software.md @@ -26,14 +26,17 @@ The bootloader is easily recognizable with its white pine cone that is progressi ## How to update your PineTime? -To update your PineTime, you can use one of the compatible companion applications. Here are the main ones: +To update your PineTime, you can use one of the compatible companion applications. - - **[Amazfish](https://github.com/piggz/harbour-amazfish)** (Desktop Linux, mobile Linux, SailfishOS, runs on the PinebookPro and the Pinephone) - - **[Gadgetbridge](https://www.gadgetbridge.org/)** (Android) - - **[Siglo](https://github.com/alexr4535/siglo)** (Linux, GTK based) - - **NRFConnect** (closed source, Android & iOS) +The updating process differs slightly on every companion app, so you'll need to familiarize yourself with the companion app of your choice. -We have instructions for updating the software with Gadgetbridge and NRFConnect. +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). + +Release files are available under the *Assets* button. + +To update the firmware, you need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip`, and flash it with your companion app. + +We have prepared instructions for flashing InfiniTime with Gadgetbridge and NRFConnect. - [Updating with Gadgetbridge](/doc/gettingStarted/ota-gadgetbridge.md) - [Updating with NRFConnect](/doc/gettingStarted/ota-nrfconnect.md) -- cgit v0.10.2 From e53f1bfd668a5c130352616aceb6c660821dc14c Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 17:37:25 +0200 Subject: Summarize updating-softare diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md index 214200a..4058672 100644 --- a/doc/gettingStarted/updating-software.md +++ b/doc/gettingStarted/updating-software.md @@ -1,14 +1,18 @@ ## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it? -You might have already seen these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and, you may find them confusing if you're not familiar with the project. +You may have already encountered these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and you may find them confusing if you're not familiar with the project. -Basically, a **firmware** is just a software running on the embedded hardware of a device, the PineTime in this case. -**InfiniTime OS** is based on 3 distinct **firmwares**: - - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** itself, this is the *application firmware* running on the PineTime. This is the main firmware which provides most of the functionalities you'll use on a daily basis : bluetooth low-energy (BLE) connectivity, applications, watchfaces,... - - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying **updates** of the *application firmware*, reverting them in case of issues and load the recovery firmware when requested. - - **The recovery firmware** is a specific *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. Currently, this recovery firmware is based on [InfiniTime 0.14.1](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1). +A **firmware** is software running on the embedded hardware of a device. -**OTA** and **DFU** refer to the update of the firmware over BLE (**B**luetooth **L**ow **E**nergy). **OTA** means **O**ver **T**he **A**ir, this is a functionality that allows the user to update the firmware how their device using a wireless communication like BLE. When we talk about **DFU** (**D**evice **F**irmware **U**pdate), we refer to the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). +InfiniTime has three distinct firmwares: + + - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** is the operating system. + - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying firmware updates and runs before booting into InfiniTime. + - **The recovery firmware** is a special *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. + +**OTA** (**O**ver **T**he **A**ir) refers to updating of the firmware over BLE (**B**luetooth **L**ow **E**nergy). This is a functionality that allows the user to update the firmware on their device wirelessly. + +**DFU** (**D**evice **F**irmware **U**pdate) is the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). ## How to check the version of InfiniTime and the bootloader? @@ -18,7 +22,7 @@ You can check the InfiniTime version by first swiping right on the watchface to PineTimes shipped after June 2021 will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.0.0). -The bootloader only runs when the watch starts (from an empty battery, for example) or after a reset (after a successful OTA or a manual reset - long push on the button). +The bootloader is run right before booting to InfiniTime. The bootloader is easily recognizable with its white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now). @@ -30,9 +34,7 @@ To update your PineTime, you can use one of the compatible companion application The updating process differs slightly on every companion app, so you'll need to familiarize yourself with the companion app of your choice. -All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases). - -Release files are available under the *Assets* button. +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/InfiniTimeOrg/InfiniTime/releases) under assets. To update the firmware, you need to download the DFU of the firmware version that you'd like to install, for example `pinetime-mcuboot-app-dfu-1.6.0.zip`, and flash it with your companion app. @@ -43,14 +45,14 @@ We have prepared instructions for flashing InfiniTime with Gadgetbridge and NRFC ### Firmware validation -The bootloader requires a manual validation of the firmware. If the watch reset with an updated firmware that was not validated, the bootloader will consider it as non-functioning and will revert to the previous version of the firmware. This is a safety feature to prevent bricking your device with a faulty firmware. +Firmware updates must be manually validated. If the firmware isn't validated and the watch resets, the watch will revert to the previous firmware. This is a safety feature to prevent bricking your device with faulty firmware. You can validate your updated firmware on InfiniTime >= 1.0 by following this simple procedure: - From the watchface, swipe **right** to display the *quick settings menu* - Open settings by tapping the cogwheel on the bottom right - Swipe up until you find an entry named **Firmware** and tap on it - - This app shows the version that is currently running. If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version + - If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version ## Bootloader -- cgit v0.10.2 From 5eaae4175c19f0e2752d3e27372f5aa578dec980 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 17:38:21 +0200 Subject: Fix versioning diff --git a/doc/versioning.md b/doc/versioning.md index 48e0504..8b87d47 100644 --- a/doc/versioning.md +++ b/doc/versioning.md @@ -1,6 +1,6 @@ # Versioning -The versioning of this project is based on [Semantic versionning](https://semver.org/) : +The versioning of this project is based on [Semantic versioning](https://semver.org/): - The **patch** is incremented when we fix a bug on a **released** version (most of the time using a **hotfix** branch). - The **minor** is incremented when we release a new version with new features. It corresponds to a merge of **develop** into **master**. - - The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. For now, I suggest that it stays **0** until we have a fully functioning firmware suited for the final user. \ No newline at end of file + - The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. -- cgit v0.10.2 From d1583035d9564ca49d00711cf53ad07a35038b7c Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 17:42:42 +0200 Subject: Link to companion apps diff --git a/README.md b/README.md index 2214a35..b85dba3 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) - [About the software and updating](doc/gettingStarted/updating-software.md) - - Companion apps: - - [Gadgetbridge](https://gadgetbridge.org/) (Android) - - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) - - [Siglo](https://github.com/alexr4535/siglo) (Linux) - - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS) +### Companion apps + - [Gadgetbridge](https://gadgetbridge.org/) (Android) + - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) + - [Siglo](https://github.com/alexr4535/siglo) (Linux) + - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS) ## Documentation diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md index 4058672..316d77f 100644 --- a/doc/gettingStarted/updating-software.md +++ b/doc/gettingStarted/updating-software.md @@ -30,7 +30,7 @@ The bootloader is easily recognizable with its white pine cone that is progressi ## How to update your PineTime? -To update your PineTime, you can use one of the compatible companion applications. +To update your PineTime, you can use one of the [compatible companion applications](/README.md#companion-apps). The updating process differs slightly on every companion app, so you'll need to familiarize yourself with the companion app of your choice. -- cgit v0.10.2 From c12fc5e3132f88e2b134f9feed70a8bc1cae5e7f Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 18:11:29 +0200 Subject: Improvements to Apps.md and Intro.md diff --git a/doc/code/Apps.md b/doc/code/Apps.md index 7c2d7a0..b8e4a3f 100644 --- a/doc/code/Apps.md +++ b/doc/code/Apps.md @@ -1,11 +1,12 @@ # Apps This page will teach you: -- what apps in InfiniTime are +- what screens and apps are in InfiniTime - how to implement your own app ## Theory -Apps are the things you can launch from the app selection you get by swiping up. -At the moment, settings and even the app launcher itself or the clock are implemented very similarly, this might change in the future though. + +The user interface of InfiniTime is made up of **screens** +Screens that are opened from the app launcher are considered **apps** Every app in InfiniTime is it's own class. An instance of the class is created when the app is launched and destroyed when the user exits the app. They run inside the "displayapp" task (briefly discussed [here](./Intro.md)). @@ -23,27 +24,21 @@ it does not need to override any of these functions, as LVGL can also handle tou If you have any doubts, you can always look at how the other apps are doing things. ### Continuous updating -If your app needs to be updated continuously, yo can do so by overriding the `Refresh()` function in your class +If your app needs to be updated continuously, you can do so by overriding the `Refresh()` function in your class and calling `lv_task_create` inside the constructor. -An example call could look like this:
-`taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);`
-With `taskRefresh` being a member variable of your class and of type `lv_task_t*`. -Remember to delete the task again using `lv_task_del`. -The function `RefreshTaskCallback` is inherited from screen and just calls your `Refresh` function. -### Apps with multiple screens -InfiniTime provides a mini-library in [displayapp/screens/ScreenList.h](/src/displayapp/screens/ScreenList.h) -which makes it relatively easy to add multiple screens to your app. -To use it, #include it in the header file of your app and add a ScreenList member to your class. -The template argument should be the number of screens you need. -You will also need to add `CreateScreen` functions that return `std::unique_ptr` -to your class, one for every screen you have. -There are still some things left to to that I won't cover here. -To figure them out, have a look at the "apps" ApplicationList, Settings and SystemInfo. +An example call could look like this: +```cpp +taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); +``` +With `taskRefresh` being a member variable of your class and of type `lv_task_t*`. +Remember to delete the task again using `lv_task_del`. +The function `RefreshTaskCallback` is inherited from `Screen` and just calls your `Refresh` function. ## Creating your own app -A minimal app could look like this:
+A minimal app could look like this: + MyApp.h: ```cpp #pragma once @@ -66,13 +61,13 @@ namespace Pinetime { MyApp.cpp: ```cpp -#include "MyApp.h" +#include "displayapp/screens/MyApp.h" #include "displayapp/DisplayApp.h" using namespace Pinetime::Applications::Screens; MyApp::MyApp(DisplayApp* app) : Screen(app) { - lv_obj_t* title = lv_label_create(lv_scr_act(), NULL); + lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(title, "My test application"); lv_label_set_align(title, LV_LABEL_ALIGN_CENTER); lv_obj_align(title, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); @@ -95,12 +90,10 @@ Now, go to the function `DisplayApp::LoadApp` and add another case to the switch The case will be the id you gave your app earlier. If your app needs any additional arguments, this is the place to pass them. -If you want your app to be launched from the regular app launcher, go to [displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp). -Add your app to one of the `CreateScreen` functions, or add another `CreateScreen` function if there are no empty spaces for your app.
-If your app is a setting, do the same procedure in [displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp). +If you want to add your app in the app launcher, add your app in [displayapp/screens/ApplicationList.cpp](/src/displayapp/screens/ApplicationList.cpp) to one of the `CreateScreen` functions, or add another `CreateScreen` function if there are no empty spaces for your app. If your app is a setting, do the same procedure in [displayapp/screens/settings/Settings.cpp](/src/displayapp/screens/settings/Settings.cpp). You should now be able to [build](../buildAndProgram.md) the firmware and flash it to your PineTime. Yay! Please remember to pay attention to the [UI guidelines](../ui_guidelines.md) -when designing an app that you want to include in mainstream InfiniTime. +when designing an app that you want to be included in InfiniTime. diff --git a/doc/code/Intro.md b/doc/code/Intro.md index 762102f..6764e58 100644 --- a/doc/code/Intro.md +++ b/doc/code/Intro.md @@ -21,7 +21,7 @@ Both functions are located inside [systemtask/SystemTask.cpp](/src/systemtask/Sy It also starts the **task "displayapp"**, which is responsible for launching and running apps, controlling the screen and handling touch events (or forwarding them to the active app). You can find the "displayapp" task inside [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp). There are also other tasks that are responsible for Bluetooth ("ll" and "ble" inside [libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c](/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c)) -and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)).
+and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)). While it is possible for you to create your own task when you need it, it is recommended to just add functionality to `SystemTask::Work()` if possible. If you absolutely need to create another task, try to guess how much [stack space](https://www.freertos.org/FAQMem.html#StackSize) (in words/4-byte packets) it will need instead of just typing in a large-ish number. -- cgit v0.10.2 From 3375c4e18764cd0ed1be8898a21695ff60540b22 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 18:13:27 +0200 Subject: Add missing periods diff --git a/doc/code/Apps.md b/doc/code/Apps.md index b8e4a3f..b1c7d20 100644 --- a/doc/code/Apps.md +++ b/doc/code/Apps.md @@ -5,8 +5,8 @@ This page will teach you: ## Theory -The user interface of InfiniTime is made up of **screens** -Screens that are opened from the app launcher are considered **apps** +The user interface of InfiniTime is made up of **screens**. +Screens that are opened from the app launcher are considered **apps**. Every app in InfiniTime is it's own class. An instance of the class is created when the app is launched and destroyed when the user exits the app. They run inside the "displayapp" task (briefly discussed [here](./Intro.md)). -- cgit v0.10.2 From a326e22986f69e40572e8ef0c0efde854ea7d386 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 18:16:28 +0200 Subject: Add line break diff --git a/doc/code/Intro.md b/doc/code/Intro.md index 6764e58..bf68c7a 100644 --- a/doc/code/Intro.md +++ b/doc/code/Intro.md @@ -22,6 +22,7 @@ It also starts the **task "displayapp"**, which is responsible for launching and You can find the "displayapp" task inside [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp). There are also other tasks that are responsible for Bluetooth ("ll" and "ble" inside [libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c](/src/libs/mynewt-nimble/porting/npl/freertos/src/nimble_port_freertos.c)) and periodic tasks like heartrate measurements ([heartratetask/HeartRateTask.cpp](/src/heartratetask/HeartRateTask.cpp)). + While it is possible for you to create your own task when you need it, it is recommended to just add functionality to `SystemTask::Work()` if possible. If you absolutely need to create another task, try to guess how much [stack space](https://www.freertos.org/FAQMem.html#StackSize) (in words/4-byte packets) it will need instead of just typing in a large-ish number. -- cgit v0.10.2 From caec4a560b46f30f08f03ea5cff4c902034956e4 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Mon, 8 Nov 2021 19:14:23 +0200 Subject: Replace some "we" diff --git a/doc/contribute.md b/doc/contribute.md index 70fc567..b1be84a 100644 --- a/doc/contribute.md +++ b/doc/contribute.md @@ -36,7 +36,7 @@ When your feature branch is ready, **make sure it actually works** and **do not **Creating a pull request containing modifications that haven't been tested is strongly discouraged.** If for any reason you cannot test your modifications, but want to publish them anyway, **please mention it in the description**. This way, other contributors might be willing to test it and provide feedback about your code. -Before submitting a PR, check your code against our [coding conventions](/doc/coding-convention.md). This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You should use them to ensure correct formatting of your code. +Before submitting a PR, check your code against the [coding conventions](/doc/coding-convention.md). This project also provides [clang-format](../.clang-format) and [clang-tidy](../.clang-tidy) configuration files. You should use them to ensure correct formatting of your code. Don't forget to check the files you are going to commit and remove those which aren't necessary (config files from your IDE, for example). Remove old comments, commented code,... @@ -54,8 +54,8 @@ Reviewers will first look at the **description**. If it's easy to understand wha Reviewing **a few files that were modified for a single purpose** is a lot easier than reviewing 30 files modified for many reasons (bug fix, UI improvements, typos in doc,...), even if all the changes make sense. Also, it's possible that we agree on some modification but not on another, so we won't be able to merge the PR because of the changes that are not accepted. -We do our best to keep the code as consistent as possible. If the formatting of your code is not consistent with our code base, we'll ask you to review it. +The code base should be kept as consistent as possible. If the formatting of your code is not consistent with the rest of the code base, we'll ask you to review it. -Lastly the changes are tested. If it doesn't work out of the box, we'll ask your to review your code and to ensure that it works as expected. +Lastly the changes are tested. If it doesn't work out of the box, we'll ask you to review your code and to ensure that it works as expected. It's totally normal for a PR to need some more work even after it was created, that's why we review them. But every round trip takes time, so it's good practice to try to reduce them as much as possible by following those simple rules. diff --git a/doc/versioning.md b/doc/versioning.md index 8b87d47..2fa36ab 100644 --- a/doc/versioning.md +++ b/doc/versioning.md @@ -1,6 +1,6 @@ # Versioning The versioning of this project is based on [Semantic versioning](https://semver.org/): - - The **patch** is incremented when we fix a bug on a **released** version (most of the time using a **hotfix** branch). - - The **minor** is incremented when we release a new version with new features. It corresponds to a merge of **develop** into **master**. + - The **patch** is incremented when a bug is fixed on a **released** version (most of the time using a **hotfix** branch). + - The **minor** is incremented when a new version with new features is released. It corresponds to a merge of **develop** into **master**. - The **major** should be incremented when a breaking change is made to the application. We still have to define what is a breaking change in the context of this project. -- cgit v0.10.2 From 45a90e4967e10b31d148ae9c68123751d0e6bf6b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Thu, 11 Nov 2021 14:26:08 +0200 Subject: Update getting started. New pics. More information. diff --git a/doc/gettingStarted/appmenu-071.jpg b/doc/gettingStarted/appmenu-071.jpg deleted file mode 100644 index dee7c8f..0000000 Binary files a/doc/gettingStarted/appmenu-071.jpg and /dev/null differ diff --git a/doc/gettingStarted/appmenu.jpg b/doc/gettingStarted/appmenu.jpg deleted file mode 100644 index 5e3d6a8..0000000 Binary files a/doc/gettingStarted/appmenu.jpg and /dev/null differ diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md index 074c34a..939dfe5 100644 --- a/doc/gettingStarted/gettingStarted-1.0.md +++ b/doc/gettingStarted/gettingStarted-1.0.md @@ -16,19 +16,42 @@ You can sync the time using companion apps. - [Sync the time with NRFConnect](/doc/gettingStarted/time-nrfconnect.md) - Sync the time with your browser https://hubmartin.github.io/WebBLEWatch/ -Since InfiniTime 1.7.0, you can set the time in the settings without needing to use a companion app +You can also set the time in the settings without a companion app. (version >1.7.0) + +InfiniTime doesn't handle daylight savings automatically, so make sure to set the correct the time or sync it with a companion app + +### Digital watch face + +![Digital watch face](ui/watchface.jpg) + +This is what the default digital watch face looks like. You can change watch faces in the settings. + +The indicator on the top left is visible if you have unread notifications + +On the top right there are status icons + + - The battery icon shows roughly how much charge is remaining + - The Bluetooth icon is visible when the watch is connected to a companion app + - A plug icon is shown when the watch is plugged into a charger. + +On the bottom left you can see your heart rate if you have the measurement enabled in the heart rate app. + +On the bottom right you can see how many steps you have taken today. ### Navigation in the menu -![Quick actions](quickactions.jpg) -![Settings](settings.jpg) -![Application menu](appmenu.jpg) +![Application menu](ui/applist.jpg) +![Notifications](ui/notifications.jpg) +![Quick actions](ui/quicksettings.jpg) +![Settings](ui/settings.jpg) - - Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed in this panel. - Swipe **up** to display the application menus. Apps (stopwatch, music, step, games,...) can be started from this menu. + - Swipe **down** to display the notification panel. Notification sent by your companion app will be displayed here. - Swipe **right** to display the Quick Actions menu. This menu allows you to - Set the brightness of the display - Start the **flashlight** app - - Enable/disable vibrations on notifications (Do Not Disturb mode) + - Enable/disable notifications (Do Not Disturb mode) - Enter the **settings** menu - Swipe up and down to see all options + - Click the button to go back a screen. + - You can hold the button for a short time to return to the watch face. (version >1.7.0) diff --git a/doc/gettingStarted/oldbootloaderlogo.jpg b/doc/gettingStarted/oldbootloaderlogo.jpg deleted file mode 100644 index b4d0cdf..0000000 Binary files a/doc/gettingStarted/oldbootloaderlogo.jpg and /dev/null differ diff --git a/doc/gettingStarted/quickactions.jpg b/doc/gettingStarted/quickactions.jpg deleted file mode 100644 index 3bbe162..0000000 Binary files a/doc/gettingStarted/quickactions.jpg and /dev/null differ diff --git a/doc/gettingStarted/settings.jpg b/doc/gettingStarted/settings.jpg deleted file mode 100644 index 075708a..0000000 Binary files a/doc/gettingStarted/settings.jpg and /dev/null differ diff --git a/doc/gettingStarted/ui/applist.jpg b/doc/gettingStarted/ui/applist.jpg new file mode 100644 index 0000000..927780e Binary files /dev/null and b/doc/gettingStarted/ui/applist.jpg differ diff --git a/doc/gettingStarted/ui/notifications.jpg b/doc/gettingStarted/ui/notifications.jpg new file mode 100644 index 0000000..00b2726 Binary files /dev/null and b/doc/gettingStarted/ui/notifications.jpg differ diff --git a/doc/gettingStarted/ui/quicksettings.jpg b/doc/gettingStarted/ui/quicksettings.jpg new file mode 100644 index 0000000..250c915 Binary files /dev/null and b/doc/gettingStarted/ui/quicksettings.jpg differ diff --git a/doc/gettingStarted/ui/settings.jpg b/doc/gettingStarted/ui/settings.jpg new file mode 100644 index 0000000..a61279b Binary files /dev/null and b/doc/gettingStarted/ui/settings.jpg differ diff --git a/doc/gettingStarted/ui/watchface.jpg b/doc/gettingStarted/ui/watchface.jpg new file mode 100644 index 0000000..e7a9439 Binary files /dev/null and b/doc/gettingStarted/ui/watchface.jpg differ diff --git a/doc/gettingStarted/version-071.jpg b/doc/gettingStarted/version-071.jpg deleted file mode 100644 index bc9bc5b..0000000 Binary files a/doc/gettingStarted/version-071.jpg and /dev/null differ -- cgit v0.10.2 From d5e8e3ca44e998511907d1ec74c98c06c2e542b8 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Sun, 14 Nov 2021 15:23:12 +0200 Subject: Split updating and about software. Remove big Contributing section from README diff --git a/README.md b/README.md index b85dba3..ae315f2 100644 --- a/README.md +++ b/README.md @@ -4,28 +4,31 @@ ![InfiniTime logo](images/infinitime-logo-small.jpg "InfiniTime Logo") -InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www.pine64.org/pinetime/) +Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/pinetime/) with many features, written in modern C++. ## New to InfiniTime? - [Getting started with InfiniTime](doc/gettingStarted/gettingStarted-1.0.md) - - [About the software and updating](doc/gettingStarted/updating-software.md) + - [Updating the software](doc/gettingStarted/updating-software.md) + - [About the firmware and bootloader](doc/gettingStarted/about-software.md) ### Companion apps - [Gadgetbridge](https://gadgetbridge.org/) (Android) - [AmazFish](https://openrepos.net/content/piggz/amazfish/) (SailfishOS) - [Siglo](https://github.com/alexr4535/siglo) (Linux) - [InfiniLink](https://github.com/xan-m/InfiniLink) **[Experimental]** (iOS) -## Documentation +## Development -### Develop - - [Coding conventions](/doc/coding-convention.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) - [Creating a stopwatch in Pinetime(article)](https://pankajraghav.com/2021/04/03/PINETIME-STOPCLOCK.html) - [Tips on designing an app UI](doc/ui_guidelines.md) +### Contributing + - [How to contribute?](/doc/contribute.md) + - [Coding conventions](/doc/coding-convention.md) + ### Build, flash and debug - [Project branches](doc/branches.md) @@ -47,14 +50,6 @@ InfiniTime is an open-source firmware for the [Pinetime smartwatch](https://www. - [Memory analysis](./doc/MemoryAnalysis.md) -## Contributing - -This project is far from being finished, and there are still a lot of things to do for this project to become a firmware usable by the general public. - -Do not hesitate to fork the code, hack it and create pull-requests! Make sure to read the [coding conventions](/doc/coding-convention.md) - -You don't need to be a programmer to contribute. Read this page for more information on how you can help: [How to contribute?](doc/contribute.md) - ## Licenses This project is released under the GNU General Public License version 3 or, at your option, any later version. diff --git a/doc/gettingStarted/about-software.md b/doc/gettingStarted/about-software.md new file mode 100644 index 0000000..b19a610 --- /dev/null +++ b/doc/gettingStarted/about-software.md @@ -0,0 +1,26 @@ +# Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it? + +You may have already encountered these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and you may find them confusing if you're not familiar with the project. + +A **firmware** is software running on the embedded hardware of a device. + +InfiniTime has three distinct firmwares: + + - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** is the operating system. + - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying firmware updates and runs before booting into InfiniTime. + - **The recovery firmware** is a special *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. + +**OTA** (**O**ver **T**he **A**ir) refers to updating of the firmware over BLE (**B**luetooth **L**ow **E**nergy). This is a functionality that allows the user to update the firmware on their device wirelessly. + +**DFU** (**D**evice **F**irmware **U**pdate) is the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). + +## Bootloader + +Most of the time, the bootloader just runs without your intervention (update and load the firmware). + +However, you can enable 2 functionalities using the push button: + + - Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one + - Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality. + +More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md). diff --git a/doc/gettingStarted/gettingStarted-1.0.md b/doc/gettingStarted/gettingStarted-1.0.md index 939dfe5..30b8bdb 100644 --- a/doc/gettingStarted/gettingStarted-1.0.md +++ b/doc/gettingStarted/gettingStarted-1.0.md @@ -1,10 +1,10 @@ -# Getting started with InfiniTime 1.0.0 +# Getting started with InfiniTime -On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime. +On April 22 2021, InfiniTime and Pine64 [announced the release of InfiniTime 1.0.0](https://www.pine64.org/2021/04/22/its-time-infinitime-1-0/) and the availability of PineTime smartwatches as an *enthusiast grade end-user product*. This page aims to guide you with your first step with your new PineTime. It is highly recommended to update the firmware to the latest version when you receive your watch and when a new InfiniTime version is released. More information on updating the firmware [here](/doc/gettingStarted/updating-software.md). -## InfiniTime 1.0.0 quick user guide +## InfiniTime quick user guide ### Setting the time diff --git a/doc/gettingStarted/updating-software.md b/doc/gettingStarted/updating-software.md index 316d77f..7a05073 100644 --- a/doc/gettingStarted/updating-software.md +++ b/doc/gettingStarted/updating-software.md @@ -1,34 +1,20 @@ -## Firmware, InfiniTime, Bootloader, Recovery firmware, OTA, DFU... What is it? +# Updating InfiniTime -You may have already encountered these words by reading the announcement, release notes, or [the wiki guide](https://wiki.pine64.org/wiki/Upgrade_PineTime_to_InfiniTime_1.0.0) and you may find them confusing if you're not familiar with the project. +If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you! If you want more information about the software and the update procedure, check out [this](/doc/gettingStarted/about-software.md) page. -A **firmware** is software running on the embedded hardware of a device. - -InfiniTime has three distinct firmwares: - - - **[InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime)** is the operating system. - - **[The bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader)** is responsible for safely applying firmware updates and runs before booting into InfiniTime. - - **The recovery firmware** is a special *application firmware* than can be loaded by the bootloader on user request. This firmware can be useful in case of serious issue, when the main application firmware cannot perform an OTA update correctly. - -**OTA** (**O**ver **T**he **A**ir) refers to updating of the firmware over BLE (**B**luetooth **L**ow **E**nergy). This is a functionality that allows the user to update the firmware on their device wirelessly. - -**DFU** (**D**evice **F**irmware **U**pdate) is the file format and protocol used to send the update of the firmware to the watch over-the-air. InfiniTime implement the (legacy) DFU protocol from Nordic Semiconductor (NRF). - -## How to check the version of InfiniTime and the bootloader? +## Checking the version of InfiniTime You can check the InfiniTime version by first swiping right on the watchface to open quick settings, tapping the cogwheel to open settings, swipe up until you find an entry named "About" and tap on it. ![InfiniTime 1.0 version](version-1.0.jpg) -PineTimes shipped after June 2021 will be flashed with the [new version of the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0), the [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) and [InfiniTime 1.0](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/1.0.0). - -The bootloader is run right before booting to InfiniTime. +PineTimes shipped after June 2021 will ship with the latest version of [the bootloader](https://github.com/JF002/pinetime-mcuboot-bootloader/releases/tag/1.0.0) and [recovery firmware](https://github.com/InfiniTimeOrg/InfiniTime/releases/tag/0.14.1) -The bootloader is easily recognizable with its white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now). +The bootloader is run right before booting into InfiniTime. It is easily recognizable with its white pine cone that is progressively drawn in green. It also displays its own version on the bottom (1.0.0 as of now). ![Bootloader 1.0](bootloader-1.0.jpg) -## How to update your PineTime? +## Updating with companion apps To update your PineTime, you can use one of the [compatible companion applications](/README.md#companion-apps). @@ -43,7 +29,7 @@ We have prepared instructions for flashing InfiniTime with Gadgetbridge and NRFC - [Updating with Gadgetbridge](/doc/gettingStarted/ota-gadgetbridge.md) - [Updating with NRFConnect](/doc/gettingStarted/ota-nrfconnect.md) -### Firmware validation +## Firmware validation Firmware updates must be manually validated. If the firmware isn't validated and the watch resets, the watch will revert to the previous firmware. This is a safety feature to prevent bricking your device with faulty firmware. @@ -53,14 +39,3 @@ You can validate your updated firmware on InfiniTime >= 1.0 by following this si - Open settings by tapping the cogwheel on the bottom right - Swipe up until you find an entry named **Firmware** and tap on it - If the firmware is not validated yet, you can either validate the running firmware, or reset and revert to the previous firmware version - -## Bootloader - -Most of the time, the bootloader just runs without your intervention (update and load the firmware). - -However, you can enable 2 functionalities using the push button: - - - Push the button until the pine cone is drawn in **blue** to force the rollback of the previous version of the firmware, even if you've already validated the updated one - - Push the button until the pine cone is drawn in **red** to load the recovery firmware. This recovery firmware only provides BLE connectivity and OTA functionality. - -More info about the bootloader in [its project page](https://github.com/JF002/pinetime-mcuboot-bootloader/blob/master/README.md). -- cgit v0.10.2 From 4257073a02215e3f182d993765e4c5edef2d9845 Mon Sep 17 00:00:00 2001 From: Stephanie Date: Sun, 31 Oct 2021 12:24:13 -0400 Subject: Fixed container to use clang-format-12 and format on save diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 778fe9c..1bb315f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,9 @@ // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "terminal.integrated.shell.linux": "/bin/bash", + "editor.formatOnSave": true, + "clang-format.executable": "clang-format-12" }, // Add the IDs of extensions you want installed when the container is created. @@ -33,4 +35,4 @@ // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. // "remoteUser": "vscode" "remoteUser": "infinitime" -} \ No newline at end of file +} -- cgit v0.10.2