use switch case

This commit is contained in:
Patric Gruber 2024-08-31 00:40:58 +02:00
parent 0978964b7d
commit 71b31c78fb

View file

@ -64,10 +64,18 @@ void HeartRateTask::Work() {
}
}
if (state == States::BackgroundWaiting) {
switch (state) {
case States::BackgroundWaiting:
HandleBackgroundWaiting();
} else if (state == States::BackgroundMeasuring || state == States::Measuring) {
break;
case States::BackgroundMeasuring:
case States::Measuring:
HandleSensorData(&lastBpm);
break;
case States::Idle:
case States::Running:
// nothing to do -> ignore
break;
}
}
}