From 93d5b79f068007d0504f3732d4b675ad744f0ea8 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Thu, 24 May 2012 08:51:41 -0500 Subject: [PATCH] rPi console: Implement console_wait_for_key --- src/system/boot/platform/raspberrypi_arm/console.cpp | 5 +---- src/system/boot/platform/raspberrypi_arm/serial.h | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/system/boot/platform/raspberrypi_arm/console.cpp b/src/system/boot/platform/raspberrypi_arm/console.cpp index a3c7f1f2e6..31cc7f286c 100644 --- a/src/system/boot/platform/raspberrypi_arm/console.cpp +++ b/src/system/boot/platform/raspberrypi_arm/console.cpp @@ -209,12 +209,9 @@ console_hide_cursor(void) int console_wait_for_key(void) { - #warning IMPLEMENT console_wait_for_key - #if 0 union key key; + key.ax = serial_getc(true); return key.code.ascii; - #endif - return 0; } diff --git a/src/system/boot/platform/raspberrypi_arm/serial.h b/src/system/boot/platform/raspberrypi_arm/serial.h index 6004f5a9a1..d9c13e287e 100644 --- a/src/system/boot/platform/raspberrypi_arm/serial.h +++ b/src/system/boot/platform/raspberrypi_arm/serial.h @@ -15,10 +15,13 @@ extern "C" { extern void serial_init(void); extern void serial_cleanup(void); -extern void serial_puts(const char *string, size_t size); extern void serial_disable(void); extern void serial_enable(void); +extern void serial_puts(const char *string, size_t size); +extern int serial_getc(bool wait); + + #ifdef __cplusplus } #endif