fix lcd indexing, clear to end of line function

This commit is contained in:
Jeff Wang
2019-03-21 21:01:53 -04:00
parent b3f0f12c32
commit 33949440db
3 changed files with 11 additions and 3 deletions

View File

@ -237,6 +237,8 @@ short TERMIO_PutChar(unsigned char letter) {
to_row(0);
}
} else {
LCD_OutChar(letter);
col++;
if (col > MAX_CHARS_PER_LINE) {
if (row == 0) {
to_row(1);
@ -244,13 +246,17 @@ short TERMIO_PutChar(unsigned char letter) {
to_row(0);
}
}
col++;
LCD_OutChar(letter);
}
return 1;
}
void LCD_ClearToEnd(void){
while (col != 0){
TERMIO_PutChar(' ');
}
}
void LCD_OutNibble(uint8_t x){
x &= 0xf; //ensure only bottom nibble
if (x <= 9){