update menu function

This commit is contained in:
小冯Sir 2024-05-03 03:31:51 +08:00
parent 8054529380
commit 8792c83418
2 changed files with 24 additions and 2 deletions

View File

@ -14,4 +14,5 @@
void Staring_Menu();
void user_Menu();
#endif //APPS_CORE_APPS_INC_MENU_H_

View File

@ -7,8 +7,10 @@
* @ : 24-4-28
******************************************************************************
*/
#include <stdbool.h>
#include "menu.h"
#include "sdio.h"
#include "rtc.h"
void Staring_Menu(){
WS_TFT_Clear(WHITE);
@ -24,8 +26,27 @@ void Staring_Menu(){
WS_TFT_Dis_12X24_String(0,0,"SD card mount fail!",WHITE,RED);
WS_TFT_Dis_12X24_String(0,0,"Please Check sdCard",WHITE,RED);
}
HAL_Delay(20);
WS_TFT_Clear(WHITE);
}
void showTime(){
RTC_TimeTypeDef sTime;
RTC_DateTypeDef sDate;
HAL_RTC_GetTime(&hrtc,&sTime,RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc,&sDate,RTC_FORMAT_BIN);
uint8_t buffer[32];
sprintf(buffer,"20%02d-%02d-%02d week %d",sDate.Year,sDate.Month,sDate
.Date,sDate.WeekDay);
WS_TFT_Dis_12X24_String(16,0,buffer,WHITE,BLUE);
sprintf(buffer,"%02d:%02d:%02d",sTime.Hours,sTime.Minutes,sTime.Seconds);
WS_TFT_Dis_12X24_String(72,25,buffer,WHITE,BLUE);
}
void user_Menu(){
HAL_Delay(20);
showTime();
}