mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-22 23:56:13 +01:00
Bug: Withrottle roster list returning empty string vs NULL
This commit is contained in:
parent
5a9adea2b6
commit
58e62aaa81
|
@ -223,7 +223,7 @@ const FSH * RMFT2::getRosterFunctions(int16_t id) {
|
||||||
#include "myAutomation.h"
|
#include "myAutomation.h"
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
return F("");
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass 8 Signal definitions
|
// Pass 8 Signal definitions
|
||||||
|
|
|
@ -533,11 +533,11 @@ void WiThrottle::sendRoster(Print* stream) {
|
||||||
StringFormatter::send(stream,F("RL%d"), RMFT2::rosterNameCount);
|
StringFormatter::send(stream,F("RL%d"), RMFT2::rosterNameCount);
|
||||||
for (int16_t r=0;;r++) {
|
for (int16_t r=0;;r++) {
|
||||||
int16_t cabid=GETHIGHFLASHW(RMFT2::rosterIdList,r*2);
|
int16_t cabid=GETHIGHFLASHW(RMFT2::rosterIdList,r*2);
|
||||||
|
if (cabid == INT16_MAX)
|
||||||
|
break;
|
||||||
if (cabid > 0)
|
if (cabid > 0)
|
||||||
StringFormatter::send(stream,F("]\\[%S}|{%d}|{%c"),
|
StringFormatter::send(stream,F("]\\[%S}|{%d}|{%c"),
|
||||||
RMFT2::getRosterName(cabid),cabid,cabid<128?'S':'L');
|
RMFT2::getRosterName(cabid),cabid,cabid<128?'S':'L');
|
||||||
if (cabid == INT16_MAX)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
StringFormatter::send(stream,F("\n"));
|
StringFormatter::send(stream,F("\n"));
|
||||||
#else
|
#else
|
||||||
|
@ -574,12 +574,12 @@ void WiThrottle::sendFunctions(Print* stream, byte loco) {
|
||||||
myLocos[loco].functionToggles=1<<2; // F2 (HORN) is a non-toggle
|
myLocos[loco].functionToggles=1<<2; // F2 (HORN) is a non-toggle
|
||||||
|
|
||||||
#ifdef EXRAIL_ACTIVE
|
#ifdef EXRAIL_ACTIVE
|
||||||
const char * functionNames=(char *) RMFT2::getRosterFunctions(locoid);
|
const FSH * functionNames= RMFT2::getRosterFunctions(locoid);
|
||||||
if (!functionNames) {
|
if (functionNames == NULL) {
|
||||||
// no roster entry for locoid, try to find default entry
|
// no roster entry for locoid, try to find default entry
|
||||||
functionNames=(char *) RMFT2::getRosterFunctions(0);
|
functionNames= RMFT2::getRosterFunctions(0);
|
||||||
}
|
}
|
||||||
if (!functionNames) {
|
if (functionNames == NULL) {
|
||||||
// no default roster entry either, use non-exrail presets as above
|
// no default roster entry either, use non-exrail presets as above
|
||||||
}
|
}
|
||||||
else if (GETFLASH(functionNames)=='\0') {
|
else if (GETFLASH(functionNames)=='\0') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user