summaryrefslogtreecommitdiff
path: root/src/components/motor
diff options
context:
space:
mode:
authorMark Russell <mruss660@gmail.com>2021-09-16 20:12:20 (GMT)
committerMark Russell <mruss660@gmail.com>2021-09-16 20:12:20 (GMT)
commitcdf99b08f42c3826a8608d756bc7cda0a476ed98 (patch)
treecd30018ebb68be09653b589ae11647ca33d40c73 /src/components/motor
parent1d43adcdfa7bd15ba45c0c9d7c59c0ff99176b9c (diff)
Revert "Merge upstream"
This reverts commit 1d43adcdfa7bd15ba45c0c9d7c59c0ff99176b9c.
Diffstat (limited to 'src/components/motor')
-rw-r--r--src/components/motor/MotorController.cpp11
-rw-r--r--src/components/motor/MotorController.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index 42057a8..b25e6bc 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -2,7 +2,6 @@
#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);
@@ -13,8 +12,8 @@ MotorController::MotorController(Controllers::Settings& settingsController) : se
}
void MotorController::Init() {
- nrf_gpio_cfg_output(PinMap::Motor);
- nrf_gpio_pin_set(PinMap::Motor);
+ nrf_gpio_cfg_output(pinMotor);
+ nrf_gpio_pin_set(pinMotor);
app_timer_init();
app_timer_create(&shortVibTimer, APP_TIMER_MODE_SINGLE_SHOT, StopMotor);
@@ -31,7 +30,7 @@ void MotorController::RunForDuration(uint8_t motorDuration) {
return;
}
- nrf_gpio_pin_clear(PinMap::Motor);
+ nrf_gpio_pin_clear(pinMotor);
app_timer_start(shortVibTimer, APP_TIMER_TICKS(motorDuration), nullptr);
}
@@ -45,9 +44,9 @@ void MotorController::StartRinging() {
void MotorController::StopRinging() {
app_timer_stop(longVibTimer);
- nrf_gpio_pin_set(PinMap::Motor);
+ nrf_gpio_pin_set(pinMotor);
}
void MotorController::StopMotor(void* p_context) {
- nrf_gpio_pin_set(PinMap::Motor);
+ nrf_gpio_pin_set(pinMotor);
}
diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h
index cf78088..d2c9fe5 100644
--- a/src/components/motor/MotorController.h
+++ b/src/components/motor/MotorController.h
@@ -1,10 +1,12 @@
#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: