From 9cf70f5870576d5667e4d310a54975261e03398f Mon Sep 17 00:00:00 2001 From: Asbelos Date: Tue, 19 Apr 2022 09:35:03 +0100 Subject: [PATCH 1/2] myFilter auto detect --- DCCEXParser.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/DCCEXParser.cpp b/DCCEXParser.cpp index 9d0cf5c..6c7518e 100644 --- a/DCCEXParser.cpp +++ b/DCCEXParser.cpp @@ -94,7 +94,7 @@ Print *DCCEXParser::stashStream = NULL; RingStream *DCCEXParser::stashRingStream = NULL; byte DCCEXParser::stashTarget=0; -// This is a JMRI command parser, one instance per incoming stream +// This is a JMRI command parser. // It doesnt know how the string got here, nor how it gets back. // It knows nothing about hardware or tracks... it just parses strings and // calls the corresponding DCC api. @@ -165,9 +165,12 @@ int16_t DCCEXParser::splitValues(int16_t result[MAX_COMMAND_PARAMS], const byte return parameterCount; } -FILTER_CALLBACK DCCEXParser::filterCallback = 0; +extern __attribute__((weak)) FILTER_CALLBACK myFilter(); +FILTER_CALLBACK DCCEXParser::filterCallback = myFilter; FILTER_CALLBACK DCCEXParser::filterRMFTCallback = 0; AT_COMMAND_CALLBACK DCCEXParser::atCommandCallback = 0; + +// deprecated void DCCEXParser::setFilter(FILTER_CALLBACK filter) { filterCallback = filter; From ff4dd2f1cdbd853a464991e03c69b5d8d91d6c79 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Tue, 19 Apr 2022 11:34:57 +0100 Subject: [PATCH 2/2] Update version.h --- version.h | 1 + 1 file changed, 1 insertion(+) diff --git a/version.h b/version.h index 372fbd2..8ca3ea4 100644 --- a/version.h +++ b/version.h @@ -6,6 +6,7 @@ #define VERSION "4.0.2" // 4.0.2 EXRAIL additions: +// myFilter automatic detection (no need to call setFilter) // FIX negative route ids in WIthrottle problem. // IFRED(signal_id), IFAMBER(signal_id), IFGREEN(signal_id) // commands