cancel
Showing results for 
Search instead for 
Did you mean: 

rtc stop working when i use HAL_RTC_GetTime

Daniel_hn
Associate II

hello guys i have code that i want to show time on lcd but i have problem when  i use HAL_RTC_GetTime the time stock on the time i use HAL_RTC_GetTime and i use interrupt to switch between time lcd and main menu   

Daniel_hn_0-1724049161981.png

time show :

			RTC_TimeTypeDef gTime = {0};
			HAL_RTC_GetTime(&hrtc, &gTime, RTC_FORMAT_BIN);
			ssd1306_Fill(Black);
			ssd1306_SetCursor(0, 0);
			menu[0] = '\0';
			sprintf(menu, "%d:%d:%d", gTime.Hours,gTime.Minutes,gTime.Seconds);
			ssd1306_WriteString(menu, Font_7x10, White);
			menu[0] = '\0';

 

1 ACCEPTED SOLUTION

Accepted Solutions

After reading time,  you have to read date, too.

JW

View solution in original post

2 REPLIES 2

After reading time,  you have to read date, too.

JW

why ?