From 7fc5c48efa4472ec22112ad81791397e83bef3d7 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Sun, 15 May 2022 01:38:28 +0200 Subject: [PATCH] remove not needed goto and volatile --- DCCWaveform.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/DCCWaveform.cpp b/DCCWaveform.cpp index 34fb740..0737a44 100644 --- a/DCCWaveform.cpp +++ b/DCCWaveform.cpp @@ -226,17 +226,15 @@ const bool DCCWaveform::signalTransform[]={ /* WAVE_PENDING (should not happen) -> */ LOW}; void DCCWaveform::railcom2() { - volatile bool cutout; + bool cutout; if (remainingPreambles==(requiredPreambles-2)) { cutout=true; - goto doit; - } - else if (remainingPreambles==(requiredPreambles-6)) { + } else if (remainingPreambles==(requiredPreambles-6)) { 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 (progTrackSyncMain) // we are main track and synced so we take care of prog track as well progTrack.motorDriver->setRailcomCutout(cutout);