diff options
author | hubmartin <hub.martin@gmail.com> | 2021-09-16 22:04:31 +0200 |
---|---|---|
committer | hubmartin <hub.martin@gmail.com> | 2021-09-16 22:04:31 +0200 |
commit | 27366bdfdf05a5fd3128ad8eabedbeba720ca885 (patch) | |
tree | 94bf7fe9e60c7c88d269e207acb197915eb98660 /src/components/motor | |
parent | db50131ed49f2fdb639799ca12839862340f8396 (diff) | |
parent | 3eb73774a39e255cd4b5de76441a59f1525a989c (diff) |
Merge branch 'develop' into wake-time
Diffstat (limited to 'src/components/motor')
-rw-r--r-- | src/components/motor/MotorController.cpp | 11 | ||||
-rw-r--r-- | src/components/motor/MotorController.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp index b25e6bc8..42057a86 100644 --- a/src/components/motor/MotorController.cpp +++ b/src/components/motor/MotorController.cpp @@ -2,6 +2,7 @@ #include <hal/nrf_gpio.h> #include "systemtask/SystemTask.h" #include "app_timer.h" +#include "drivers/PinMap.h" APP_TIMER_DEF(shortVibTimer); APP_TIMER_DEF(longVibTimer); @@ -12,8 +13,8 @@ MotorController::MotorController(Controllers::Settings& settingsController) : se } void MotorController::Init() { - nrf_gpio_cfg_output(pinMotor); - nrf_gpio_pin_set(pinMotor); + nrf_gpio_cfg_output(PinMap::Motor); + nrf_gpio_pin_set(PinMap::Motor); app_timer_init(); app_timer_create(&shortVibTimer, APP_TIMER_MODE_SINGLE_SHOT, StopMotor); @@ -30,7 +31,7 @@ void MotorController::RunForDuration(uint8_t motorDuration) { return; } - nrf_gpio_pin_clear(pinMotor); + nrf_gpio_pin_clear(PinMap::Motor); app_timer_start(shortVibTimer, APP_TIMER_TICKS(motorDuration), nullptr); } @@ -44,9 +45,9 @@ void MotorController::StartRinging() { void MotorController::StopRinging() { app_timer_stop(longVibTimer); - nrf_gpio_pin_set(pinMotor); + nrf_gpio_pin_set(PinMap::Motor); } void MotorController::StopMotor(void* p_context) { - nrf_gpio_pin_set(pinMotor); + nrf_gpio_pin_set(PinMap::Motor); } diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h index d2c9fe5f..cf78088e 100644 --- a/src/components/motor/MotorController.h +++ b/src/components/motor/MotorController.h @@ -1,12 +1,10 @@ #pragma once #include <cstdint> -#include "app_timer.h" #include "components/settings/Settings.h" namespace Pinetime { namespace Controllers { - static constexpr uint8_t pinMotor = 16; class MotorController { public: |