2019-10-04 07:28 AM
Hello, i have two b-l072z board and making LoRa comm as point to point. While I sending ADC data I want to add packet to timestamp. I have inspected hw_rtc.c file and find HW_RTC_GetCalenderValue function. But it make me confusing because of static function. How get RTC_TimeStruct in my main file?
Thanks.
Selim.
2019-10-04 07:48 AM
The structure would pull via an include file.
The function would need to be changed from a static one so it could get exported.
You could perhaps use the exported HW_RTC_GetTimerValue() ?
>>But it make me confusing because of static function.
I doesn't have to be, you can change that if you want, it is generally done this way to reduce the name-space and allow for optimization and dead-code removal.
2019-10-04 08:31 AM
@Community member Thanks for your answer. I have used to that function and I can't convert to that ticks to time and date. Do you know how i can do it?
2019-10-04 09:31 AM
You'd have to unpack it, pulling out the seconds/sub-seconds so you can pull out a 24-hour day, and then re-calendar it from the initial epoch (day zero).
Not sure the wrapping point of this implementation, looks to be using 10-bit (0..1023) for the sub-second, perhaps 48.55 days for a 32-bit value !? Not sure that's going to be very helpful.