2021-01-16 03:11:53 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
2021-01-25 17:44:58 +00:00
|
|
|
#include "app_timer.h"
|
2021-04-04 02:08:51 +00:00
|
|
|
#include "components/settings/Settings.h"
|
2021-01-16 03:11:53 +00:00
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
static constexpr uint8_t pinMotor = 16;
|
|
|
|
|
|
|
|
class MotorController {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-04-18 17:28:14 +00:00
|
|
|
MotorController(Controllers::Settings& settingsController);
|
|
|
|
void Init();
|
2021-05-12 18:23:04 +00:00
|
|
|
void RunForDuration(uint8_t motorDuration);
|
|
|
|
void startRunning(uint8_t motorDuration);
|
|
|
|
void stopRunning();
|
2021-01-16 03:49:37 +00:00
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2021-04-18 17:28:14 +00:00
|
|
|
Controllers::Settings& settingsController;
|
|
|
|
static void vibrate(void* p_context);
|
2021-05-12 18:23:04 +00:00
|
|
|
bool isBusy;
|
|
|
|
};
|
2021-01-16 03:11:53 +00:00
|
|
|
}
|
2021-01-25 17:44:58 +00:00
|
|
|
}
|