I'm trying to manipulate the values of a struct atime1
with values .Hours
, .Minutes
, .Seconds
, and for some reason, the values I need are the HEX values of these variables, all tree are int
.
Then I "concatenate" the three variables in a way the hex values are not altered. HEX values:
aTime.Hours=0x13
aTime.Minutes=0x30
aTime.Seconds=0x15
ttt=0x133015
Then I need to convert that variable ttt with dec values of 1257493
and 0x133015
to a decimal value of 133015
.
That's where I dont know how to make that conversion.
Here my code so far.
HAL_RTC_GetTime(&hrtc, &aTime1, RTC_FORMAT_BCD);
HAL_RTC_GetDate(&hrtc, &aDate1, RTC_FORMAT_BCD);
ttt = aTime1.Hours;
ttt = ((ttt % 100000) * 256 + aTime1.Minutes);
ttt = ((ttt % 100000) * 256 + aTime1.Seconds);