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