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