HR Sensor : do not go to sleep when the HR app is running.

This commit is contained in:
Jean-François Milants
2021-01-10 22:02:21 +01:00
parent 1a582815ba
commit c82c22650c
4 changed files with 28 additions and 3 deletions

View File

@@ -6,11 +6,16 @@ namespace Pinetime {
namespace Applications {
class HeartRateTask;
}
namespace System {
class SystemTask;
}
namespace Controllers {
class HeartRateController {
public:
enum class States { NotEnoughData, NoTouch, Running};
explicit HeartRateController(System::SystemTask& systemTask);
void Start();
void Stop();
void Update(States newState, uint8_t heartRate);
@@ -20,6 +25,7 @@ namespace Pinetime {
uint8_t HeartRate() const { return heartRate; }
private:
System::SystemTask& systemTask;
Applications::HeartRateTask* task = nullptr;
States state = States::NotEnoughData;
uint8_t heartRate = 0;