From 500c36b81b5d1e0fecdb5835466b39090196ab4f Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Mon, 24 Oct 2016 00:01:26 +0300 Subject: [PATCH] Last fixes for lab03.2 --- src/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 1f233a1..335dd58 100644 --- a/src/main.c +++ b/src/main.c @@ -23,7 +23,8 @@ int main (void) /* End init */ /* Print version info to stderr */ - fprintf_P(stderr, PSTR(PROG_VERSION), PSTR(GIT_DESCR), PSTR(__DATE__), PSTR(__TIME__)); + fprintf_P(stderr, PSTR(PROG_VERSION), + PSTR(GIT_DESCR), PSTR(__DATE__), PSTR(__TIME__)); fprintf_P(stderr, PSTR(LIBC_VERSION), PSTR(__AVR_LIBC_VERSION_STRING__)); /* End version print */ @@ -45,13 +46,13 @@ int main (void) _delay_ms(BLINK_DELAY_MS); /* Month search and print */ - char month_first_leter; + char letter; fprintf_P(stdout, PSTR(GET_MONTH_MSG)); - fscanf(stdin, "%c", &month_first_leter); - fprintf(stdout, "%c\n", month_first_leter); + fscanf(stdin, "%c", &letter); + fprintf(stdout, "%c\n", letter); lcd_goto(0x40); /* Got to the beginning of the next line */ for (int i = 0; i < 6; i++) { - if (!strncmp_P(&month_first_leter, (PGM_P)pgm_read_word(&ENG_MONTH[i]), 1)) { + if (!strncmp_P(&letter, (PGM_P)pgm_read_word(&ENG_MONTH[i]), 1)) { fprintf_P(stdout, (PGM_P)pgm_read_word(&ENG_MONTH[i])); fputc('\n', stdout); lcd_puts_P((PGM_P)pgm_read_word(&ENG_MONTH[i])); @@ -61,7 +62,6 @@ int main (void) lcd_puts_P(PSTR(" ")); /* Clear the end of the line */ - /* set pin 3 low to turn led off */ PORTA &= ~_BV(PORTA3); _delay_ms(BLINK_DELAY_MS);