updated the examples to reflect the removal of support for the two call-back functions: notifyDccAccState(), notifyDccSigState()
This commit is contained in:
@@ -56,20 +56,7 @@ void notifyDccMsg( DCC_MSG * Msg)
|
||||
}
|
||||
#endif
|
||||
|
||||
// This function is called whenever a normal DCC Turnout Packet is received
|
||||
void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State)
|
||||
{
|
||||
Serial.print("notifyDccAccState: ") ;
|
||||
Serial.print(Addr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(BoardAddr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(OutputAddr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.println(State, HEX) ;
|
||||
}
|
||||
|
||||
// This function is called whenever a normal DCC Turnout Packet is received
|
||||
// This function is called whenever a normal DCC Turnout Packet is received and we're in Board Addressing Mode
|
||||
void notifyDccAccTurnoutBoard( uint16_t BoardAddr, uint8_t OutputPair, uint8_t Direction, uint8_t OutputPower )
|
||||
{
|
||||
Serial.print("notifyDccAccTurnoutBoard: ") ;
|
||||
@@ -82,7 +69,7 @@ void notifyDccAccTurnoutBoard( uint16_t BoardAddr, uint8_t OutputPair, uint8_t D
|
||||
Serial.println(OutputPower, HEX) ;
|
||||
}
|
||||
|
||||
// This function is called whenever a normal DCC Turnout Packet is received
|
||||
// This function is called whenever a normal DCC Turnout Packet is received and we're in Output Addressing Mode
|
||||
void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower )
|
||||
{
|
||||
Serial.print("notifyDccAccTurnoutOutput: ") ;
|
||||
@@ -94,13 +81,11 @@ void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t Output
|
||||
}
|
||||
|
||||
// This function is called whenever a DCC Signal Aspect Packet is received
|
||||
void notifyDccSigState( uint16_t Addr, uint8_t OutputIndex, uint8_t State)
|
||||
void notifyDccSigOutputState( uint16_t Addr, uint8_t State)
|
||||
{
|
||||
Serial.print("notifyDccSigState: ") ;
|
||||
Serial.print("notifyDccSigOutputState: ") ;
|
||||
Serial.print(Addr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(OutputIndex,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.println(State, HEX) ;
|
||||
}
|
||||
|
||||
|
@@ -134,24 +134,6 @@ void notifyCVResetFactoryDefault()
|
||||
FactoryDefaultCVIndex = sizeof(FactoryDefaultCVs)/sizeof(CVPair);
|
||||
};
|
||||
|
||||
// This function is called whenever a normal DCC Turnout Packet is received
|
||||
#define NOTITY_DCC_ACC_STATE
|
||||
#ifdef NOTITY_DCC_ACC_STATE
|
||||
void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State)
|
||||
{
|
||||
if (ShowData & S_DCC) {
|
||||
Serial.print("notifyDccAccState: ") ;
|
||||
Serial.print(Addr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(BoardAddr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(OutputAddr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.println(State, HEX) ;
|
||||
}
|
||||
}
|
||||
#endif // NOTITY_DCC_ACC_STATE
|
||||
|
||||
// This function is called whenever a normal DCC Turnout Packet is received
|
||||
#define NOTITY_DCC_ACC_TURNOUT_BOARD
|
||||
#ifdef NOTITY_DCC_ACC_TURNOUT_BOARD
|
||||
@@ -202,7 +184,7 @@ void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t Output
|
||||
// if NOTIFY_DCC_SIG_STATE and SIGNAL_DCC are defined.
|
||||
#define NOTITY_DCC_SIG_STATE
|
||||
#if defined(NOTITY_DCC_SIG_STATE) && defined(SIGNAL_DCC)
|
||||
void notifyDccSigState( uint16_t Addr, uint8_t OutputIndex, uint8_t State)
|
||||
void notifyDccSigOutputState( uint16_t Addr, uint8_t State)
|
||||
{
|
||||
#ifdef DO_SCOPE
|
||||
digitalWrite(SCOPE_PIN, HIGH);
|
||||
@@ -210,11 +192,9 @@ void notifyDccSigState( uint16_t Addr, uint8_t OutputIndex, uint8_t State)
|
||||
#endif // DO_SCOPE
|
||||
|
||||
if (ShowData & S_DCC) {
|
||||
Serial.print("notifyDccSigState: ") ;
|
||||
Serial.print("notifyDccSigOutputState: ") ;
|
||||
Serial.print(Addr,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.print(OutputIndex,DEC) ;
|
||||
Serial.print(',');
|
||||
Serial.println(State, DEC) ;
|
||||
}
|
||||
|
||||
|
@@ -370,22 +370,17 @@ void loop() //****************************************************************
|
||||
}
|
||||
}
|
||||
|
||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
||||
uint16_t Current_Decoder_Addr;
|
||||
uint8_t Bit_State;
|
||||
Current_Decoder_Addr = Dcc.getAddr();
|
||||
Bit_State = OutputAddr & 0x01;
|
||||
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||
|
||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||
#ifdef DEBUG
|
||||
Serial.print("Addr = ");
|
||||
Serial.println(Addr);
|
||||
Serial.print("BoardAddr = ");
|
||||
Serial.println(BoardAddr);
|
||||
Serial.print("Bit_State = ");
|
||||
Serial.println(Bit_State);
|
||||
Serial.print("Direction = ");
|
||||
Serial.println(Direction);
|
||||
#endif
|
||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
||||
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||
}
|
||||
}
|
||||
void exec_function (int function, int FuncState) {
|
||||
|
Reference in New Issue
Block a user