Constants shouldn't be uppercase

This commit is contained in:
Arti Zirk 2016-10-24 16:08:34 +03:00
parent 500c36b81b
commit 9e46b92744
2 changed files with 10 additions and 17 deletions

View File

@ -7,19 +7,12 @@
#define STUD_NAME "Arti Zirk"
#define GET_MONTH_MSG "Enter Month name first letter >"
const char JANUARY[] PROGMEM = "January";
const char FEBRUARY[] PROGMEM = "February";
const char MARCH[] PROGMEM = "March";
const char APRIL[] PROGMEM = "April";
const char MAY[] PROGMEM = "May";
const char JUNE[] PROGMEM = "June";
const char m1[] PROGMEM = "January";
const char m2[] PROGMEM = "February";
const char m3[] PROGMEM = "March";
const char m4[] PROGMEM = "April";
const char m5[] PROGMEM = "May";
const char m6[] PROGMEM = "June";
PGM_P const ENG_MONTH[] PROGMEM = {
JANUARY,
FEBRUARY,
MARCH,
APRIL,
MAY,
JUNE,
};
PGM_P const months[] PROGMEM = {m1,m2,m3,m4,m5,m6};
#endif /* _HMI_MSG_H_ */

View File

@ -52,10 +52,10 @@ int main (void)
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(&letter, (PGM_P)pgm_read_word(&ENG_MONTH[i]), 1)) {
fprintf_P(stdout, (PGM_P)pgm_read_word(&ENG_MONTH[i]));
if (!strncmp_P(&letter, (PGM_P)pgm_read_word(&months[i]), 1)) {
fprintf_P(stdout, (PGM_P)pgm_read_word(&months[i]));
fputc('\n', stdout);
lcd_puts_P((PGM_P)pgm_read_word(&ENG_MONTH[i]));
lcd_puts_P((PGM_P)pgm_read_word(&months[i]));
lcd_putc(' ');
}
}