little comments
This commit is contained in:
parent
3d4681f82d
commit
db141c586d
21
Terminal.c
21
Terminal.c
@ -53,6 +53,9 @@ void PrintRxBuffer(){
|
|||||||
pointr = 0;
|
pointr = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Printf function implementation
|
||||||
|
*/
|
||||||
void myprintf(const char *fmt, ...) {
|
void myprintf(const char *fmt, ...) {
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -67,17 +70,20 @@ void myprintf(const char *fmt, ...) {
|
|||||||
char dateChar[9];
|
char dateChar[9];
|
||||||
char timeChar[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)
|
void get_time(char* timeChar, char* dateChar)
|
||||||
{
|
{
|
||||||
RTC_DateTypeDef gDate;
|
RTC_DateTypeDef gDate;
|
||||||
RTC_TimeTypeDef gTime;
|
RTC_TimeTypeDef gTime;
|
||||||
/* Get the RTC current Time */
|
|
||||||
HAL_RTC_GetTime(&hrtc, &gTime, RTC_FORMAT_BIN);
|
HAL_RTC_GetTime(&hrtc, &gTime, RTC_FORMAT_BIN);
|
||||||
/* Get the RTC current Date */
|
|
||||||
HAL_RTC_GetDate(&hrtc, &gDate, RTC_FORMAT_BIN);
|
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);
|
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);
|
sprintf((char*)dateChar,"%02d-%02d-%2d",gDate.Date, gDate.Month, 2000 + gDate.Year);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -535,6 +541,9 @@ void ReadBuffer(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize terminal
|
||||||
|
*/
|
||||||
void TerminalInit(){
|
void TerminalInit(){
|
||||||
uint8_t msgWelcome[] = {"\nWelcome to terminal utility by Angoosh\nLIBRARY VERSION: "};
|
uint8_t msgWelcome[] = {"\nWelcome to terminal utility by Angoosh\nLIBRARY VERSION: "};
|
||||||
uint8_t msgTermVersion[] = {LIB_VERSION};
|
uint8_t msgTermVersion[] = {LIB_VERSION};
|
||||||
@ -558,6 +567,10 @@ void TerminalInit(){
|
|||||||
|
|
||||||
|
|
||||||
//FATFS
|
//FATFS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief list files
|
||||||
|
*/
|
||||||
FRESULT ls_files (
|
FRESULT ls_files (
|
||||||
char* path /* Start node to be scanned (***also used as work area***) */
|
char* path /* Start node to be scanned (***also used as work area***) */
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user