Merge pull request #265 from geoffrey-vl/master
BUGFIX: updating nmt internal state doesn't trigger callback function
This commit is contained in:
commit
2853bafd27
2 changed files with 21 additions and 5 deletions
|
|
@ -328,6 +328,25 @@ CO_NMT_reset_cmd_t CO_NMT_process(
|
|||
return (CO_NMT_reset_cmd_t) NMT->resetCommand;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
void CO_NMT_setInternalState(CO_NMT_t *NMT,
|
||||
CO_NMT_internalState_t state)
|
||||
{
|
||||
if (NMT == NULL)
|
||||
return;
|
||||
|
||||
if (NMT->operatingState == state)
|
||||
return;
|
||||
|
||||
NMT->operatingState = state;
|
||||
|
||||
#if (CO_CONFIG_NMT) & CO_CONFIG_NMT_CALLBACK_CHANGE
|
||||
if (NMT->pFunctNMT != NULL) {
|
||||
NMT->pFunctNMT(NMT->operatingState);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if (CO_CONFIG_NMT) & CO_CONFIG_NMT_MASTER
|
||||
/******************************************************************************/
|
||||
|
|
|
|||
|
|
@ -265,11 +265,8 @@ static inline CO_NMT_internalState_t CO_NMT_getInternalState(CO_NMT_t *NMT) {
|
|||
* @param NMT This object.
|
||||
* @param state New state.
|
||||
*/
|
||||
static inline void CO_NMT_setInternalState(CO_NMT_t *NMT,
|
||||
CO_NMT_internalState_t state)
|
||||
{
|
||||
if (NMT != NULL) NMT->operatingState = state;
|
||||
}
|
||||
void CO_NMT_setInternalState(CO_NMT_t *NMT,
|
||||
CO_NMT_internalState_t state);
|
||||
|
||||
|
||||
#if ((CO_CONFIG_NMT) & CO_CONFIG_NMT_MASTER) || defined CO_DOXYGEN
|
||||
|
|
|
|||
Loading…
Reference in a new issue