From 1fb5757655c1cdf0e93f03ad27869e8c043d69f0 Mon Sep 17 00:00:00 2001 From: Mark Russell Date: Fri, 10 Sep 2021 18:40:13 -0400 Subject: Created basic alarm app --- src/components/motor/MotorController.cpp | 6 ++++++ src/components/motor/MotorController.h | 1 + 2 files changed, 7 insertions(+) (limited to 'src/components/motor') diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index b25e6bc8..5ade19e4 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -42,6 +42,12 @@ void MotorController::StartRinging() { app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this); } +// This function is the same as StartRinging(), but will ring even if notifications are turned off in Settings +void MotorController::StartRingingDisregardSettings() { + Ring(this); + app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this); +} + void MotorController::StopRinging() { app_timer_stop(longVibTimer); nrf_gpio_pin_set(pinMotor); diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index d2c9fe5f..d3b96b07 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -15,6 +15,7 @@ namespace Pinetime { void RunForDuration(uint8_t motorDuration); void StartRinging(); static void StopRinging(); + void StartRingingDisregardSettings(); private: static void Ring(void* p_context); -- cgit v1.2.3-70-g09d2