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) {
HandleBackgroundWaiting(); case States::BackgroundWaiting:
} else if (state == States::BackgroundMeasuring || state == States::Measuring) { HandleBackgroundWaiting();
HandleSensorData(&lastBpm); break;
case States::BackgroundMeasuring:
case States::Measuring:
HandleSensorData(&lastBpm);
break;
case States::Idle:
case States::Running:
// nothing to do -> ignore
break;
} }
} }
} }