1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-16 22:19:14 +01:00

remove not needed goto and volatile

This commit is contained in:
Harald Barth 2022-05-15 01:38:28 +02:00
parent c245c27f5d
commit 7fc5c48efa

View File

@ -226,17 +226,15 @@ const bool DCCWaveform::signalTransform[]={
/* WAVE_PENDING (should not happen) -> */ LOW}; /* WAVE_PENDING (should not happen) -> */ LOW};
void DCCWaveform::railcom2() { void DCCWaveform::railcom2() {
volatile bool cutout; bool cutout;
if (remainingPreambles==(requiredPreambles-2)) { if (remainingPreambles==(requiredPreambles-2)) {
cutout=true; cutout=true;
goto doit; } else if (remainingPreambles==(requiredPreambles-6)) {
}
else if (remainingPreambles==(requiredPreambles-6)) {
cutout=false; cutout=false;
goto doit; } else {
return; // neiter start or end of cutout, do nothing
} }
return; // neiter start or end of cutout, do nothing
doit:
if (isMainTrack) { if (isMainTrack) {
if (progTrackSyncMain) // we are main track and synced so we take care of prog track as well if (progTrackSyncMain) // we are main track and synced so we take care of prog track as well
progTrack.motorDriver->setRailcomCutout(cutout); progTrack.motorDriver->setRailcomCutout(cutout);