@@ -82,13 +82,28 @@ class DCCWaveform {
8282 void schedulePacket (const byte buffer[], byte byteCount, byte repeats);
8383 bool isReminderWindowOpen ();
8484 void promotePendingPacket ();
85- static bool setRailcom (bool on, bool debug);
85+ static bool setRailcom (bool on, bool debug) {
86+ if (on && railcomPossible) {
87+ railcomActive=true ;
88+ railcomDebug=debug;
89+ }
90+ else {
91+ railcomActive=false ;
92+ railcomDebug=false ;
93+ railcomSampleWindow=false ;
94+ }
95+ return railcomActive;
96+ }
97+
8698 inline static bool isRailcom () {
8799 return railcomActive;
88100 };
89101 inline static byte getRailcomCutoutCounter () {
90102 return railcomCutoutCounter;
91103 };
104+ inline static void incCutoutCounter () {
105+ railcomCutoutCounter++;
106+ }
92107 inline static bool isRailcomSampleWindow () {
93108 return railcomSampleWindow;
94109 };
@@ -138,6 +153,8 @@ class DCCWaveform {
138153 static volatile byte railcomCutoutCounter; // incremented for each cutout
139154 static volatile byte railcomLastAddressHigh,railcomLastAddressLow;
140155 static bool cutoutNextTime; // railcom
156+
157+
141158#ifdef ARDUINO_ARCH_ESP32
142159 static RMTChannel *rmtMainChannel;
143160 static RMTChannel *rmtProgChannel;
0 commit comments