fix for LCD row tracking, fix for "phantom" keypress at powerup

This commit is contained in:
Jeff Wang 2019-04-04 03:01:21 -04:00
parent 4734fe5a0e
commit 240dd570ae
4 changed files with 7 additions and 4 deletions

View File

@ -97,6 +97,9 @@ void KeyInit(void){
last_count[i][j] = COUNT_LIM_LOW;
}
}
//no new key
NewKeyPressed = -1;
}
static void raw_scan(void){

View File

@ -224,7 +224,7 @@ short TERMIO_PutChar(unsigned char letter) {
} else {
LCD_OutChar(letter);
col++;
if (col > MAX_CHARS_PER_LINE) {
if (col >= MAX_CHARS_PER_LINE) {
if (row == 0) {
to_row(1);
} else {

View File

@ -101,7 +101,7 @@ short TERMIO_PutChar(unsigned char letter) {
lcd_buf[lcd_row][lcd_col] = letter;
}
lcd_col++;
if (lcd_col > MAX_CHARS_PER_LINE) {
if (lcd_col >= MAX_CHARS_PER_LINE) {
if (lcd_row == 0) {
to_row(1);
} else {

View File

@ -28,7 +28,7 @@ static const char KEY_MAP[20] = {
#ifdef DESKTOP
QSemaphore KeysAvailable(1);
QSemaphore KeysAvailable(0);
QSemaphore LcdAvailable(1);
#endif
@ -160,9 +160,9 @@ int main()
#endif
latch_on();
Timer0Init(); // display refresh & switch read
LCD_Open();
KeyInit();
Timer0Init(); // display refresh & switch read
BACKLIGHT_ON(); //turn on led backlight
ExpBuf[0] = 0;