From d899da58989c73111b1fc4e91147fdb12d605683 Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Mon, 1 Jan 2024 22:08:59 +0100 Subject: [PATCH] Make return type of DCC::getFn int8_t --- DCC.cpp | 2 +- DCC.h | 2 +- WiThrottle.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DCC.cpp b/DCC.cpp index 76e1509..dbc72e3 100644 --- a/DCC.cpp +++ b/DCC.cpp @@ -238,7 +238,7 @@ void DCC::changeFn( int cab, int16_t functionNumber) { // Report function state (used from withrottle protocol) // returns 0 false, 1 true or -1 for do not know -int DCC::getFn( int cab, int16_t functionNumber) { +int8_t DCC::getFn( int cab, int16_t functionNumber) { if (cab<=0 || functionNumber>28) return -1; // unknown int reg = lookupSpeedTable(cab); diff --git a/DCC.h b/DCC.h index b5cb0e9..1deaf71 100644 --- a/DCC.h +++ b/DCC.h @@ -68,7 +68,7 @@ public: static void setFunction(int cab, byte fByte, byte eByte); static bool setFn(int cab, int16_t functionNumber, bool on); static void changeFn(int cab, int16_t functionNumber); - static int getFn(int cab, int16_t functionNumber); + static int8_t getFn(int cab, int16_t functionNumber); static uint32_t getFunctionMap(int cab); static void updateGroupflags(byte &flags, int16_t functionNumber); static void setAccessory(int address, byte port, bool gate, byte onoff = 2); diff --git a/WiThrottle.cpp b/WiThrottle.cpp index 244dfd8..e71c1cd 100644 --- a/WiThrottle.cpp +++ b/WiThrottle.cpp @@ -618,7 +618,7 @@ void WiThrottle::sendFunctions(Print* stream, byte loco) { #endif for(int fKey=0; fKey=0) StringFormatter::send(stream,F("M%cA%c%d<;>F%d%d\n"),myLocos[loco].throttle,LorS(locoid),locoid,fstate,fKey); } }