SWRA704 June 2021 CC3120 , CC3130 , CC3135
The timestamp mechanism is required in the SimpleLink host driver. This timestamp is used to determine a timeout when the network processor does not respond.
This example uses the FreeRTOS APIs to get the tick period and the current tick count in order to calculate a timestamp.
user.h:
#define SL_TIMESTAMP_TICKS_IN_10_MILLISECONDS (10000 / ClockP_getSystemTickPeriod())
#define slcb_GetTimestamp TimerGetCurrentTimestamp
cc_pal.c:
uint32_t ClockP_getSystemTickPeriod()
{
uint32_t tickPeriodUs;
/*
* Tick period in microseconds. configTICK_RATE_HZ is defined in the
* application's FreeRTOSConfig.h, which is include by FreeRTOS.h
*/
tickPeriodUs = 1000000 / configTICK_RATE_HZ;
return tickPeriodUs;
}
unsigned long TimerGetCurrentTimestamp()
{
return ((uint32_t)xTaskGetTickCount());
}