Tool/software: Code Composer Studio
Hello,
I'm trying to add the UNIX/Epoch timestamp in milliseconds to my accelerometer and gyroscope data from the sensortag_cc2650_app project.
I'm using the Seconds module, and the Seconds_getTime() function on the sensortag_mov.c
First I'm calling Seconds_set, and then Seconds_getTime() as follows:
SensorTagMov_init()
{
...
Seconds_set(1536329381); //Set time to Current Unix Timestamp (05/09/2018 @2:32 pm UTC)
...
}
SensorTagMov_processSensorEvent(){
...
Seconds_getTime(&time_s); //time_s was declared as: ti_sysbios_interfaces_ISeconds_Time time_s;
uint64_t unix_millis = (time_s.secs*1000) + (time_s.nsecs/1000000);
...
}
My problem is that my time_s.secs has a value of zero, so I cannot get the complete UNIX Timestamp.
Attached is an image of what I get using the debugger.
Any idea on how to fix this? Maybe there is something I'm not doing right?
Thanks in advance,
Alejandra :)