Merge 1c4d728f60 into 9b8beed836
This commit is contained in:
commit
289c7f0c4e
2 changed files with 14 additions and 11 deletions
|
|
@ -327,10 +327,10 @@ CO_HBconsumer_process(CO_HBconsumer_t* HBcons, bool_t NMTisPreOrOperational, uin
|
|||
monitoredNode->functSignalObjectRemoteReset);
|
||||
}
|
||||
#endif
|
||||
if (monitoredNode->HBstate == CO_HBconsumer_ACTIVE) {
|
||||
if (monitoredNode->HBstate != CO_HBconsumer_UNKNOWN) {
|
||||
CO_errorReport(HBcons->em, CO_EM_HB_CONSUMER_REMOTE_RESET, CO_EMC_HEARTBEAT, i);
|
||||
monitoredNode->HBstate = CO_HBconsumer_RESTART;
|
||||
}
|
||||
monitoredNode->HBstate = CO_HBconsumer_UNKNOWN;
|
||||
|
||||
} else {
|
||||
/* heartbeat message */
|
||||
|
|
@ -342,15 +342,15 @@ CO_HBconsumer_process(CO_HBconsumer_t* HBcons, bool_t NMTisPreOrOperational, uin
|
|||
}
|
||||
#endif
|
||||
monitoredNode->HBstate = CO_HBconsumer_ACTIVE;
|
||||
/* reset timer */
|
||||
monitoredNode->timeoutTimer = 0;
|
||||
timeDifference_us_copy = 0;
|
||||
}
|
||||
CO_FLAG_CLEAR(monitoredNode->CANrxNew);
|
||||
/* reset timer */
|
||||
monitoredNode->timeoutTimer = 0;
|
||||
timeDifference_us_copy = 0;
|
||||
}
|
||||
|
||||
/* Verify timeout */
|
||||
if (monitoredNode->HBstate == CO_HBconsumer_ACTIVE) {
|
||||
if (monitoredNode->HBstate == CO_HBconsumer_ACTIVE || monitoredNode->HBstate == CO_HBconsumer_RESTART) {
|
||||
monitoredNode->timeoutTimer += timeDifference_us_copy;
|
||||
|
||||
if (monitoredNode->timeoutTimer >= monitoredNode->time_us) {
|
||||
|
|
@ -377,11 +377,13 @@ CO_HBconsumer_process(CO_HBconsumer_t* HBcons, bool_t NMTisPreOrOperational, uin
|
|||
#endif
|
||||
}
|
||||
|
||||
if (monitoredNode->HBstate != CO_HBconsumer_ACTIVE) {
|
||||
allMonitoredActiveCurrent = false;
|
||||
}
|
||||
if (monitoredNode->NMTstate != CO_NMT_OPERATIONAL) {
|
||||
allMonitoredOperationalCurrent = false;
|
||||
if (monitoredNode->HBstate != CO_HBconsumer_UNKNOWN) {
|
||||
if (monitoredNode->HBstate != CO_HBconsumer_ACTIVE) {
|
||||
allMonitoredActiveCurrent = false;
|
||||
}
|
||||
if (monitoredNode->NMTstate != CO_NMT_OPERATIONAL) {
|
||||
allMonitoredOperationalCurrent = false;
|
||||
}
|
||||
}
|
||||
#if (((CO_CONFIG_HB_CONS)&CO_CONFIG_HB_CONS_CALLBACK_CHANGE) != 0) \
|
||||
|| (((CO_CONFIG_HB_CONS)&CO_CONFIG_HB_CONS_CALLBACK_MULTI) != 0)
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ typedef enum {
|
|||
CO_HBconsumer_UNKNOWN = 0x01U, /**< Consumer enabled, but no heartbeat received yet */
|
||||
CO_HBconsumer_ACTIVE = 0x02U, /**< Heartbeat received within set time */
|
||||
CO_HBconsumer_TIMEOUT = 0x03U, /**< No heatbeat received for set time */
|
||||
CO_HBconsumer_RESTART = 0x04U, /**< Monitored node was reset */
|
||||
} CO_HBconsumer_state_t;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue