This commit is contained in:
MicroBahner
2018-04-17 18:07:58 +02:00
2 changed files with 13 additions and 1 deletions

View File

@@ -940,10 +940,18 @@ void processServiceModeOperation( DCC_MSG * pDccMsg )
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
void resetServiceModeTimer(uint8_t inServiceMode) void resetServiceModeTimer(uint8_t inServiceMode)
{ {
if (notifyServiceMode && inServiceMode != DccProcState.inServiceMode)
{
notifyServiceMode(inServiceMode);
}
// Set the Service Mode // Set the Service Mode
DccProcState.inServiceMode = inServiceMode ; DccProcState.inServiceMode = inServiceMode ;
DccProcState.LastServiceModeMillis = inServiceMode ? millis() : 0 ; DccProcState.LastServiceModeMillis = inServiceMode ? millis() : 0 ;
if (notifyServiceMode && inServiceMode != DccProcState.inServiceMode)
{
notifyServiceMode(inServiceMode);
}
} }
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
@@ -1395,4 +1403,4 @@ uint8_t NmraDcc::process()
} }
return 0 ; return 0 ;
}; };

View File

@@ -671,6 +671,10 @@ extern void notifyCVResetFactoryDefault(void) __attribute__ ((weak));
* None * None
*/ */
extern void notifyCVAck(void) __attribute__ ((weak)); 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
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State ) __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
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State ) __attribute__ ((weak)); extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State ) __attribute__ ((weak));