From 396a646fa3fd0bfc09c461f13dee0e606f86632a Mon Sep 17 00:00:00 2001 From: TuxSH Date: Sat, 12 May 2018 21:39:29 +0200 Subject: [PATCH] [stage2] Add console_get_framebuffer --- fusee/fusee-secondary/src/console.c | 8 ++++++++ fusee/fusee-secondary/src/console.h | 1 + 2 files changed, 9 insertions(+) diff --git a/fusee/fusee-secondary/src/console.c b/fusee/fusee-secondary/src/console.c index c69f730a1..0259e8016 100644 --- a/fusee/fusee-secondary/src/console.c +++ b/fusee/fusee-secondary/src/console.c @@ -155,6 +155,14 @@ int console_init(void) { return 0; } +void *console_get_framebuffer(bool enable_display) { + if (g_framebuffer != NULL && enable_display) { + console_init_display(); + } + + return g_framebuffer; +} + int console_display(const void *framebuffer) { if (!g_display_initialized) { console_init_display(); diff --git a/fusee/fusee-secondary/src/console.h b/fusee/fusee-secondary/src/console.h index 76d8c37f6..f73424003 100644 --- a/fusee/fusee-secondary/src/console.h +++ b/fusee/fusee-secondary/src/console.h @@ -2,6 +2,7 @@ #define FUSEE_CONSOLE_H int console_init(void); +void *console_get_framebuffer(bool enable_display); int console_display(const void *framebuffer); /* Must be page-aligned */ int console_resume(void); int console_end(void);