display time on time command

This commit is contained in:
King Kévin 2016-04-12 09:25:41 +02:00
parent 6bced0adea
commit 51ed093476
1 changed files with 1 additions and 1 deletions

2
main.c
View File

@ -325,7 +325,7 @@ static void process_command(char* str)
} else if (0==strcmp(word,"time")) {
word = strtok(NULL,delimiter);
if (!word) {
//printf("current time: %02d:%02d:%02d\n", rtc_read_hours(), rtc_read_minutes(), rtc_read_seconds());
printf("%02lu:%02lu:%02lu\n", rtc_get_counter_val()/ticks_hour, (rtc_get_counter_val()%ticks_hour)/ticks_minute, (rtc_get_counter_val()%ticks_minute)/ticks_second);
} else if (strlen(word)!=8 || word[0]<'0' || word[0]>'2' || word[1]<'0' || word[1]>'9' || word[3]<'0' || word[3]>'5' || word[4]<'0' || word[4]>'9' || word[6]<'0' || word[6]>'5' || word[7]<'0' || word[7]>'9') {
goto error;
} else {