From 0b9b48ca22ce5bdcb0e26dcf1225dd1c35c3541e Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 14 Sep 2022 13:12:20 +0200 Subject: [PATCH 01/11] added vibration scheduler --- src/components/alarm/AlarmController.cpp | 2 +- src/components/motor/MotorController.cpp | 71 ++++++++++++++++++- src/components/motor/MotorController.h | 29 +++++++- src/displayapp/screens/InfiniPaint.cpp | 2 +- src/displayapp/screens/Metronome.cpp | 4 +- src/displayapp/screens/Notifications.cpp | 9 +-- .../screens/settings/QuickSettings.cpp | 2 +- src/systemtask/Messages.h | 2 +- src/systemtask/SystemTask.cpp | 16 ++--- 9 files changed, 114 insertions(+), 23 deletions(-) diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index d97e1cffcf..3f333cea17 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -104,5 +104,5 @@ void AlarmController::StopAlerting() { // set next instance ScheduleAlarm(); } - systemTask->PushMessage(System::Messages::StopRinging); + systemTask->PushMessage(System::Messages::StopAlarm); } diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index db6103f424..56ca8a212f 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -9,7 +9,7 @@ void MotorController::Init() { nrf_gpio_cfg_output(PinMap::Motor); nrf_gpio_pin_set(PinMap::Motor); - shortVib = xTimerCreate("shortVib", 1, pdFALSE, nullptr, StopMotor); + shortVib = xTimerCreate("shortVib", 1, pdFALSE, this, StopMotor); longVib = xTimerCreate("longVib", pdMS_TO_TICKS(1000), pdTRUE, this, Ring); } @@ -20,11 +20,13 @@ void MotorController::Ring(TimerHandle_t xTimer) { void MotorController::RunForDuration(uint8_t motorDuration) { if (motorDuration > 0 && xTimerChangePeriod(shortVib, pdMS_TO_TICKS(motorDuration), 0) == pdPASS && xTimerStart(shortVib, 0) == pdPASS) { + isShortVibrating = true; nrf_gpio_pin_clear(PinMap::Motor); } } void MotorController::StartRinging() { + isLongVibrating = true; RunForDuration(50); xTimerStart(longVib, 0); } @@ -32,8 +34,75 @@ void MotorController::StartRinging() { void MotorController::StopRinging() { xTimerStop(longVib, 0); nrf_gpio_pin_set(PinMap::Motor); + isLongVibrating = false; + if (!IsVibrating()) { + // current vibration pattern is over, so check for next one + Update(); + } } void MotorController::StopMotor(TimerHandle_t xTimer) { nrf_gpio_pin_set(PinMap::Motor); + isShortVibrating = false; + if (!IsVibrating()) { + // current vibration pattern is over, so check for next one + Update(); + } +} + +void MotorController::Update() { + if (IsVibrating()) + return; + + if (phoneCallIsActive) { + // ring phone call + + } else if (timerIsActive) { + // ring timer + } else if (alarmIsActive) { + // ring alarm + } else if (notificationIsActive) { + // ring notification + } +} + +void MotorController::SingleVibration(uint8_t Duration) { + if (IsVibrating()) { + return; + } + RunForDuration(Duration); } + +void MotorController::ActivatePhoneCall() { + phoneCallIsActive = true; + Update(); +}; + +void MotorController::ActivateTimer() { + timerIsActive = true; + Update(); +}; + +void MotorController::ActivateAlarm() { + alarmIsActive = true; + Update(); +}; + +void MotorController::ActivateNotification() { + notificationIsActive = true; + Update(); +}; + +void MotorController::DeactivatePhoneCall() { + phoneCallIsActive = false; + Update(); +}; +void MotorController::DeactivateTimer() { + timerIsActive = false; + Update(); +}; + +void MotorController::DeactivateAlarm() { + alarmIsActive = false; + Update(); +}; diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index 6dea6d1f9e..5a1a50f4ce 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -12,15 +12,40 @@ namespace Pinetime { MotorController() = default; void Init(); + + void SingleVibration(uint8_t Duration); + + bool IsVibrating() { + return isShortVibrating || isLongVibrating; + }; + + void ActivatePhoneCall(); + void ActivateTimer(); + void ActivateAlarm(); + void ActivateNotification(); + + void DeactivatePhoneCall(); + void DeactivateTimer(); + void DeactivateAlarm(); + + private: + void Update(); void RunForDuration(uint8_t motorDuration); void StartRinging(); void StopRinging(); - - private: + static void Ring(TimerHandle_t xTimer); static void StopMotor(TimerHandle_t xTimer); TimerHandle_t shortVib; TimerHandle_t longVib; + + bool isShortVibrating = false; + bool isLongVibrating = false; + + bool phoneCallIsActive = false; + bool timerIsActive = false; + bool alarmIsActive = false; + bool notificationIsActive = false; }; } } diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp index 0b6864e892..35669e6e3b 100644 --- a/src/displayapp/screens/InfiniPaint.cpp +++ b/src/displayapp/screens/InfiniPaint.cpp @@ -54,7 +54,7 @@ bool InfiniPaint::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::fill(b, b + bufferSize, selectColor); - motor.RunForDuration(35); + motor.SingleVibration(35); return true; default: return true; diff --git a/src/displayapp/screens/Metronome.cpp b/src/displayapp/screens/Metronome.cpp index df87092b8b..7abfdbd884 100644 --- a/src/displayapp/screens/Metronome.cpp +++ b/src/displayapp/screens/Metronome.cpp @@ -83,9 +83,9 @@ void Metronome::Refresh() { counter--; if (counter == 0) { counter = bpb; - motorController.RunForDuration(90); + motorController.SingleVibration(90); } else { - motorController.RunForDuration(30); + motorController.SingleVibration(30); } } } diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 90a010f5fc..8a1af3b64f 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -42,9 +42,9 @@ Notifications::Notifications(DisplayApp* app, if (mode == Modes::Preview) { systemTask.PushMessage(System::Messages::DisableSleeping); if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) { - motorController.StartRinging(); + motorController.ActivatePhoneCall(); } else { - motorController.RunForDuration(35); + motorController.ActivateNotification(); } timeoutLine = lv_line_create(lv_scr_act(), nullptr); @@ -63,8 +63,6 @@ Notifications::Notifications(DisplayApp* app, Notifications::~Notifications() { lv_task_del(taskRefresh); - // make sure we stop any vibrations before exiting - motorController.StopRinging(); systemTask.PushMessage(System::Messages::EnableSleeping); lv_obj_clean(lv_scr_act()); } @@ -119,7 +117,6 @@ void Notifications::Refresh() { void Notifications::OnPreviewInteraction() { systemTask.PushMessage(System::Messages::EnableSleeping); - motorController.StopRinging(); if (timeoutLine != nullptr) { lv_obj_del(timeoutLine); timeoutLine = nullptr; @@ -343,7 +340,7 @@ void Notifications::NotificationItem::OnCallButtonEvent(lv_obj_t* obj, lv_event_ return; } - motorController.StopRinging(); + motorController.DeactivatePhoneCall(); if (obj == bt_accept) { alertNotificationService.AcceptIncomingCall(); diff --git a/src/displayapp/screens/settings/QuickSettings.cpp b/src/displayapp/screens/settings/QuickSettings.cpp index b76affc976..1673048d05 100644 --- a/src/displayapp/screens/settings/QuickSettings.cpp +++ b/src/displayapp/screens/settings/QuickSettings.cpp @@ -158,7 +158,7 @@ void QuickSettings::OnButtonEvent(lv_obj_t* object) { settingsController.SetNotificationStatus(Controllers::Settings::Notification::On); lv_label_set_text_static(btn3_lvl, Symbols::notificationsOn); lv_obj_set_state(btn3, static_cast(ButtonState::NotificationsOn)); - motorController.RunForDuration(35); + motorController.SingleVibration(35); } } else if (object == btn4) { diff --git a/src/systemtask/Messages.h b/src/systemtask/Messages.h index 7a46e0609c..d877a1b61f 100644 --- a/src/systemtask/Messages.h +++ b/src/systemtask/Messages.h @@ -26,7 +26,7 @@ namespace Pinetime { OnChargingEvent, OnPairing, SetOffAlarm, - StopRinging, + StopAlarm, MeasureBatteryTimerExpired, BatteryPercentageUpdated, StartFileTransfer, diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index ef631af74e..6a49aab632 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -294,18 +294,18 @@ void SystemTask::Work() { if (state == SystemTaskState::Sleeping) { GoToRunning(); } - motorController.RunForDuration(35); + motorController.ActivateTimer(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::TimerDone); break; case Messages::SetOffAlarm: if (state == SystemTaskState::Sleeping) { GoToRunning(); } - motorController.StartRinging(); + motorController.ActivateAlarm(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered); break; - case Messages::StopRinging: - motorController.StopRinging(); + case Messages::StopAlarm: + motorController.DeactivateAlarm(); break; case Messages::BleConnected: ReloadIdleTimer(); @@ -396,7 +396,7 @@ void SystemTask::Work() { GoToRunning(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock); } - motorController.RunForDuration(35); + motorController.SingleVibration(35); } break; case Messages::OnNewHalfHour: @@ -408,12 +408,12 @@ void SystemTask::Work() { GoToRunning(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::Clock); } - motorController.RunForDuration(35); + motorController.SingleVibration(35); } break; case Messages::OnChargingEvent: batteryController.ReadPowerState(); - motorController.RunForDuration(15); + motorController.SingleVibration(15); ReloadIdleTimer(); if (state == SystemTaskState::Sleeping) { GoToRunning(); @@ -429,7 +429,7 @@ void SystemTask::Work() { if (state == SystemTaskState::Sleeping) { GoToRunning(); } - motorController.RunForDuration(35); + motorController.SingleVibration(35); displayApp.PushMessage(Pinetime::Applications::Display::Messages::ShowPairingKey); break; case Messages::BleRadioEnableToggle: From 0b6faa049bc4f0b7b65642a65bc03972a7ce5273 Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 14 Sep 2022 15:26:38 +0200 Subject: [PATCH 02/11] fixed object in static callbacks --- src/components/motor/MotorController.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index 56ca8a212f..e801d7c232 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -42,11 +42,12 @@ void MotorController::StopRinging() { } void MotorController::StopMotor(TimerHandle_t xTimer) { + auto* motorController = static_cast(pvTimerGetTimerID(xTimer)); nrf_gpio_pin_set(PinMap::Motor); - isShortVibrating = false; - if (!IsVibrating()) { + motorController->isShortVibrating = false; + if (!motorController->IsVibrating()) { // current vibration pattern is over, so check for next one - Update(); + motorController->Update(); } } From aaa55f0e1811b7dece0477da4bf71e7a072096ca Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 14 Sep 2022 16:01:44 +0200 Subject: [PATCH 03/11] added different rings --- src/components/motor/MotorController.cpp | 14 +++++++------- src/components/motor/MotorController.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index e801d7c232..4c5d202701 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -25,9 +25,9 @@ void MotorController::RunForDuration(uint8_t motorDuration) { } } -void MotorController::StartRinging() { +void MotorController::StartRinging(uint8_t Duration) { isLongVibrating = true; - RunForDuration(50); + RunForDuration(Duration); xTimerStart(longVib, 0); } @@ -56,17 +56,17 @@ void MotorController::Update() { return; if (phoneCallIsActive) { - // ring phone call - + StartRinging(55); } else if (timerIsActive) { - // ring timer + StartRinging(50); } else if (alarmIsActive) { - // ring alarm + StartRinging(45); } else if (notificationIsActive) { - // ring notification + RunForDuration(40); } } +// CAUTION: this one will not trigger a vibration if another one is already running! void MotorController::SingleVibration(uint8_t Duration) { if (IsVibrating()) { return; diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index 5a1a50f4ce..ce88ab3c59 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -31,7 +31,7 @@ namespace Pinetime { private: void Update(); void RunForDuration(uint8_t motorDuration); - void StartRinging(); + void StartRinging(uint8_t Duration); void StopRinging(); static void Ring(TimerHandle_t xTimer); From abc764445e20924c4a06f20bdfda21f9ee5388a1 Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 14 Sep 2022 16:08:29 +0200 Subject: [PATCH 04/11] fix format --- src/components/motor/MotorController.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index ce88ab3c59..fc54b1338e 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -33,7 +33,7 @@ namespace Pinetime { void RunForDuration(uint8_t motorDuration); void StartRinging(uint8_t Duration); void StopRinging(); - + static void Ring(TimerHandle_t xTimer); static void StopMotor(TimerHandle_t xTimer); TimerHandle_t shortVib; @@ -41,7 +41,7 @@ namespace Pinetime { bool isShortVibrating = false; bool isLongVibrating = false; - + bool phoneCallIsActive = false; bool timerIsActive = false; bool alarmIsActive = false; From d0762c5870827df00eb163fe77248a1fb55f0534 Mon Sep 17 00:00:00 2001 From: minacode Date: Mon, 19 Sep 2022 13:32:24 +0200 Subject: [PATCH 05/11] started refactoring out into a separate controller --- src/components/alert/AlertController.cpp | 71 ++++++++++++++++++++++++ src/components/alert/AlertController.h | 36 ++++++++++++ src/components/motor/MotorController.cpp | 68 +++-------------------- src/components/motor/MotorController.h | 24 ++------ src/systemtask/SystemTask.cpp | 7 ++- src/systemtask/SystemTask.h | 2 + 6 files changed, 127 insertions(+), 81 deletions(-) create mode 100644 src/components/alert/AlertController.cpp create mode 100644 src/components/alert/AlertController.h diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp new file mode 100644 index 0000000000..28bc4f0b4a --- /dev/null +++ b/src/components/alert/AlertController.cpp @@ -0,0 +1,71 @@ +#include "components/motor/AlertController.h" + +using namespace Pinetime::Controllers; + +void AlertController::AlertController(MotorController& motorControllerController) + : motorController {motor} { +} + +void AlertController::Update() { + // this can be a bug. A SingleVibration can break the Update-chain even if there are still things active. + // maybe we have to trigger Update through the system task in each iteration + if (motorController.IsVibrating()) + return; + + bool ok = true; + + if (phoneCallIsActive) { + ok = motorController.StartRinging(55); + } else if (timerIsActive) { + ok = motorController.StartRinging(50); + } else if (alarmIsActive) { + ok = motorController.StartRinging(45); + } else if (notificationIsActive) { + ok = motorController.SingleVibration(40); + } + + // handle not ok +} + +void AlertController::ActivatePhoneCall() { + phoneCallIsActive = true; + Update(); +}; + +void AlertController::ActivateTimer() { + timerIsActive = true; + Update(); +}; + +void AlertController::ActivateAlarm() { + alarmIsActive = true; + Update(); +}; + +void AlertController::ActivateNotification() { + notificationIsActive = true; + Update(); +}; + +void AlertController::DeactivatePhoneCall() { + if (phoneCallIsActive) { + motorController.StopRinging(); + } + phoneCallIsActive = false; + Update(); +}; +void AlertController::DeactivateTimer() { + if (!phoneCallIsActive && timerIsActive) { + motorController.StopRinging(); + } + timerIsActive = false; + Update(); +}; + +void AlertController::DeactivateAlarm() { + if (!phoneCallIsActive && !timerIsActive && alarmIsActive) { + motorController.StopRinging(); + } + alarmIsActive = false; + Update(); +}; diff --git a/src/components/alert/AlertController.h b/src/components/alert/AlertController.h new file mode 100644 index 0000000000..296cb07083 --- /dev/null +++ b/src/components/alert/AlertController.h @@ -0,0 +1,36 @@ +#pragma once + +#include "components/motor/MotorController.h" + +namespace Pinetime { + namespace Controllers { + + class AlertController { + public: + AlertController(MotorController& motorController); + + bool IsActive() const { + return phoneCallIsActive || timerIsActive || alarmIsActive || notificationIsActive; + } + + void ActivatePhoneCall(); + void ActivateTimer(); + void ActivateAlarm(); + void ActivateNotification(); + + void DeactivatePhoneCall(); + void DeactivateTimer(); + void DeactivateAlarm(); + + private: + void Update(); + + bool phoneCallIsActive = false; + bool timerIsActive = false; + bool alarmIsActive = false; + bool notificationIsActive = false; + + MotorController& motorController; + }; + } +} diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index 4c5d202701..afa2707c42 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -25,85 +25,33 @@ void MotorController::RunForDuration(uint8_t motorDuration) { } } -void MotorController::StartRinging(uint8_t Duration) { +bool MotorController::StartRinging(uint8_t Duration) { + if (IsVibrating()) { + return false; + } isLongVibrating = true; RunForDuration(Duration); xTimerStart(longVib, 0); + return true; } void MotorController::StopRinging() { xTimerStop(longVib, 0); nrf_gpio_pin_set(PinMap::Motor); isLongVibrating = false; - if (!IsVibrating()) { - // current vibration pattern is over, so check for next one - Update(); - } } void MotorController::StopMotor(TimerHandle_t xTimer) { auto* motorController = static_cast(pvTimerGetTimerID(xTimer)); nrf_gpio_pin_set(PinMap::Motor); motorController->isShortVibrating = false; - if (!motorController->IsVibrating()) { - // current vibration pattern is over, so check for next one - motorController->Update(); - } -} - -void MotorController::Update() { - if (IsVibrating()) - return; - - if (phoneCallIsActive) { - StartRinging(55); - } else if (timerIsActive) { - StartRinging(50); - } else if (alarmIsActive) { - StartRinging(45); - } else if (notificationIsActive) { - RunForDuration(40); - } } // CAUTION: this one will not trigger a vibration if another one is already running! -void MotorController::SingleVibration(uint8_t Duration) { +bool MotorController::SingleVibration(uint8_t Duration) { if (IsVibrating()) { - return; + return false; } RunForDuration(Duration); + return true; } - -void MotorController::ActivatePhoneCall() { - phoneCallIsActive = true; - Update(); -}; - -void MotorController::ActivateTimer() { - timerIsActive = true; - Update(); -}; - -void MotorController::ActivateAlarm() { - alarmIsActive = true; - Update(); -}; - -void MotorController::ActivateNotification() { - notificationIsActive = true; - Update(); -}; - -void MotorController::DeactivatePhoneCall() { - phoneCallIsActive = false; - Update(); -}; -void MotorController::DeactivateTimer() { - timerIsActive = false; - Update(); -}; - -void MotorController::DeactivateAlarm() { - alarmIsActive = false; - Update(); -}; diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index fc54b1338e..f8516ea7b6 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -13,26 +13,19 @@ namespace Pinetime { void Init(); - void SingleVibration(uint8_t Duration); + // SingleVibration and StartRinging do nothing when a vibration is already running. + // they return false in this case. + // if everything went good they return true. + bool SingleVibration(uint8_t Duration); + bool StartRinging(uint8_t Duration); + void StopRinging(); bool IsVibrating() { return isShortVibrating || isLongVibrating; }; - void ActivatePhoneCall(); - void ActivateTimer(); - void ActivateAlarm(); - void ActivateNotification(); - - void DeactivatePhoneCall(); - void DeactivateTimer(); - void DeactivateAlarm(); - private: - void Update(); void RunForDuration(uint8_t motorDuration); - void StartRinging(uint8_t Duration); - void StopRinging(); static void Ring(TimerHandle_t xTimer); static void StopMotor(TimerHandle_t xTimer); @@ -41,11 +34,6 @@ namespace Pinetime { bool isShortVibrating = false; bool isLongVibrating = false; - - bool phoneCallIsActive = false; - bool timerIsActive = false; - bool alarmIsActive = false; - bool notificationIsActive = false; }; } } diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 6a49aab632..382991eaac 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -81,6 +81,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, dateTimeController {dateTimeController}, timerController {timerController}, alarmController {alarmController}, + alertController(motorController), watchdog {watchdog}, notificationManager {notificationManager}, motorController {motorController}, @@ -294,18 +295,18 @@ void SystemTask::Work() { if (state == SystemTaskState::Sleeping) { GoToRunning(); } - motorController.ActivateTimer(); + alertController.ActivateTimer(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::TimerDone); break; case Messages::SetOffAlarm: if (state == SystemTaskState::Sleeping) { GoToRunning(); } - motorController.ActivateAlarm(); + alertController.ActivateAlarm(); displayApp.PushMessage(Pinetime::Applications::Display::Messages::AlarmTriggered); break; case Messages::StopAlarm: - motorController.DeactivateAlarm(); + alertController.DeactivateAlarm(); break; case Messages::BleConnected: ReloadIdleTimer(); diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index d1e4a004f9..d244aa991b 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -18,6 +18,7 @@ #include "components/motor/MotorController.h" #include "components/timer/TimerController.h" #include "components/alarm/AlarmController.h" +#include "components/alert/AlertController.h" #include "components/fs/FS.h" #include "touchhandler/TouchHandler.h" #include "buttonhandler/ButtonHandler.h" @@ -110,6 +111,7 @@ namespace Pinetime { Pinetime::Controllers::DateTime& dateTimeController; Pinetime::Controllers::TimerController& timerController; Pinetime::Controllers::AlarmController& alarmController; + Pinetime::Controllers::AlertController& alertController; QueueHandle_t systemTasksMsgQueue; Pinetime::Drivers::Watchdog& watchdog; Pinetime::Controllers::NotificationManager& notificationManager; From dc98efec124a2da39ac7411dbd396c41ff40eaf5 Mon Sep 17 00:00:00 2001 From: minacode Date: Mon, 19 Sep 2022 19:01:29 +0200 Subject: [PATCH 06/11] minor fixes --- src/components/alert/AlertController.cpp | 2 +- src/systemtask/SystemTask.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp index 28bc4f0b4a..fef7184766 100644 --- a/src/components/alert/AlertController.cpp +++ b/src/components/alert/AlertController.cpp @@ -2,7 +2,7 @@ using namespace Pinetime::Controllers; -void AlertController::AlertController(MotorController& motorControllerController) +AlertController::AlertController(MotorController& motorControllerController) : motorController {motor} { } diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 382991eaac..4faee5fe32 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -56,7 +56,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, Controllers::Ble& bleController, Controllers::DateTime& dateTimeController, Controllers::TimerController& timerController, - Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlarmController& alarmController, Drivers::Watchdog& watchdog, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::MotorController& motorController, From 5b61f337fb713e9f0556fd509a76ba92f1453d46 Mon Sep 17 00:00:00 2001 From: Max Friedrich Date: Mon, 19 Sep 2022 20:36:27 +0200 Subject: [PATCH 07/11] Update src/components/alert/AlertController.cpp Co-authored-by: Itai Nelken <70802936+Itai-Nelken@users.noreply.github.com> --- src/components/alert/AlertController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp index fef7184766..6107e16276 100644 --- a/src/components/alert/AlertController.cpp +++ b/src/components/alert/AlertController.cpp @@ -2,8 +2,8 @@ using namespace Pinetime::Controllers; -AlertController::AlertController(MotorController& motorControllerController) - : motorController {motor} { +AlertController::AlertController(MotorController& motorController) + : motorController {motorController} { } void AlertController::Update() { From 119bd2cd8553fed7ff4c857af1e53db9acbdf71d Mon Sep 17 00:00:00 2001 From: Joheyy Date: Mon, 19 Sep 2022 21:01:08 +0200 Subject: [PATCH 08/11] Fix some issues with refactor --- src/CMakeLists.txt | 3 ++ src/components/alert/AlertController.cpp | 2 +- src/displayapp/DisplayApp.cpp | 4 +++ src/displayapp/DisplayApp.h | 3 ++ src/displayapp/DisplayAppRecovery.cpp | 1 + src/displayapp/DisplayAppRecovery.h | 2 ++ src/displayapp/screens/Notifications.cpp | 35 +++++++++++++++--------- src/displayapp/screens/Notifications.h | 9 ++++-- src/main.cpp | 3 ++ src/systemtask/SystemTask.cpp | 3 +- src/systemtask/SystemTask.h | 1 + 11 files changed, 49 insertions(+), 17 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e59c0d814b..54eff90d43 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -473,6 +473,7 @@ list(APPEND SOURCE_FILES components/settings/Settings.cpp components/timer/TimerController.cpp components/alarm/AlarmController.cpp + components/alert/AlertController.cpp components/fs/FS.cpp drivers/Cst816s.cpp FreeRTOS/port.c @@ -539,6 +540,7 @@ list(APPEND RECOVERY_SOURCE_FILES components/settings/Settings.cpp components/timer/TimerController.cpp components/alarm/AlarmController.cpp + components/alert/AlertController.cpp drivers/Cst816s.cpp FreeRTOS/port.c FreeRTOS/port_cmsis_systick.c @@ -655,6 +657,7 @@ set(INCLUDE_FILES components/settings/Settings.h components/timer/TimerController.h components/alarm/AlarmController.h + components/alert/AlertController.h drivers/Cst816s.h FreeRTOS/portmacro.h FreeRTOS/portmacro_cmsis.h diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp index 6107e16276..7511b0f344 100644 --- a/src/components/alert/AlertController.cpp +++ b/src/components/alert/AlertController.cpp @@ -1,4 +1,4 @@ -#include "components/motor/AlertController.h" +#include "components/alert/AlertController.h" using namespace Pinetime::Controllers; diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 108e380d69..4eaa217b56 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -74,6 +74,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlertController& alertController, Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem) @@ -91,6 +92,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, motionController {motionController}, timerController {timerController}, alarmController {alarmController}, + alertController {alertController}, brightnessController {brightnessController}, touchHandler {touchHandler}, filesystem {filesystem} { @@ -354,6 +356,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) notificationManager, systemTask->nimble().alertService(), motorController, + alertController, *systemTask, Screens::Notifications::Modes::Normal); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); @@ -363,6 +366,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) notificationManager, systemTask->nimble().alertService(), motorController, + alertController, *systemTask, Screens::Notifications::Modes::Preview); ReturnApp(Apps::Clock, FullRefreshDirections::Up, TouchEvents::SwipeUp); diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 4c54e22739..14374b3467 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -15,6 +15,7 @@ #include "displayapp/screens/Screen.h" #include "components/timer/TimerController.h" #include "components/alarm/AlarmController.h" +#include "components/alert/AlertController.h" #include "touchhandler/TouchHandler.h" #include "displayapp/Messages.h" @@ -61,6 +62,7 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlertController& alertController, Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem); @@ -89,6 +91,7 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController; Pinetime::Controllers::TimerController& timerController; Pinetime::Controllers::AlarmController& alarmController; + Pinetime::Controllers::AlertController& alertController; Pinetime::Controllers::BrightnessController& brightnessController; Pinetime::Controllers::TouchHandler& touchHandler; Pinetime::Controllers::FS& filesystem; diff --git a/src/displayapp/DisplayAppRecovery.cpp b/src/displayapp/DisplayAppRecovery.cpp index e553aa8794..ad3e708452 100644 --- a/src/displayapp/DisplayAppRecovery.cpp +++ b/src/displayapp/DisplayAppRecovery.cpp @@ -24,6 +24,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd, Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlertController& alertController, Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem) diff --git a/src/displayapp/DisplayAppRecovery.h b/src/displayapp/DisplayAppRecovery.h index 7d4f0fd0c0..22525bbf0f 100644 --- a/src/displayapp/DisplayAppRecovery.h +++ b/src/displayapp/DisplayAppRecovery.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "BootErrors.h" #include "displayapp/TouchEvents.h" #include "displayapp/Apps.h" @@ -59,6 +60,7 @@ namespace Pinetime { Pinetime::Controllers::MotionController& motionController, Pinetime::Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlertController& alertController, Pinetime::Controllers::BrightnessController& brightnessController, Pinetime::Controllers::TouchHandler& touchHandler, Pinetime::Controllers::FS& filesystem); diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 8a1af3b64f..2faf7f7db8 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -14,12 +14,14 @@ Notifications::Notifications(DisplayApp* app, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController, System::SystemTask& systemTask, Modes mode) : Screen(app), notificationManager {notificationManager}, alertNotificationService {alertNotificationService}, motorController {motorController}, + alertController {alertController}, systemTask {systemTask}, mode {mode} { @@ -33,18 +35,19 @@ Notifications::Notifications(DisplayApp* app, notification.category, notificationManager.NbNotifications(), alertNotificationService, - motorController); + motorController, + alertController); validDisplay = true; } else { - currentItem = std::make_unique(alertNotificationService, motorController); + currentItem = std::make_unique(alertNotificationService, motorController, alertController); validDisplay = false; } if (mode == Modes::Preview) { systemTask.PushMessage(System::Messages::DisableSleeping); if (notification.category == Controllers::NotificationManager::Categories::IncomingCall) { - motorController.ActivatePhoneCall(); + alertController.ActivatePhoneCall(); } else { - motorController.ActivateNotification(); + alertController.ActivateNotification(); } timeoutLine = lv_line_create(lv_scr_act(), nullptr); @@ -106,9 +109,10 @@ void Notifications::Refresh() { notification.category, notificationManager.NbNotifications(), alertNotificationService, - motorController); + motorController, + alertController); } else { - currentItem = std::make_unique(alertNotificationService, motorController); + currentItem = std::make_unique(alertNotificationService, motorController, alertController); } } @@ -186,7 +190,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { previousNotification.category, notificationManager.NbNotifications(), alertNotificationService, - motorController); + motorController, + alertController); } return true; case Pinetime::Applications::TouchEvents::SwipeUp: { @@ -213,7 +218,8 @@ bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { nextNotification.category, notificationManager.NbNotifications(), alertNotificationService, - motorController); + motorController, + alertController); } return true; default: @@ -229,14 +235,16 @@ namespace { } Notifications::NotificationItem::NotificationItem(Pinetime::Controllers::AlertNotificationService& alertNotificationService, - Pinetime::Controllers::MotorController& motorController) + Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController) : NotificationItem("Notification", "No notification to display", 0, Controllers::NotificationManager::Categories::Unknown, 0, alertNotificationService, - motorController) { + motorController, + alertController) { } Notifications::NotificationItem::NotificationItem(const char* title, @@ -245,8 +253,9 @@ Notifications::NotificationItem::NotificationItem(const char* title, Controllers::NotificationManager::Categories category, uint8_t notifNb, Pinetime::Controllers::AlertNotificationService& alertNotificationService, - Pinetime::Controllers::MotorController& motorController) - : alertNotificationService {alertNotificationService}, motorController {motorController} { + Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController) + : alertNotificationService {alertNotificationService}, motorController {motorController}, alertController {alertController} { container = lv_cont_create(lv_scr_act(), nullptr); lv_obj_set_size(container, LV_HOR_RES, LV_VER_RES); lv_obj_set_style_local_bg_color(container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_BLACK); @@ -340,7 +349,7 @@ void Notifications::NotificationItem::OnCallButtonEvent(lv_obj_t* obj, lv_event_ return; } - motorController.DeactivatePhoneCall(); + alertController.DeactivatePhoneCall(); if (obj == bt_accept) { alertNotificationService.AcceptIncomingCall(); diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index 9d843a9b13..544ae3150a 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -23,6 +23,7 @@ namespace Pinetime { Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::AlertNotificationService& alertNotificationService, Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController, System::SystemTask& systemTask, Modes mode); ~Notifications() override; @@ -34,14 +35,16 @@ namespace Pinetime { class NotificationItem { public: NotificationItem(Pinetime::Controllers::AlertNotificationService& alertNotificationService, - Pinetime::Controllers::MotorController& motorController); + Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController); NotificationItem(const char* title, const char* msg, uint8_t notifNr, Controllers::NotificationManager::Categories, uint8_t notifNb, Pinetime::Controllers::AlertNotificationService& alertNotificationService, - Pinetime::Controllers::MotorController& motorController); + Pinetime::Controllers::MotorController& motorController, + Pinetime::Controllers::AlertController& alertController); ~NotificationItem(); bool IsRunning() const { return running; @@ -59,6 +62,7 @@ namespace Pinetime { lv_obj_t* label_reject; Pinetime::Controllers::AlertNotificationService& alertNotificationService; Pinetime::Controllers::MotorController& motorController; + Pinetime::Controllers::AlertController& alertController; bool running = true; }; @@ -67,6 +71,7 @@ namespace Pinetime { Pinetime::Controllers::NotificationManager& notificationManager; Pinetime::Controllers::AlertNotificationService& alertNotificationService; Pinetime::Controllers::MotorController& motorController; + Pinetime::Controllers::AlertController& alertController; System::SystemTask& systemTask; Modes mode = Modes::Normal; std::unique_ptr currentItem; diff --git a/src/main.cpp b/src/main.cpp index ad7a07dc98..93bee4d2ce 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -112,6 +112,7 @@ Pinetime::Controllers::NotificationManager notificationManager; Pinetime::Controllers::MotionController motionController; Pinetime::Controllers::TimerController timerController; Pinetime::Controllers::AlarmController alarmController {dateTimeController}; +Pinetime::Controllers::AlertController alertController {motorController}; Pinetime::Controllers::TouchHandler touchHandler(touchPanel, lvgl); Pinetime::Controllers::ButtonHandler buttonHandler; Pinetime::Controllers::BrightnessController brightnessController {}; @@ -130,6 +131,7 @@ Pinetime::Applications::DisplayApp displayApp(lcd, motionController, timerController, alarmController, + alertController, brightnessController, touchHandler, fs); @@ -145,6 +147,7 @@ Pinetime::System::SystemTask systemTask(spi, dateTimeController, timerController, alarmController, + alertController, watchdog, notificationManager, motorController, diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 4faee5fe32..643dc7801c 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -57,6 +57,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, Controllers::DateTime& dateTimeController, Controllers::TimerController& timerController, Pinetime::Controllers::AlarmController& alarmController, + Pinetime::Controllers::AlertController& alertController, Drivers::Watchdog& watchdog, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::MotorController& motorController, @@ -81,7 +82,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, dateTimeController {dateTimeController}, timerController {timerController}, alarmController {alarmController}, - alertController(motorController), + alertController(alertController), watchdog {watchdog}, notificationManager {notificationManager}, motorController {motorController}, diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index d244aa991b..b1ed2c1b50 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -66,6 +66,7 @@ namespace Pinetime { Controllers::DateTime& dateTimeController, Controllers::TimerController& timerController, Controllers::AlarmController& alarmController, + Controllers::AlertController& alertController, Drivers::Watchdog& watchdog, Pinetime::Controllers::NotificationManager& notificationManager, Pinetime::Controllers::MotorController& motorController, From adcd904874055a9ae311a14fc956520a9ff5c12e Mon Sep 17 00:00:00 2001 From: Joheyy Date: Tue, 20 Sep 2022 14:23:55 +0200 Subject: [PATCH 09/11] Fix whitespace formatting --- src/components/alert/AlertController.cpp | 7 +++---- src/components/alert/AlertController.h | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp index 7511b0f344..e6dd4133b2 100644 --- a/src/components/alert/AlertController.cpp +++ b/src/components/alert/AlertController.cpp @@ -2,13 +2,12 @@ using namespace Pinetime::Controllers; -AlertController::AlertController(MotorController& motorController) - : motorController {motorController} { +AlertController::AlertController(MotorController& motorController) : motorController {motorController} { } void AlertController::Update() { // this can be a bug. A SingleVibration can break the Update-chain even if there are still things active. - // maybe we have to trigger Update through the system task in each iteration + // maybe we have to trigger Update through the system task in each iteration if (motorController.IsVibrating()) return; @@ -23,7 +22,7 @@ void AlertController::Update() { } else if (notificationIsActive) { ok = motorController.SingleVibration(40); } - + // handle not ok } diff --git a/src/components/alert/AlertController.h b/src/components/alert/AlertController.h index 296cb07083..94797ae819 100644 --- a/src/components/alert/AlertController.h +++ b/src/components/alert/AlertController.h @@ -10,7 +10,7 @@ namespace Pinetime { AlertController(MotorController& motorController); bool IsActive() const { - return phoneCallIsActive || timerIsActive || alarmIsActive || notificationIsActive; + return phoneCallIsActive || timerIsActive || alarmIsActive || notificationIsActive; } void ActivatePhoneCall(); @@ -24,12 +24,12 @@ namespace Pinetime { private: void Update(); - + bool phoneCallIsActive = false; bool timerIsActive = false; bool alarmIsActive = false; bool notificationIsActive = false; - + MotorController& motorController; }; } From 459a26a49a81de1aeaae05164cac4a7ea732c118 Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 21 Sep 2022 17:39:24 +0200 Subject: [PATCH 10/11] added displayapp support --- src/components/alert/AlertController.cpp | 28 ++++++++++++++---------- src/components/alert/AlertController.h | 5 +++-- src/systemtask/SystemTask.cpp | 5 ++++- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/components/alert/AlertController.cpp b/src/components/alert/AlertController.cpp index e6dd4133b2..95e50371c4 100644 --- a/src/components/alert/AlertController.cpp +++ b/src/components/alert/AlertController.cpp @@ -1,15 +1,15 @@ #include "components/alert/AlertController.h" using namespace Pinetime::Controllers; +using namespace Pinetime::Applications::Display; AlertController::AlertController(MotorController& motorController) : motorController {motorController} { } -void AlertController::Update() { - // this can be a bug. A SingleVibration can break the Update-chain even if there are still things active. - // maybe we have to trigger Update through the system task in each iteration +// return true if a change has happened +bool AlertController::Update() { if (motorController.IsVibrating()) - return; + return false; bool ok = true; @@ -23,27 +23,33 @@ void AlertController::Update() { ok = motorController.SingleVibration(40); } - // handle not ok + return ok; +} + +Messages AlertController::DisplayMessage() const { + if (timerIsActive) { + return Messages::TimerDone; + } else if (alarmIsActive) { + return Messages::AlarmTriggered; + } + + return Messages::NewNotification; } void AlertController::ActivatePhoneCall() { phoneCallIsActive = true; - Update(); }; void AlertController::ActivateTimer() { timerIsActive = true; - Update(); }; void AlertController::ActivateAlarm() { alarmIsActive = true; - Update(); }; void AlertController::ActivateNotification() { notificationIsActive = true; - Update(); }; void AlertController::DeactivatePhoneCall() { @@ -51,14 +57,13 @@ void AlertController::DeactivatePhoneCall() { motorController.StopRinging(); } phoneCallIsActive = false; - Update(); }; + void AlertController::DeactivateTimer() { if (!phoneCallIsActive && timerIsActive) { motorController.StopRinging(); } timerIsActive = false; - Update(); }; void AlertController::DeactivateAlarm() { @@ -66,5 +71,4 @@ void AlertController::DeactivateAlarm() { motorController.StopRinging(); } alarmIsActive = false; - Update(); }; diff --git a/src/components/alert/AlertController.h b/src/components/alert/AlertController.h index 94797ae819..6fb3d3ebdb 100644 --- a/src/components/alert/AlertController.h +++ b/src/components/alert/AlertController.h @@ -1,6 +1,7 @@ #pragma once #include "components/motor/MotorController.h" +#include "displayapp/Messages.h" namespace Pinetime { namespace Controllers { @@ -22,9 +23,9 @@ namespace Pinetime { void DeactivateTimer(); void DeactivateAlarm(); + bool Update(); + Pinetime::Applications::Display::Messages DisplayMessage() const; private: - void Update(); - bool phoneCallIsActive = false; bool timerIsActive = false; bool alarmIsActive = false; diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 643dc7801c..19b9c90a73 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -82,7 +82,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi, dateTimeController {dateTimeController}, timerController {timerController}, alarmController {alarmController}, - alertController(alertController), + alertController {alertController}, watchdog {watchdog}, notificationManager {notificationManager}, motorController {motorController}, @@ -209,6 +209,9 @@ void SystemTask::Work() { #pragma ide diagnostic ignored "EndlessLoop" while (true) { UpdateMotion(); + if (alertController.Update()) { + displayApp.PushMessage(alertController.DisplayMessage()); + } uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, 100)) { From ff9e163b4d9988c9576a0df53238be5b01bf93bf Mon Sep 17 00:00:00 2001 From: minacode Date: Wed, 21 Sep 2022 18:15:16 +0200 Subject: [PATCH 11/11] format --- src/components/alert/AlertController.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/alert/AlertController.h b/src/components/alert/AlertController.h index 6fb3d3ebdb..b93764311e 100644 --- a/src/components/alert/AlertController.h +++ b/src/components/alert/AlertController.h @@ -25,6 +25,7 @@ namespace Pinetime { bool Update(); Pinetime::Applications::Display::Messages DisplayMessage() const; + private: bool phoneCallIsActive = false; bool timerIsActive = false;