Constants shouldn't be uppercase
This commit is contained in:
parent
500c36b81b
commit
9e46b92744
@ -7,19 +7,12 @@
|
|||||||
#define STUD_NAME "Arti Zirk"
|
#define STUD_NAME "Arti Zirk"
|
||||||
#define GET_MONTH_MSG "Enter Month name first letter >"
|
#define GET_MONTH_MSG "Enter Month name first letter >"
|
||||||
|
|
||||||
const char JANUARY[] PROGMEM = "January";
|
const char m1[] PROGMEM = "January";
|
||||||
const char FEBRUARY[] PROGMEM = "February";
|
const char m2[] PROGMEM = "February";
|
||||||
const char MARCH[] PROGMEM = "March";
|
const char m3[] PROGMEM = "March";
|
||||||
const char APRIL[] PROGMEM = "April";
|
const char m4[] PROGMEM = "April";
|
||||||
const char MAY[] PROGMEM = "May";
|
const char m5[] PROGMEM = "May";
|
||||||
const char JUNE[] PROGMEM = "June";
|
const char m6[] PROGMEM = "June";
|
||||||
|
|
||||||
PGM_P const ENG_MONTH[] PROGMEM = {
|
PGM_P const months[] PROGMEM = {m1,m2,m3,m4,m5,m6};
|
||||||
JANUARY,
|
|
||||||
FEBRUARY,
|
|
||||||
MARCH,
|
|
||||||
APRIL,
|
|
||||||
MAY,
|
|
||||||
JUNE,
|
|
||||||
};
|
|
||||||
#endif /* _HMI_MSG_H_ */
|
#endif /* _HMI_MSG_H_ */
|
||||||
|
@ -52,10 +52,10 @@ int main (void)
|
|||||||
fprintf(stdout, "%c\n", letter);
|
fprintf(stdout, "%c\n", letter);
|
||||||
lcd_goto(0x40); /* Got to the beginning of the next line */
|
lcd_goto(0x40); /* Got to the beginning of the next line */
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
if (!strncmp_P(&letter, (PGM_P)pgm_read_word(&ENG_MONTH[i]), 1)) {
|
if (!strncmp_P(&letter, (PGM_P)pgm_read_word(&months[i]), 1)) {
|
||||||
fprintf_P(stdout, (PGM_P)pgm_read_word(&ENG_MONTH[i]));
|
fprintf_P(stdout, (PGM_P)pgm_read_word(&months[i]));
|
||||||
fputc('\n', stdout);
|
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(' ');
|
lcd_putc(' ');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user