From 009a998876458f1cbab925c56c95b90d48d72157 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 27 Mar 2014 20:03:33 +1300 Subject: Added a bunch of things. This is the epitome of a bad commit message --- screen/console.c | 9 +++++++++ screen/console.h | 8 +++++--- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'screen') diff --git a/screen/console.c b/screen/console.c index cceab6c..71a8456 100644 --- a/screen/console.c +++ b/screen/console.c @@ -74,6 +74,15 @@ void console_set_colors(uint8_t fg, uint8_t bg) console_color = (bg << 4) | fg; } +/********************************************************* + * Swap the current console colours out + ********************************************************/ +void console_swap_colors() +{ + uint32_t t = console_color; + console_color = saved_console_color; + saved_console_color = t; +} /********************************************************* * Set ONLY the console foreground colour diff --git a/screen/console.h b/screen/console.h index f037592..fabbc4a 100644 --- a/screen/console.h +++ b/screen/console.h @@ -43,13 +43,14 @@ #define COLOR_YELLOW 0xE #define COLOR_WHITE 0xF -#define COLOR_BRIGHT_GRAY COLOR_BRIGHT_GREY // Alias for grey vs gray -#define COLOR_GREY COLOR_GRAY // Alias for grey vs gray -#define COLOR_LIME COLOR_BRIGHT_GREEN // Alias for lime vs bright green +#define COLOR_BRIGHT_GRAY COLOR_BRIGHT_GREY // Alias for grey <--> gray +#define COLOR_GREY COLOR_GRAY // Alias for grey <--> gray +#define COLOR_LIME COLOR_BRIGHT_GREEN // Alias for lime <--> bright green char* console_buffer; uint16_t console_pointer; uint8_t console_color; +uint8_t saved_console_color; void console_init(); void console_set_cursor_xy(uint8_t x,uint8_t y); @@ -57,6 +58,7 @@ void console_update_cursor(); void console_clear(); void console_set_colors(uint8_t fg, uint8_t bg); void console_set_color(uint8_t fg); +void console_swap_colors(); void console_print_char(const char c); void console_print_string(const char *string); void console_print(const char* format,...); -- cgit v1.1