[code]having some weird questions about how this compiler works .. I noticed some time ago it is mostly case insensitive (weird for C) but some other stuff is weirder ..
how does this work ?!
lcd_putc(char c) takes single char as parameter.
it handles the single char only ..
[code]
void lcd_putc(char c)
{
switch (c)
{
case '\a' : lcd_gotoxy(1,1); break;
case '\f' : lcd_send_byte(0,1);
delay_ms(2);
#if defined(LCD_EXTENDED_NEWLINE)
g_LcdX = 0;
g_LcdY = 0;
#endif
break;
#if defined(LCD_EXTENDED_NEWLINE)
case '\r' : lcd_gotoxy(1, g_LcdY+1); break;
case '\n' :
while (g_LcdX++ < LCD_LINE_LENGTH)
{
lcd_send_byte(1, ' ');
}
lcd_gotoxy(1, g_LcdY+2);
break;
#else
case '\n' : lcd_gotoxy(1,2); break;
#endif
case '\b' : lcd_send_byte(0,0x10); break;
#if defined(LCD_EXTENDED_NEWLINE)
default :
if (g_LcdX < LCD_LINE_LENGTH)
{
lcd_send_byte(1, c);
g_LcdX++;
}
break;
#else
default : lcd_send_byte(1,c); break;
#endif
}
}
but then I call it with char * parameter and it works ?!?!?
lcd_putc("\fline1\nline2");
?!
where is the lcd_putc(char *) defined... I assume there is somewhere lcd_putc(char *) that calls lcd_putc(char) for each char in lcd_putc but I can not find it anywhere?![/code][/code]