aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/motor/MotorController.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-09-22 12:03:41 +0300
committerRiku Isokoski <riksu9000@gmail.com>2021-09-22 12:03:41 +0300
commitb2100908373f76660fcfb5f3c454eb69a38ca4ef (patch)
tree090a52c4e10646a0d7a9383920452342b4898f4c /src/components/motor/MotorController.cpp
parentb31b2425f8afd5022173852f5a78592b37104c39 (diff)
parent1c3c3c8db919c703bbd3f1be4ce9c6833237ea6f (diff)
Merge branch 'develop' into detect_full_charge
Diffstat (limited to 'src/components/motor/MotorController.cpp')
-rw-r--r--src/components/motor/MotorController.cpp11
1 files changed, 6 insertions, 5 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);
}