mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-04-23 13:31:19 +02:00
Compare commits
1 Commits
87388d1ed3
...
7db1f64d65
Author | SHA1 | Date | |
---|---|---|---|
|
7db1f64d65 |
@ -70,8 +70,8 @@ Once a new OPCODE is decided upon, update this list.
|
|||||||
L, Reserved for LCC interface (implemented in EXRAIL)
|
L, Reserved for LCC interface (implemented in EXRAIL)
|
||||||
m, message to throttles broadcast
|
m, message to throttles broadcast
|
||||||
M, Write DCC packet
|
M, Write DCC packet
|
||||||
n, Reserved for SensorCam
|
n,
|
||||||
N, Reserved for Sensorcam
|
N,
|
||||||
o,
|
o,
|
||||||
O, Output broadcast
|
O, Output broadcast
|
||||||
p, Broadcast power state
|
p, Broadcast power state
|
||||||
@ -91,10 +91,10 @@ Once a new OPCODE is decided upon, update this list.
|
|||||||
w, Write CV on main
|
w, Write CV on main
|
||||||
W, Write CV
|
W, Write CV
|
||||||
x,
|
x,
|
||||||
X, Invalid command response
|
X, Invalid command
|
||||||
y,
|
y,
|
||||||
Y, Output broadcast
|
Y, Output broadcast
|
||||||
z, Direct output
|
z,
|
||||||
Z, Output configuration/control
|
Z, Output configuration/control
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
28
EXRAIL2.cpp
28
EXRAIL2.cpp
@ -1,5 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* © 2024 Paul M. Antoine
|
|
||||||
* © 2021 Neil McKechnie
|
* © 2021 Neil McKechnie
|
||||||
* © 2021-2023 Harald Barth
|
* © 2021-2023 Harald Barth
|
||||||
* © 2020-2023 Chris Harlow
|
* © 2020-2023 Chris Harlow
|
||||||
@ -1144,25 +1143,20 @@ void RMFT2::kill(const FSH * reason, int operand) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int16_t RMFT2::getSignalSlot(int16_t id) {
|
int16_t RMFT2::getSignalSlot(int16_t id) {
|
||||||
|
for (int sigslot=0;;sigslot++) {
|
||||||
if (id > 0) {
|
int16_t sighandle=GETHIGHFLASHW(RMFT2::SignalDefinitions,sigslot*8);
|
||||||
int sigslot = 0;
|
if (sighandle==0) { // end of signal list
|
||||||
int16_t sighandle = 0;
|
DIAG(F("EXRAIL Signal %d not defined"), id);
|
||||||
// Trundle down the signal list until we reach the end
|
return -1;
|
||||||
while ((sighandle = GETHIGHFLASHW(RMFT2::SignalDefinitions, sigslot * 8)) != 0)
|
}
|
||||||
{
|
VPIN sigid = sighandle & SIGNAL_ID_MASK;
|
||||||
// sigid is the signal id used in RED/AMBER/GREEN macro
|
// sigid is the signal id used in RED/AMBER/GREEN macro
|
||||||
// for a LED signal it will be same as redpin
|
// for a LED signal it will be same as redpin
|
||||||
// but for a servo signal it will also have SERVO_SIGNAL_FLAG set.
|
// but for a servo signal it will also have SERVO_SIGNAL_FLAG set.
|
||||||
VPIN sigid = sighandle & SIGNAL_ID_MASK;
|
|
||||||
if (sigid == (VPIN)id)
|
if (sigid != id) continue; // keep looking
|
||||||
return sigslot; // found it
|
return sigslot; // relative slot in signals table
|
||||||
sigslot++; // keep looking
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
// We did not find the signal
|
|
||||||
DIAG(F("EXRAIL Signal %d not defined"), id);
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void RMFT2::doSignal(int16_t id,char rag) {
|
/* static */ void RMFT2::doSignal(int16_t id,char rag) {
|
||||||
@ -1224,7 +1218,7 @@ int16_t RMFT2::getSignalSlot(int16_t id) {
|
|||||||
if (rag==SIGNAL_AMBER && (amberpin==0)) rag=SIMAMBER; // special case this func only
|
if (rag==SIGNAL_AMBER && (amberpin==0)) rag=SIMAMBER; // special case this func only
|
||||||
|
|
||||||
// Manage invert (HIGH on) pins
|
// Manage invert (HIGH on) pins
|
||||||
bool aHigh=sighandle & ACTIVE_HIGH_SIGNAL_FLAG;
|
bool aHigh=sigid & ACTIVE_HIGH_SIGNAL_FLAG;
|
||||||
|
|
||||||
// set the three pins
|
// set the three pins
|
||||||
if (redpin) {
|
if (redpin) {
|
||||||
|
@ -187,7 +187,6 @@ class LookList {
|
|||||||
static const FSH * getTurntablePositionDescription(int16_t turntableId, uint8_t positionId);
|
static const FSH * getTurntablePositionDescription(int16_t turntableId, uint8_t positionId);
|
||||||
static void startNonRecursiveTask(const FSH* reason, int16_t id,int pc);
|
static void startNonRecursiveTask(const FSH* reason, int16_t id,int pc);
|
||||||
static bool readSensor(uint16_t sensorId);
|
static bool readSensor(uint16_t sensorId);
|
||||||
static bool isSignal(int16_t id,char rag);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16_t p[]);
|
static void ComandFilter(Print * stream, byte & opcode, byte & paramCount, int16_t p[]);
|
||||||
@ -197,6 +196,7 @@ private:
|
|||||||
static bool getFlag(VPIN id,byte mask);
|
static bool getFlag(VPIN id,byte mask);
|
||||||
static int16_t progtrackLocoId;
|
static int16_t progtrackLocoId;
|
||||||
static void doSignal(int16_t id,char rag);
|
static void doSignal(int16_t id,char rag);
|
||||||
|
static bool isSignal(int16_t id,char rag);
|
||||||
static int16_t getSignalSlot(int16_t id);
|
static int16_t getSignalSlot(int16_t id);
|
||||||
static void setTurnoutHiddenState(Turnout * t);
|
static void setTurnoutHiddenState(Turnout * t);
|
||||||
#ifndef IO_NO_HAL
|
#ifndef IO_NO_HAL
|
||||||
|
@ -51,7 +51,6 @@ static void create(I2CAddress i2cAddress) {
|
|||||||
// Start by assuming we will find the clock
|
// Start by assuming we will find the clock
|
||||||
// Check if specified I2C address is responding (blocking operation)
|
// Check if specified I2C address is responding (blocking operation)
|
||||||
// Returns I2C_STATUS_OK (0) if OK, or error code.
|
// Returns I2C_STATUS_OK (0) if OK, or error code.
|
||||||
I2CManager.begin();
|
|
||||||
uint8_t _checkforclock = I2CManager.checkAddress(i2cAddress);
|
uint8_t _checkforclock = I2CManager.checkAddress(i2cAddress);
|
||||||
DIAG(F("Clock check result - %d"), _checkforclock);
|
DIAG(F("Clock check result - %d"), _checkforclock);
|
||||||
// XXXX change thistosave2 bytes
|
// XXXX change thistosave2 bytes
|
||||||
|
@ -3,13 +3,7 @@
|
|||||||
|
|
||||||
#include "StringFormatter.h"
|
#include "StringFormatter.h"
|
||||||
|
|
||||||
#define VERSION "5.2.56"
|
#define VERSION "5.2.51"
|
||||||
// 5.2.56 - Bugfix and refactor for EXRAIL getSignalSlot
|
|
||||||
// 5.2.55 - Move EXRAIL isSignal() to public to allow use in STEALTH call
|
|
||||||
// 5.2.54 - Bugfix for EXRAIL signal handling for active high
|
|
||||||
// 5.2.53 - Bugfix for EX-Fastclock, call I2CManager.begin() before checking I2C address
|
|
||||||
// 5.2.52 - Bugfix for ADCee() to handle ADC2 and ADC3 channel inputs on F446ZE and others
|
|
||||||
// - Add support for ports G and H on STM32 for ADCee() and MotorDriver pins/shadow regs
|
|
||||||
// 5.2.51 - Bugfix for SIGNAL: Distinguish between sighandle and sigid
|
// 5.2.51 - Bugfix for SIGNAL: Distinguish between sighandle and sigid
|
||||||
// 5.2.50 - EXRAIL ONBUTTON/ONSENSOR observe LATCH
|
// 5.2.50 - EXRAIL ONBUTTON/ONSENSOR observe LATCH
|
||||||
// 5.2.49 - EXRAIL additions:
|
// 5.2.49 - EXRAIL additions:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user