use switch case
This commit is contained in:
parent
0978964b7d
commit
71b31c78fb
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue