update gui
This commit is contained in:
@ -16,6 +16,11 @@ void LCD_Clear(void);
|
||||
void LCD_GoTo(uint8_t row, uint8_t col);
|
||||
|
||||
void LCD_OutString(__xdata const char* string, uint8_t max_chars);
|
||||
#ifdef DESKTOP
|
||||
void LCD_OutString_Initial(__xdata const char* string, uint8_t max_chars);
|
||||
#else
|
||||
#define LCD_OutString_Initial(a, b) LCD_OutString(a, b)
|
||||
#endif
|
||||
short TERMIO_PutChar(unsigned char letter);
|
||||
void LCD_OutNibble(uint8_t x);
|
||||
void LCD_ClearToEnd(uint8_t curr_row);
|
||||
|
@ -15,6 +15,8 @@
|
||||
static uint8_t lcd_row, lcd_col;
|
||||
static char lcd_buf[MAX_ROWS][MAX_CHARS_PER_LINE];
|
||||
|
||||
static char enable_checks = 1;
|
||||
|
||||
const char* get_lcd_buf(void){
|
||||
return &lcd_buf[0][0];
|
||||
}
|
||||
@ -71,6 +73,12 @@ void LCD_OutString(const char *string, uint8_t max_chars) {
|
||||
}
|
||||
}
|
||||
|
||||
void LCD_OutString_Initial(const char *string, uint8_t max_chars) {
|
||||
enable_checks = 0;
|
||||
LCD_OutString(string, max_chars);
|
||||
enable_checks = 1;
|
||||
}
|
||||
|
||||
static int is_valid_character(char letter){
|
||||
if (isdigit(letter)){
|
||||
return 1;
|
||||
@ -78,6 +86,8 @@ static int is_valid_character(char letter){
|
||||
return 1;
|
||||
} else if(letter == '.' || letter == ' ' || letter == '-'){
|
||||
return 1;
|
||||
} else if(letter == '^'){
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -94,7 +104,7 @@ short TERMIO_PutChar(unsigned char letter) {
|
||||
}
|
||||
}
|
||||
//warn if unknown character
|
||||
if (!is_valid_character(letter)) {
|
||||
if (!is_valid_character(letter) && enable_checks) {
|
||||
printf("\nerror @%d,%d, invalid character %d\n",
|
||||
lcd_row, lcd_col, letter);
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ int main()
|
||||
ExpBuf[0] = 0;
|
||||
ExpBuf[1] = 0;
|
||||
|
||||
LCD_OutString(VER_STR, 32);
|
||||
LCD_OutString_Initial(VER_STR, 32);
|
||||
#ifdef DESKTOP
|
||||
LcdAvailable.release();
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user