InfiniTime/src/heartratetask/HeartRateTask.h
Finlay Davidson 96165a8541 Format header files
In my PR updating clang-format, I forgot to also format the headers.
2023-01-09 21:41:21 +01:00

43 lines
1.0 KiB
C++

#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, StartMeasurement, StopMeasurement };
enum class States { Idle, Running };
explicit HeartRateTask(Drivers::Hrs3300& heartRateSensor, Controllers::HeartRateController& controller);
void Start();
void Work();
void PushMessage(Messages msg);
private:
static void Process(void* instance);
void StartMeasurement();
void StopMeasurement();
TaskHandle_t taskHandle;
QueueHandle_t messageQueue;
States state = States::Running;
Drivers::Hrs3300& heartRateSensor;
Controllers::HeartRateController& controller;
Controllers::Ppg ppg;
bool measurementStarted = false;
};
}
}