Add 'press any key to remove' message on banner

By default, don't re-display FAIL banner after it has been discarded (#130 & #173)
Add an option to re-display FAIL banner even if previously discarded
This commit is contained in:
Sam Demeulemeester 2022-11-27 23:34:43 +01:00
parent 0beb172a0d
commit 9a86f115f4
3 changed files with 11 additions and 3 deletions

View File

@ -104,7 +104,9 @@ power_save_t power_save = POWER_SAVE_HIGH;
bool enable_tty = false;
int tty_params_port = SERIAL_PORT_0x3F8;
int tty_params_baud = SERIAL_DEFAULT_BAUDRATE;
int tty_update_period = 2; // Update TTY every 2 seconds (default)
int tty_update_period = 2; // Update TTY every 2 seconds (default)
bool err_banner_redraw = false; // Redraw banner on new errors (if previsouly removed)
//------------------------------------------------------------------------------
// Private Functions

View File

@ -66,6 +66,8 @@ extern int tty_params_port;
extern int tty_params_baud;
extern int tty_update_period;
extern bool err_banner_redraw;
void config_init(void);
void config_menu(bool initial);

View File

@ -36,7 +36,7 @@
#define POP_STAT_C 18
#define POP_STAT_W 44
#define POP_STAT_H 9
#define POP_STAT_H 11
#define POP_STAT_LAST_R (POP_STAT_R + POP_STAT_H - 1)
#define POP_STAT_LAST_C (POP_STAT_C + POP_STAT_W - 1)
@ -383,6 +383,10 @@ void display_big_status(bool pass)
prints(POP_STAT_R+6, POP_STAT_C+5, "## ## ## ## ## ");
prints(POP_STAT_R+7, POP_STAT_C+5, "## ## ## ###### ###### ");
}
prints(POP_STAT_R+8, POP_STAT_C+5, " ");
prints(POP_STAT_R+9, POP_STAT_C+5, "Press any key to remove this banner ");
set_background_colour(BLUE);
set_foreground_colour(WHITE);
big_status_displayed = true;
@ -539,7 +543,7 @@ void do_tick(int my_cpu)
if (!timed_update_done) {
// Display FAIL banner if (new) errors detected
if (!big_status_displayed && error_count > 0) {
if (err_banner_redraw && !big_status_displayed && error_count > 1) {
display_big_status(false);
}