From c37e38517c60a45fca5a03d64962a8f95bf46114 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Sun, 17 Apr 2022 11:01:12 +0200 Subject: Remove systemTask reference from MotorController diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index 714bff6..6eff2ee 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -9,9 +9,7 @@ APP_TIMER_DEF(longVibTimer); using namespace Pinetime::Controllers; -void MotorController::Init(System::SystemTask* systemTask) { - this->systemTask = systemTask; - +void MotorController::Init() { nrf_gpio_cfg_output(PinMap::Motor); nrf_gpio_pin_set(PinMap::Motor); diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index 99a4e64..8dfa2bd 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -20,10 +20,9 @@ namespace Pinetime { protected: friend class Pinetime::System::SystemTask; - void Init(System::SystemTask* systemTask); + void Init(); private: - System::SystemTask* systemTask = nullptr; static void Ring(TimerHandle_t xTimer); static void StopMotor(TimerHandle_t xTimer); TimerHandle_t shortVibTimer; diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index ad73063..5a0a99d 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -155,7 +155,7 @@ void SystemTask::Work() { touchPanel.Init(); dateTimeController.Register(this); batteryController.Register(this); - motorController.Init(this); + motorController.Init(); motionSensor.SoftReset(); timerController.Init(this); alarmController.Init(this); -- cgit v0.10.2