notifyDccSigState restored

Restore the old callback notifyDccSigState for compatibiltity to version
1.4.2
This commit is contained in:
MicroBahner
2018-06-20 14:56:18 +02:00
parent bd2bde9de6
commit 308ac8f8e1
2 changed files with 8 additions and 2 deletions

View File

@@ -1141,6 +1141,10 @@ void execDccProcessor( DCC_MSG * pDccMsg )
DB_PRINT("eDP: OAddr:%d Extended State:%0X", OutputAddress, state);
if( notifyDccSigOutputState )
notifyDccSigOutputState(OutputAddress, state);
// old callback ( for compatibility with 1.4.2, not to be used in new designs )
if( notifyDccSigState )
notifyDccSigState( OutputAddress, TurnoutPairIndex, pDccMsg->Data[2] ) ;
}
else if(pDccMsg->Size == 3) // Basic Accessory Decoder Packet Format
@@ -1148,7 +1152,7 @@ void execDccProcessor( DCC_MSG * pDccMsg )
uint8_t direction = pDccMsg->Data[1] & 0b00000001;
uint8_t outputPower = (pDccMsg->Data[1] & 0b00001000) >> 3;
// for compatibility with 1.4.2
// old callback ( for compatibility with 1.4.2, not to be used in new designs )
if ( notifyDccAccState )
notifyDccAccState( OutputAddress, BoardAddress, pDccMsg->Data[1] & 0b00000111, outputPower );

View File

@@ -687,8 +687,10 @@ extern void notifyCVAck(void) __attribute__ ((weak));
*/
extern void notifyServiceMode(bool) __attribute__ ((weak));
// Deprecated, only for backward compatibility with version 1.4.2. Don't use in new designs
// Deprecated, only for backward compatibility with version 1.4.2.
// Don't use in new designs. These functions may be dropped in future versions
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State ) __attribute__ ((weak));
extern void notifyDccSigState( uint16_t Addr, uint8_t OutputIndex, uint8_t State) __attribute__ ((weak));
#if defined (__cplusplus)
}