static void MX_RTC_Init(void)
{
/**Initialize RTC Only
*/
hrtc.Instance = RTC;
hrtc.Init.HourFormat = RTC_HOURFORMAT_24;
hrtc.Init.AsynchPrediv = 127;
hrtc.Init.SynchPrediv = 255;
hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
if (HAL_RTC_Init(&hrtc) != HAL_OK)
{
Error_Handler();
}
}
void StartTask02(void const * argument)
{
RTC_TimeTypeDef gettime;
for(;;)
{
gettime.Hours=12;
gettime.Minutes=30;
gettime.Seconds=30;
gettime.SubSeconds=0;
HAL_RTC_SetTime(&hrtc,&gettime,RTC_FORMAT_BIN);
HAL_RTC_GetTime(&hrtc,&gettime,RTC_FORMAT_BIN);
}
}