Hi. I am using CC2650. I am using doing a real timestamp to the data packet.
Time stamping i am able to do successfully. i am reading real time from connected app before setting to rtc, i am using Seconds_set() and Seconds_get() functions to set and get the timestamp...
But when there is a reset from the watchdog(if in case), then the timestamp is restarting from 0.. (If not connected to app...)..
My question is Does RTC value that was set using Seconds_set() function also resets , if there is a watchdog reset (RESET_PIN of CC2650)...
If YES, How can I retain the RTC Value that was updated once...
If NO, then how to resolve this issue.. ?
Below is the code of time_util.c
void TimeStampData(uint8_t *data )
{
/*
uint32_t ui32CurrentSeconds;
ui32CurrentSeconds=HWREG(AON_RTC_BASE + 0x8);
data[0]=ui32CurrentSeconds >>24;
data[1]=ui32CurrentSeconds >>16;
data[2]=ui32CurrentSeconds >>8;
data[3]=ui32CurrentSeconds & 0xFF;
*/
ui32CurrentSeconds=Seconds_get();
data[0]=ui32CurrentSeconds >>24;
data[1]=ui32CurrentSeconds >>16;
data[2]=ui32CurrentSeconds >>8;
data[3]=ui32CurrentSeconds & 0xFF;
}
void RtcSetTimeSeconds(uint32_t ui32CurrentSeconds )
{
/*
uint32_t u32Status;
HWREG(AON_RTC_BASE + 0x8)=ui32CurrentSeconds;
u32Status= HWREG(AON_RTC_BASE + 0x2C);
*/
Seconds_set(ui32CurrentSeconds);
}