diff options
| author | Michele Bini <michele.bini@gmail.com> | 2022-04-17 08:21:42 (GMT) |
|---|---|---|
| committer | Michele Bini <michele.bini@gmail.com> | 2022-04-17 08:21:42 (GMT) |
| commit | d73be76905c131c9d459cbb4e44be4bfc87dfddb (patch) | |
| tree | d1a1b09c9757e8cbbe0d381dbc60baf9d8451192 /src/components/motor/MotorController.cpp | |
| parent | 3e5fddede322814c2fea7634c1bf0d5f93bae315 (diff) | |
Simplify MotorController timer code
Diffstat (limited to 'src/components/motor/MotorController.cpp')
| -rw-r--r-- | src/components/motor/MotorController.cpp | 8 |
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); } |
