summaryrefslogtreecommitdiff
path: root/src/components/motor/MotorController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/motor/MotorController.cpp')
-rw-r--r--src/components/motor/MotorController.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index b895c83..714bff6 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -9,7 +9,9 @@ APP_TIMER_DEF(longVibTimer);
using namespace Pinetime::Controllers;
-void MotorController::Init() {
+void MotorController::Init(System::SystemTask* systemTask) {
+ this->systemTask = systemTask;
+
nrf_gpio_cfg_output(PinMap::Motor);
nrf_gpio_pin_set(PinMap::Motor);
@@ -29,10 +31,6 @@ void MotorController::RunForDuration(uint8_t motorDuration) {
&& xTimerStart(shortVibTimer, 0) == pdPASS) {
return;
}
- if (xTimerChangePeriodFromISR(shortVibTimer, APP_TIMER_TICKS(motorDuration), NULL) == pdPASS
- && xTimerStartFromISR(shortVibTimer, NULL) == pdPASS) {
- return;
- }
nrf_gpio_pin_set(PinMap::Motor);
}