From db141c586ded4efc6d8a5ccfbabb300b433f57d6 Mon Sep 17 00:00:00 2001 From: angoosh Date: Fri, 16 Jul 2021 12:04:56 +0200 Subject: [PATCH] little comments --- Terminal.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Terminal.c b/Terminal.c index 6ff3326..4c08068 100644 --- a/Terminal.c +++ b/Terminal.c @@ -53,6 +53,9 @@ void PrintRxBuffer(){ pointr = 0; } +/** + * @brief Printf function implementation + */ void myprintf(const char *fmt, ...) { static char buffer[256]; va_list args; @@ -67,17 +70,20 @@ void myprintf(const char *fmt, ...) { char dateChar[9]; char timeChar[9]; +/** + * @brief Get time function + * @param return string containing time + * @param return string containing date + */ void get_time(char* timeChar, char* dateChar) { RTC_DateTypeDef gDate; RTC_TimeTypeDef gTime; -/* Get the RTC current Time */ + HAL_RTC_GetTime(&hrtc, &gTime, RTC_FORMAT_BIN); -/* Get the RTC current Date */ HAL_RTC_GetDate(&hrtc, &gDate, RTC_FORMAT_BIN); -/* Display time Format: hh:mm:ss */ + sprintf((char*)timeChar,"%02d:%02d:%02d",gTime.Hours, gTime.Minutes, gTime.Seconds); -/* Display date Format: dd-mm-yy */ sprintf((char*)dateChar,"%02d-%02d-%2d",gDate.Date, gDate.Month, 2000 + gDate.Year); } /** @@ -535,6 +541,9 @@ void ReadBuffer(){ } } +/** + * @brief Initialize terminal + */ void TerminalInit(){ uint8_t msgWelcome[] = {"\nWelcome to terminal utility by Angoosh\nLIBRARY VERSION: "}; uint8_t msgTermVersion[] = {LIB_VERSION}; @@ -558,6 +567,10 @@ void TerminalInit(){ //FATFS + +/** + * @brief list files + */ FRESULT ls_files ( char* path /* Start node to be scanned (***also used as work area***) */ )