1
0
Fork 0

Node guarding disable, if heartbeat is used.

This commit is contained in:
Janez 2023-10-19 12:16:37 +02:00
parent b0b0724c6f
commit a4b4e6df66
3 changed files with 11 additions and 1 deletions

View file

@ -199,11 +199,19 @@ CO_ReturnError_t CO_nodeGuardingSlave_init(CO_nodeGuardingSlave_t *ngs,
/******************************************************************************/
void CO_nodeGuardingSlave_process(CO_nodeGuardingSlave_t *ngs,
CO_NMT_internalState_t NMTstate,
bool_t slaveDisable,
uint32_t timeDifference_us,
uint32_t *timerNext_us)
{
(void)timerNext_us; /* may be unused */
if (slaveDisable) {
ngs->toggle = false;
ngs->lifeTimer = 0;
CO_FLAG_CLEAR(ngs->CANrxNew);
return;
}
/* was RTR just received */
if (CO_FLAG_READ(ngs->CANrxNew)) {
ngs->lifeTimer = ngs->lifeTime_us;

View file

@ -148,12 +148,14 @@ CO_ReturnError_t CO_nodeGuardingSlave_init(CO_nodeGuardingSlave_t *ngs,
*
* @param ngs This object.
* @param NMTstate NMT operating state.
* @param slaveDisable If true, then Node guarding slave is disabled.
* @param timeDifference_us Time difference from previous function call in
* microseconds.
* @param [out] timerNext_us info to OS - see CO_process().
*/
void CO_nodeGuardingSlave_process(CO_nodeGuardingSlave_t *ngs,
CO_NMT_internalState_t NMTstate,
bool_t slaveDisable,
uint32_t timeDifference_us,
uint32_t *timerNext_us);
@ -271,7 +273,6 @@ CO_ReturnError_t CO_nodeGuardingMaster_init(CO_nodeGuardingMaster_t *ngm,
* configures monitoring of the remote node.
*
* @param ngm Node Guarding master object.
* @param em Emergency object.
* @param index Index of the slot, which will be configured.
* 0 <= index < CO_CONFIG_NODE_GUARDING_MASTER_COUNT.
* @param nodeId Node Id of the monitored node.

View file

@ -1469,6 +1469,7 @@ CO_NMT_reset_cmd_t CO_process(CO_t *co,
#if (CO_CONFIG_NODE_GUARDING) & CO_CONFIG_NODE_GUARDING_SLAVE_ENABLE
CO_nodeGuardingSlave_process(co->NGslave,
NMTstate,
(co->NMT->HBproducerTime_us > 0),
timeDifference_us,
timerNext_us);
#endif