stop background after 30s of no data from the heart rate sensor
This commit is contained in:
parent
f94c074064
commit
eeaf5374d4
|
@ -154,6 +154,10 @@ void HeartRateTask::HandleSensorData(int* lastBpm) {
|
||||||
state = States::BackgroundWaiting;
|
state = States::BackgroundWaiting;
|
||||||
StartWaiting();
|
StartWaiting();
|
||||||
}
|
}
|
||||||
|
if (bpm == 0 && state == States::BackgroundMeasuring && xTaskGetTickCount() - measurementStart >= DURATION_UNTIL_BACKGROUND_MEASURMENT_IS_STOPPED) {
|
||||||
|
state = States::BackgroundWaiting;
|
||||||
|
StartWaiting();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int HeartRateTask::CurrentTaskDelay() {
|
int HeartRateTask::CurrentTaskDelay() {
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
#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
|
||||||
|
|
||||||
#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
|
||||||
|
|
||||||
namespace Pinetime {
|
namespace Pinetime {
|
||||||
namespace Drivers {
|
namespace Drivers {
|
||||||
|
|
Loading…
Reference in a new issue