summaryrefslogtreecommitdiff
path: root/src/components/motor
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/motor')
-rw-r--r--src/components/motor/MotorController.cpp10
-rw-r--r--src/components/motor/MotorController.h5
2 files changed, 2 insertions, 13 deletions
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index 42057a86..f596c718 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -9,9 +9,6 @@ APP_TIMER_DEF(longVibTimer);
using namespace Pinetime::Controllers;
-MotorController::MotorController(Controllers::Settings& settingsController) : settingsController {settingsController} {
-}
-
void MotorController::Init() {
nrf_gpio_cfg_output(PinMap::Motor);
nrf_gpio_pin_set(PinMap::Motor);
@@ -27,18 +24,11 @@ void MotorController::Ring(void* p_context) {
}
void MotorController::RunForDuration(uint8_t motorDuration) {
- if (settingsController.GetVibrationStatus() == Controllers::Settings::Vibration::OFF) {
- return;
- }
-
nrf_gpio_pin_clear(PinMap::Motor);
app_timer_start(shortVibTimer, APP_TIMER_TICKS(motorDuration), nullptr);
}
void MotorController::StartRinging() {
- if (settingsController.GetVibrationStatus() == Controllers::Settings::Vibration::OFF) {
- return;
- }
Ring(this);
app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this);
}
diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h
index cf78088e..c9326d57 100644
--- a/src/components/motor/MotorController.h
+++ b/src/components/motor/MotorController.h
@@ -1,14 +1,14 @@
#pragma once
#include <cstdint>
-#include "components/settings/Settings.h"
namespace Pinetime {
namespace Controllers {
class MotorController {
public:
- MotorController(Controllers::Settings& settingsController);
+ MotorController() = default;
+
void Init();
void RunForDuration(uint8_t motorDuration);
void StartRinging();
@@ -16,7 +16,6 @@ namespace Pinetime {
private:
static void Ring(void* p_context);
- Controllers::Settings& settingsController;
static void StopMotor(void* p_context);
};
}