The compiler is giving this error:
../dplc_lcd.h:45: warning: comparison is always false due to limited range of data type
I have this code:
#define LCD_CLR_CHAR 0xFF static int lcd_putchar(char c, FILE *stream) { if(c == LCD_CLR_CHAR) { lcd_clrscr(); return 0; } LCD_PORT = enable_underlight | 0x04 | LCD_BYTE_HIGH_NYBBLE(c); LCD_EN_PULSE(); LCD_PORT = enable_underlight | 0x04 | LCD_BYTE_LOW_NYBBLE(c); LCD_EN_PULSE(); lcd_wait(200); return 0; }
The char has to be char and it 0xFF is well within the given range of 8 bits.
Does the compiler care wheter it is signed/unsigned when i go hex? How to get rid of the error? LCD_CLR_CHAR has to be 0xFF, and the function definition cant have unsigned as i have bound it as the standart output function.
Ofcourse the error stops apearing when I set the LCD_CLR_CHAR to 127, and starts when I set it to 128 and higher. therefore it's a signed/unsigned problem. So how to get rid of this?