ToCoNet_Event_u32TickFrNewState()
Explanation
Obtain the time elapsed since the transition to the current state of the user-defined event function.
Used for timeouts, e.g. waiting for transmission completion.
The value in the initial state E_STATE_IDLE
is undefined.
Argument
Type
Name
Remark
tsEvent *
pEv
Management structure for user event definition functions.
Returns
Type
Remark
uint32
the elapsed time since the transition.
Sample code
The following example shows how to process a send (transition to E_STATE_APP_TX_REQUEST
) when a certain condition is met in E_STATE_IDLE
. If the transmission is successful, cond_if_tx_complete
is set to 1
or 0xff
, but if this value is not set before 100ms has elapsed, the transmission times out.
最終更新