1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-07-29 18:33:44 +02:00

Add <D HAL SHOW> command to list HAL device configuration.

Also, only display HAL device configurations at startup if DIAG_IO is #defined.
This commit is contained in:
Neil McKechnie
2021-08-27 15:44:26 +01:00
parent 7e601c38c4
commit 93dfdcce53
5 changed files with 27 additions and 11 deletions

View File

@@ -42,12 +42,9 @@ DCCAccessoryDecoder::DCCAccessoryDecoder(VPIN vpin, int nPins, int DCCAddress, i
}
void DCCAccessoryDecoder::_begin() {
int endAddress = _packedAddress + _nPins - 1;
int DCCAddress = _packedAddress >> 2;
int DCCSubaddress = _packedAddress & 3;
DIAG(F("DCC Accessory Decoder configured Vpins:%d-%d Linear Address:%d-%d (%d/%d-%d/%d)"), _firstVpin, _firstVpin+_nPins-1,
_packedAddress, _packedAddress+_nPins-1,
DCCAddress, DCCSubaddress, endAddress >> 2, endAddress % 4);
#if defined(DIAG_IO)
_display();
#endif
}
// Device-specific write function.
@@ -61,7 +58,7 @@ void DCCAccessoryDecoder::_write(VPIN id, int state) {
void DCCAccessoryDecoder::_display() {
int endAddress = _packedAddress + _nPins - 1;
DIAG(F("DCC Accessory Vpins:%d-%d Linear Address:%d-%d (%d/%d-%d/%d)"), _firstVpin, _firstVpin+_nPins-1,
DIAG(F("DCCAccessoryDecoder Configured on Vpins:%d-%d Linear Address:%d-%d (%d/%d-%d/%d)"), _firstVpin, _firstVpin+_nPins-1,
_packedAddress, _packedAddress+_nPins-1,
_packedAddress >> 2, _packedAddress % 4, endAddress >> 2, endAddress % 4);
}