1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-06-16 04:25:24 +02:00

Compare commits

..

No commits in common. "ffc0f7431269159b9c43104707331060bb175d54" and "f163e171e406a9179787c5492564086969c31bea" have entirely different histories.

10 changed files with 30 additions and 50 deletions

View File

@ -1079,9 +1079,6 @@ void DCC::displayCabList(Print * stream) {
} }
void DCC::setLocoInBlock(int loco, uint16_t blockid, bool exclusive) { void DCC::setLocoInBlock(int loco, uint16_t blockid, bool exclusive) {
// avoid unused warnings when EXRAIL not active
(void)loco; (void)blockid; (void)exclusive;
// update block loco is in, tell exrail leaving old block, and entering new. // update block loco is in, tell exrail leaving old block, and entering new.
// NOTE: The loco table scanning is really inefficient and needs rewriting // NOTE: The loco table scanning is really inefficient and needs rewriting
@ -1110,8 +1107,7 @@ void DCC::setLocoInBlock(int loco, uint16_t blockid, bool exclusive) {
} }
void DCC::clearBlock(uint16_t blockid) { void DCC::clearBlock(uint16_t blockid) {
(void)blockid; // avoid unused warning when EXRAIL not active // Railcom reports block empty... tell Exrail about all leavers
// clear block occupied by loco, tell exrail about all leavers
#ifdef EXRAIL_ACTIVE #ifdef EXRAIL_ACTIVE
SLOTLOOP { SLOTLOOP {
if (slot->loco==0) break; // no more locos if (slot->loco==0) break; // no more locos

View File

@ -109,9 +109,9 @@ uint16_t DCCQueue::lastSentPacketLocoId=0; // used to prevent two packets to the
// kill any existing throttle packets for this loco (or all locos if broadcast) // kill any existing throttle packets for this loco (or all locos if broadcast)
// this will also remove any estop packets for this loco (or all locos if broadcast) but they will be replaced // this will also remove any estop packets for this loco (or all locos if broadcast) but they will be replaced
PendingSlot * pNext=nullptr; PendingSlot * pNext;
for (auto p=highPriorityQueue->head;p;p=pNext) { for (auto p=highPriorityQueue->head;p;p=pNext) {
pNext=p->next; // save next packet in case we recycle this one auto pNext=p->next; // save next packet in case we recycle this one
if (p->type!=ACC_OFF_PACKET && (loco==0 || p->locoId==loco)) { if (p->type!=ACC_OFF_PACKET && (loco==0 || p->locoId==loco)) {
// remove this slot from the queue or it will interfere with our ESTOP // remove this slot from the queue or it will interfere with our ESTOP
highPriorityQueue->remove(p); highPriorityQueue->remove(p);

View File

@ -73,8 +73,6 @@ public:
} }
void _writeAnalogue(VPIN vpin, int value, uint8_t profile, uint16_t duration) override { void _writeAnalogue(VPIN vpin, int value, uint8_t profile, uint16_t duration) override {
(void)profile; // suppress warning, not used in this function
(void)duration; // suppress warning, not used in this function
int pin=vpin - _firstVpin; int pin=vpin - _firstVpin;
_pinValues[pin]=value; // this is analog write _pinValues[pin]=value; // this is analog write
} }

View File

@ -72,8 +72,6 @@ const byte _DIR_MASK = 0x30;
void EncoderThrottle::_loop(unsigned long currentMicros) { void EncoderThrottle::_loop(unsigned long currentMicros) {
(void) currentMicros; // suppress warning
if (_locoid==0) return; // not in use if (_locoid==0) return; // not in use
// Clicking down on the roco, stops the loco and sets the direction as unknown. // Clicking down on the roco, stops the loco and sets the direction as unknown.
@ -120,10 +118,9 @@ const byte _DIR_MASK = 0x30;
} }
} }
// Set locoid as analog value to start drive // Selocoid as analog value to start drive
// use <z vpin locoid [notch]> // use <z vpin locoid [notch]>
void EncoderThrottle::_writeAnalogue(VPIN vpin, int value, uint8_t param1, uint16_t param2) { void EncoderThrottle::_writeAnalogue(VPIN vpin, int value, uint8_t param1, uint16_t param2) {
(void)vpin; // not used, but needed to match IODevice interface
(void) param2; (void) param2;
_locoid=value; _locoid=value;
if (param1>0) _notch=param1; if (param1>0) _notch=param1;

View File

@ -197,7 +197,6 @@ public:
// Check for incoming data, and update busy flag and other state accordingly // Check for incoming data, and update busy flag and other state accordingly
void processIncoming(unsigned long currentMicros) { void processIncoming(unsigned long currentMicros) {
(void)currentMicros; // suppress warning, not used in this function
// Expected message is in the form "7E FF 06 3D xx xx xx xx xx EF" // Expected message is in the form "7E FF 06 3D xx xx xx xx xx EF"
RX_fifo_lvl(); RX_fifo_lvl();
if (FIFO_RX_LEVEL >= 10) { if (FIFO_RX_LEVEL >= 10) {
@ -309,7 +308,7 @@ public:
sendPacket(0x0C,0,0); sendPacket(0x0C,0,0);
_resetCmd = false; _resetCmd = false;
} else if(_volCmd == true) { // do the volme before palying a track } else if(_volCmd == true) { // do the volme before palying a track
if(_requestedVolumeLevel <= 30) { if(_requestedVolumeLevel >= 0 && _requestedVolumeLevel <= 30){
_currentVolume = _requestedVolumeLevel; // If _requestedVolumeLevel is out of range, sent _currentV1olume _currentVolume = _requestedVolumeLevel; // If _requestedVolumeLevel is out of range, sent _currentV1olume
} }
sendPacket(0x06, 0x00, _currentVolume); sendPacket(0x06, 0x00, _currentVolume);
@ -408,9 +407,6 @@ public:
// Write to a vPin will do nothing // Write to a vPin will do nothing
void _write(VPIN vpin, int value) override { void _write(VPIN vpin, int value) override {
(void)vpin; // suppress warning, not used in this function
(void)value; // suppress warning, not used in this function
if (_deviceState == DEVSTATE_FAILED) return; if (_deviceState == DEVSTATE_FAILED) return;
#ifdef DIAG_IO #ifdef DIAG_IO
DIAG(F("I2CDFPlayer: Writing to any vPin not supported")); DIAG(F("I2CDFPlayer: Writing to any vPin not supported"));

View File

@ -77,7 +77,6 @@ void I2CRailcom::create(VPIN firstVpin, int nPins, I2CAddress i2cAddress) {
void I2CRailcom::_loop(unsigned long currentMicros) { void I2CRailcom::_loop(unsigned long currentMicros) {
(void)currentMicros; // not used, but needed to match IODevice interface
// Read responses from device // Read responses from device
if (_deviceState!=DEVSTATE_NORMAL) return; if (_deviceState!=DEVSTATE_NORMAL) return;

View File

@ -136,7 +136,6 @@ private:
// Return the position sent by the rotary encoder software // Return the position sent by the rotary encoder software
int _readAnalogue(VPIN vpin) override { int _readAnalogue(VPIN vpin) override {
(void)vpin; // suppress warning, not used in this function
if (_deviceState == DEVSTATE_FAILED) return 0; if (_deviceState == DEVSTATE_FAILED) return 0;
return _position; return _position;
} }
@ -154,8 +153,6 @@ private:
// To be valid, must be 0 to 255, and different to the current position // To be valid, must be 0 to 255, and different to the current position
// If the current position is the same, it was initiated by the rotary encoder // If the current position is the same, it was initiated by the rotary encoder
void _writeAnalogue(VPIN vpin, int position, uint8_t profile, uint16_t duration) override { void _writeAnalogue(VPIN vpin, int position, uint8_t profile, uint16_t duration) override {
(void)profile; // suppress warning, not used in this function
(void)duration; // suppress warning, not used in this function
if (vpin == _firstVpin + 2) { if (vpin == _firstVpin + 2) {
if (position >= 0 && position <= 255 && position != _position) { if (position >= 0 && position <= 255 && position != _position) {
byte newPosition = position & 0xFF; byte newPosition = position & 0xFF;

View File

@ -1,5 +1,5 @@
ECHO ON ECHO ON
FOR /F "delims=" %%i IN ('dir %TMP%\CommandStation-EX.ino.elf /s /b /o-D') DO SET ELF=%%i FOR /F "delims=" %%i IN ('dir %TMP%\arduino\sketches\CommandStation-EX.ino.elf /s /b /o-D') DO SET ELF=%%i
SET DUMP=%TEMP%\OBJDUMP.txt SET DUMP=%TEMP%\OBJDUMP.txt
echo Most recent subfolder: %ELF% >%DUMP% echo Most recent subfolder: %ELF% >%DUMP%

View File

@ -32,7 +32,7 @@ upload_protocol = sam-ba
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -std=c++17 ${env.build_flags} build_flags = -std=c++17
[env:samd21-zero-usb] [env:samd21-zero-usb]
platform = atmelsam platform = atmelsam
@ -42,7 +42,7 @@ upload_protocol = sam-ba
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -std=c++17 ${env.build_flags} build_flags = -std=c++17
[env:Arduino-M0] [env:Arduino-M0]
platform = atmelsam platform = atmelsam
@ -51,7 +51,7 @@ framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -std=c++17 ${env.build_flags} build_flags = -std=c++17
[env:mega2560-debug] [env:mega2560-debug]
platform = atmelavr platform = atmelavr
@ -63,7 +63,7 @@ lib_deps =
SPI SPI
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -DDIAG_IO=2 -DDIAG_LOOPTIMES ${env.build_flags} build_flags = -DDIAG_IO=2 -DDIAG_LOOPTIMES
[env:mega2560-no-HAL] [env:mega2560-no-HAL]
platform = atmelavr platform = atmelavr
@ -75,7 +75,7 @@ lib_deps =
SPI SPI
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -DIO_NO_HAL ${env.build_flags} build_flags = -DIO_NO_HAL
[env:mega2560-I2C-wire] [env:mega2560-I2C-wire]
platform = atmelavr platform = atmelavr
@ -87,7 +87,7 @@ lib_deps =
SPI SPI
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -DI2C_USE_WIRE ${env.build_flags} build_flags = -DI2C_USE_WIRE
[env:mega2560] [env:mega2560]
platform = atmelavr platform = atmelavr
@ -106,7 +106,7 @@ lib_ignore = WiFi101
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = ${env.build_flags} build_flags =
[env:mega2560-eth] [env:mega2560-eth]
platform = atmelavr platform = atmelavr
@ -123,7 +123,6 @@ lib_ignore = WiFi101
WiFiNINA_Generic WiFiNINA_Generic
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = ${env.build_flags}
[env:mega328] [env:mega328]
platform = atmelavr platform = atmelavr
@ -135,7 +134,6 @@ lib_deps =
SPI SPI
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags= ${env.build_flags}
[env:unowifiR2] [env:unowifiR2]
platform = atmelmegaavr platform = atmelmegaavr
@ -147,7 +145,7 @@ lib_deps =
SPI SPI
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = ${env.build_flags} "-DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO_WIFI_DEV_ED -DARDUINO_ARCH_AVR -DESP_CH_UART -DESP_CH_UART_BR=19200" build_flags = "-DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO_WIFI_DEV_ED -DARDUINO_ARCH_AVR -DESP_CH_UART -DESP_CH_UART_BR=19200"
[env:nanoevery] [env:nanoevery]
platform = atmelmegaavr platform = atmelmegaavr
@ -160,7 +158,7 @@ lib_deps =
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
upload_speed = 19200 upload_speed = 19200
build_flags = ${env.build_flags} build_flags =
[env:uno] [env:uno]
platform = atmelavr platform = atmelavr
@ -169,7 +167,7 @@ framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -mcall-prologues ${env.build_flags} build_flags = -mcall-prologues
[env:nano] [env:nano]
platform = atmelavr platform = atmelavr
@ -179,7 +177,7 @@ framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
build_flags = -mcall-prologues ${env.build_flags} build_flags = -mcall-prologues
[env:ESP32] [env:ESP32]
; Lock version to 6.7.0 as that is ; Lock version to 6.7.0 as that is
@ -190,7 +188,7 @@ platform = espressif32 @ 6.7.0
board = esp32dev board = esp32dev
framework = arduino framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
build_flags = -std=c++17 ${env.build_flags} build_flags = -std=c++17
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
@ -199,7 +197,7 @@ platform = ststm32 @ 19.0.0
board = nucleo_f411re board = nucleo_f411re
framework = arduino framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2 -Wunused-variable
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
@ -208,7 +206,7 @@ platform = ststm32 @ 19.0.0
board = nucleo_f446re board = nucleo_f446re
framework = arduino framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2 -Wunused-variable
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
@ -220,7 +218,7 @@ platform = ststm32 @ 19.0.0
board = nucleo_f401re board = nucleo_f401re
framework = arduino framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2 -Wunused-variable
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
@ -245,7 +243,7 @@ platform = ststm32 @ 19.0.0
board = nucleo_f446ze board = nucleo_f446ze
framework = arduino framework = arduino
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2 -Wunused-variable
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
@ -276,7 +274,7 @@ lib_ignore = WiFi101
WiFiEspAT WiFiEspAT
WiFiMulti_Generic WiFiMulti_Generic
WiFiNINA_Generic WiFiNINA_Generic
build_flags = -std=c++17 -Os -g2 ${env.build_flags} -DCUSTOM_PERIPHERAL_PINS build_flags = -std=c++17 -Os -g2 -Wunused-variable -DCUSTOM_PERIPHERAL_PINS
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
upload_protocol = stlink upload_protocol = stlink
@ -295,7 +293,7 @@ lib_ignore = WiFi101
WiFiEspAT WiFiEspAT
WiFiMulti_Generic WiFiMulti_Generic
WiFiNINA_Generic WiFiNINA_Generic
build_flags = -std=c++17 -Os -g2 ${env.build_flags} -DCUSTOM_PERIPHERAL_PINS build_flags = -std=c++17 -Os -g2 -Wunused-variable -DCUSTOM_PERIPHERAL_PINS
monitor_speed = 115200 monitor_speed = 115200
monitor_echo = yes monitor_echo = yes
upload_protocol = stlink upload_protocol = stlink
@ -304,7 +302,7 @@ upload_protocol = stlink
platform = teensy platform = teensy
board = teensy31 board = teensy31
framework = arduino framework = arduino
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
lib_ignore = NativeEthernet lib_ignore = NativeEthernet
@ -312,7 +310,7 @@ lib_ignore = NativeEthernet
platform = teensy platform = teensy
board = teensy35 board = teensy35
framework = arduino framework = arduino
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
lib_ignore = NativeEthernet lib_ignore = NativeEthernet
@ -320,7 +318,7 @@ lib_ignore = NativeEthernet
platform = teensy platform = teensy
board = teensy36 board = teensy36
framework = arduino framework = arduino
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
lib_ignore = NativeEthernet lib_ignore = NativeEthernet
@ -328,7 +326,7 @@ lib_ignore = NativeEthernet
platform = teensy platform = teensy
board = teensy40 board = teensy40
framework = arduino framework = arduino
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
lib_ignore = NativeEthernet lib_ignore = NativeEthernet
@ -336,6 +334,6 @@ lib_ignore = NativeEthernet
platform = teensy platform = teensy
board = teensy41 board = teensy41
framework = arduino framework = arduino
build_flags = -std=c++17 -Os -g2 ${env.build_flags} build_flags = -std=c++17 -Os -g2
lib_deps = ${env.lib_deps} lib_deps = ${env.lib_deps}
lib_ignore = lib_ignore =

View File

@ -3,8 +3,7 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "5.5.29" #define VERSION "5.5.28"
// 5.2.29 - Resolved compiler warnings
// 5.5.28 - DCC Queue memory leak fix // 5.5.28 - DCC Queue memory leak fix
// 5.5.27 - PCF8574 output pin initialization parameter // 5.5.27 - PCF8574 output pin initialization parameter
// 5.5.26 - PCA9554 and TCA9554/9534 I2C 8-bit GPIO expander drivers // 5.5.26 - PCA9554 and TCA9554/9534 I2C 8-bit GPIO expander drivers