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() { void HeartRateTask::StartWaiting() {
StopMeasurement(); StopMeasurement();
backgroundWaitingStart = xTaskGetTickCount(); backgroundWaitingStart = xTaskGetTickCount();
} }
void HeartRateTask::HandleBackgroundWaiting() { void HeartRateTask::HandleBackgroundWaiting() {
@ -138,22 +138,23 @@ void HeartRateTask::HandleSensorData(int* lastBpm) {
StartWaiting(); 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; state = States::BackgroundWaiting;
StartWaiting(); StartWaiting();
} }
} }
int HeartRateTask::CurrentTaskDelay() { int HeartRateTask::CurrentTaskDelay() {
switch (state) { switch (state) {
case States::Measuring: case States::Measuring:
case States::BackgroundMeasuring: case States::BackgroundMeasuring:
return ppg.deltaTms; return ppg.deltaTms;
case States::Running: case States::Running:
return 100; return 100;
case States::BackgroundWaiting: case States::BackgroundWaiting:
return 10000; return 10000;
default: default:
return portMAX_DELAY; return portMAX_DELAY;
} }
} }

View file

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