forked from InfiniTimeOrg/InfiniSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeartRateTask.h
More file actions
40 lines (35 loc) · 1.05 KB
/
Copy pathHeartRateTask.h
File metadata and controls
40 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <FreeRTOS.h>
//#include <task.h>
#include <queue.h>
//#include <components/heartrate/Ppg.h>
namespace Pinetime {
namespace Drivers {
class Hrs3300;
}
namespace Controllers {
class HeartRateController;
}
namespace Applications {
class HeartRateTask {
public:
enum class Messages : uint8_t { GoToSleep, WakeUp, Enable, Disable };
explicit HeartRateTask(Drivers::Hrs3300& heartRateSensor, Controllers::HeartRateController& controller);
void Start();
void Work();
void PushMessage(Messages msg);
private:
enum class States : uint8_t { Disabled, Waiting, BackgroundMeasuring, ForegroundMeasuring };
//static void Process(void* instance);
//void StartMeasurement();
//void StopMeasurement();
// TaskHandle_t taskHandle;
QueueHandle_t messageQueue;
States state = States::Disabled;
Drivers::Hrs3300& heartRateSensor;
Controllers::HeartRateController& controller;
// Controllers::Ppg ppg;
bool measurementStarted = false;
};
}
}