First implementation of the HR sensor using 100% foss code (ported from waspos)

This commit is contained in:
Jean-François Milants
2021-01-10 17:57:26 +01:00
parent 50ae0ae5e0
commit 1a582815ba
23 changed files with 714 additions and 12 deletions

View File

@@ -0,0 +1,28 @@
#pragma once
#include <cstdint>
namespace Pinetime {
namespace Applications {
class HeartRateTask;
}
namespace Controllers {
class HeartRateController {
public:
enum class States { NotEnoughData, NoTouch, Running};
void Start();
void Stop();
void Update(States newState, uint8_t heartRate);
void SetHeartRateTask(Applications::HeartRateTask* task);
States State() const { return state; }
uint8_t HeartRate() const { return heartRate; }
private:
Applications::HeartRateTask* task = nullptr;
States state = States::NotEnoughData;
uint8_t heartRate = 0;
};
}
}