aboutsummaryrefslogtreecommitdiff
path: root/screen
diff options
context:
space:
mode:
authorDavid <dbphillipsnz@gmail.com>2014-03-27 20:03:33 +1300
committerDavid <dbphillipsnz@gmail.com>2014-03-27 20:32:48 +1300
commit009a998876458f1cbab925c56c95b90d48d72157 (patch)
tree5db5de0a8ce75e9285b4d647cfd685bec5aefd1c /screen
parent5d944dfe9f03c9fb43271199d2ba4b8880747614 (diff)
downloadtoast-009a998876458f1cbab925c56c95b90d48d72157.tar.xz
Added a bunch of things. This is the epitome of a bad commit message
Diffstat (limited to 'screen')
-rw-r--r--screen/console.c9
-rw-r--r--screen/console.h8
2 files changed, 14 insertions, 3 deletions
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,...);