From 3fe04c1a0eb4e81c2d715a41cadeb6bf8030b414 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Mon, 12 Oct 2020 22:18:55 +0100 Subject: [PATCH] DCC getFn --- DCC.cpp | 9 +++++++++ DCC.h | 1 + 2 files changed, 10 insertions(+) diff --git a/DCC.cpp b/DCC.cpp index ca563ac..972dfa3 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -155,6 +155,15 @@ int DCC::changeFn( int cab, byte functionNumber, bool pressed) { return funcstate; } +int DCC::getFn( int cab, byte functionNumber) { + if (cab<=0 || functionNumber>28) return -1; // unknown + int reg = lookupSpeedTable(cab); + if (reg<0) return -1; + + unsigned long funcmask = (1UL<