properly format using clang-format

This commit is contained in:
Patric Gruber 2023-07-07 23:20:41 +02:00
parent 7ae790bcdb
commit 5dbe1f77b5
2 changed files with 17 additions and 16 deletions

View file

@ -100,8 +100,8 @@ void HeartRateTask::StopMeasurement() {
}
void HeartRateTask::StartWaiting() {
StopMeasurement();
backgroundWaitingStart = xTaskGetTickCount();
StopMeasurement();
backgroundWaitingStart = xTaskGetTickCount();
}
void HeartRateTask::HandleBackgroundWaiting() {
@ -138,22 +138,23 @@ void HeartRateTask::HandleSensorData(int* lastBpm) {
StartWaiting();
}
}
if (bpm == 0 && state == States::BackgroundMeasuring && xTaskGetTickCount() - measurementStart >= DURATION_UNTIL_BACKGROUND_MEASURMENT_IS_STOPPED) {
if (bpm == 0 && state == States::BackgroundMeasuring &&
xTaskGetTickCount() - measurementStart >= DURATION_UNTIL_BACKGROUND_MEASURMENT_IS_STOPPED) {
state = States::BackgroundWaiting;
StartWaiting();
}
}
int HeartRateTask::CurrentTaskDelay() {
switch (state) {
case States::Measuring:
case States::BackgroundMeasuring:
return ppg.deltaTms;
case States::Running:
return 100;
case States::BackgroundWaiting:
return 10000;
default:
return portMAX_DELAY;
}
switch (state) {
case States::Measuring:
case States::BackgroundMeasuring:
return ppg.deltaTms;
case States::Running:
return 100;
case States::BackgroundWaiting:
return 10000;
default:
return portMAX_DELAY;
}
}

View file

@ -4,8 +4,8 @@
#include <queue.h>
#include <components/heartrate/Ppg.h>
#define DURATION_BETWEEN_BACKGROUND_MEASUREMENTS 5 * 60 * 1000 // 5 minutes assuming 1 Hz
#define DURATION_UNTIL_BACKGROUND_MEASURMENT_IS_STOPPED 30 * 1000 // 30 seconds assuming 1 Hz
#define DURATION_BETWEEN_BACKGROUND_MEASUREMENTS 5 * 60 * 1000 // 5 minutes assuming 1 Hz
#define DURATION_UNTIL_BACKGROUND_MEASURMENT_IS_STOPPED 30 * 1000 // 30 seconds assuming 1 Hz
namespace Pinetime {
namespace Drivers {