How to get system time using uint32_t SysTime2Ms( SysTime_t sysTime ) function in BL072Z LoRa
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2019-05-16 7:41 AM
Hi, i am trying to use this function but always return me 0
uint32_t SysTime2Ms( SysTime_t sysTime )
{
SysTime_t DeltaTime;
HW_RTC_BKUPRead( &DeltaTime.Seconds, ( uint32_t* )&DeltaTime.SubSeconds );
SysTime_t calendarTime = SysTimeSub( sysTime, DeltaTime );
return calendarTime.Seconds * 1000 + calendarTime.SubSeconds;
}
this is the argument that the function needs, i dont know if i am making something wrong (probably yes)
/*!
* \brief Structure holding the system time in seconds and milliseconds.
*/
typedef struct SysTime_s
{
uint32_t Seconds;
int16_t SubSeconds;
}SysTime_t;
my code:
SysTime_t time_argument[2];
uint32_t time;
int main( void )
{
time = SysTime2Ms(time_argument[1]);
while( 1 )
{
PRINTF("system time: %d\n\r", time);
}
}
I am trying to get the system time in the BL072Z end_node example, i always have used Hal_GetTick(); but also returns 0.
thanks
Labels:
- Labels:
-
LoRa
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
