From 4931c5ed75af7466d205c3e8fe5e07cdadfa390f Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 5 Feb 2024 09:28:07 +0100 Subject: [PATCH 1/2] tag --- GITHUB_SHA.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GITHUB_SHA.h b/GITHUB_SHA.h index 56992fe..956a8d2 100644 --- a/GITHUB_SHA.h +++ b/GITHUB_SHA.h @@ -1 +1 @@ -#define GITHUB_SHA "devel-202402041151Z" +#define GITHUB_SHA "devel-202402050827Z" From 8293749ac76199d9b0db6988872c49039f1a4ca8 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Wed, 7 Feb 2024 22:11:27 +0000 Subject: [PATCH 2/2] JMRI_SENSOR exrail --- EXRAIL2MacroReset.h | 2 ++ EXRAILMacros.h | 3 +++ Sensors.cpp | 7 +++++++ Sensors.h | 1 + version.h | 3 ++- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/EXRAIL2MacroReset.h b/EXRAIL2MacroReset.h index 3554f6c..f52b636 100644 --- a/EXRAIL2MacroReset.h +++ b/EXRAIL2MacroReset.h @@ -84,6 +84,7 @@ #undef IFTTPOSITION #undef IFRE #undef INVERT_DIRECTION +#undef JMRI_SENSOR #undef JOIN #undef KILLALL #undef LATCH @@ -236,6 +237,7 @@ #define IFTTPOSITION(turntable_id,position) #define IFRE(sensor_id,value) #define INVERT_DIRECTION +#define JMRI_SENSOR(vpin,count...) #define JOIN #define KILLALL #define LATCH(sensor_id) diff --git a/EXRAILMacros.h b/EXRAILMacros.h index 98af846..5873e38 100644 --- a/EXRAILMacros.h +++ b/EXRAILMacros.h @@ -149,6 +149,8 @@ static_assert(!hasdup(compileTimeSequenceList[0],1),"Duplicate SEQUENCE/ROUTE/AU #define HAL(haltype,params...) haltype::create(params); #undef HAL_IGNORE_DEFAULTS #define HAL_IGNORE_DEFAULTS ignore_defaults=true; +#undef JMRI_SENSOR +#define JMRI_SENSOR(vpin,count...) Sensor::createMultiple(vpin,##count); bool exrailHalSetup() { bool ignore_defaults=false; #include "myAutomation.h" @@ -487,6 +489,7 @@ int RMFT2::onLCCLookup[RMFT2::countLCCLookup]; #endif #define IFRE(sensor_id,value) OPCODE_IFRE,V(sensor_id),OPCODE_PAD,V(value), #define INVERT_DIRECTION OPCODE_INVERT_DIRECTION,0,0, +#define JMRI_SENSOR(vpin,count...) #define JOIN OPCODE_JOIN,0,0, #define KILLALL OPCODE_KILLALL,0,0, #define LATCH(sensor_id) OPCODE_LATCH,V(sensor_id), diff --git a/Sensors.cpp b/Sensors.cpp index d1c0fe5..efd969d 100644 --- a/Sensors.cpp +++ b/Sensors.cpp @@ -230,6 +230,13 @@ Sensor *Sensor::create(int snum, VPIN pin, int pullUp){ return tt; } +// Creet multiple eponymous sensors based on vpin alone. +void Sensor::createMultiple(VPIN firstPin, byte count) { + for (byte i=0;i types. // 5.2.40 - Bugfix: WiThrottle sendIntro after initial N message as well // 5.2.29 - Added IO_I2CDFPlayer.h to support DFPLayer over I2C connected to NXP SC16IS750/SC16IS752 (currently only single UART for SC16IS752) // - Added enhanced IO_I2CDFPLayer enum commands to EXRAIL2.h