1.3.2.3.67 MAC_WRP_GetMsCounter Function

C

uint32_t MAC_WRP_GetMsCounter
(
    void
);

Summary

The MAC_WRP_GetMsCounter primitive gets the value of a counter that is incremented every millisecond.

Description

This primitive makes use of SYS_TIME service to get the value of the millisecond counter in order to be able to set timeouts and perform delays. This function returns the current value of such counter.

Precondition

SYS_TIME_Initialize primitive has to be called before.

Parameters

None.

Returns

Value of milliseconds counter.

Example

previousCounter = MAC_WRP_GetMsCounter();

// Perform other actions
// ...

newCounter = MAC_WRP_GetMsCounter();

if ((newCounter - previousCounter) > TIMEOUT_MS)
{
    // Timeout elapsed
}

Remarks

None.