Vkey::irq(Irq_base *i)
{ vkey_irq = i; }
+// ------------------------------------------------------------------------
+IMPLEMENTATION [serial && !ux && debug]:
+
+PRIVATE static inline
+bool
+Vkey::is_debugger_entry_key(int key)
+{
+ return key == KEY_ESC;
+}
+
+// ------------------------------------------------------------------------
+IMPLEMENTATION [serial && !ux && !debug]:
+
+PRIVATE static inline
+bool
+Vkey::is_debugger_entry_key(int)
+{
+ return false;
+}
+
// ---------------------------------------------------------------------------
-IMPLEMENTATION [debug && serial && !ux]:
+IMPLEMENTATION [serial && !ux]:
#include <cstdio>
if (c == -1)
break;
- if (c == KEY_ESC)
+ if (is_debugger_entry_key(c))
{
ret = 0; // break into kernel debugger
break;
}
//----------------------------------------------------------------------------
-IMPLEMENTATION [!debug || !serial || ux]:
+IMPLEMENTATION [!serial || ux]:
+
+#include "kernel_console.h"
PUBLIC static inline
void
Vkey::add_char(int)
{}
-//----------------------------------------------------------------------------
-IMPLEMENTATION [debug && (!serial || ux)]:
-
-#include "kernel_console.h"
-
PUBLIC static
int
Vkey::get()
return Kconsole::console()->getchar(0);
}
-//----------------------------------------------------------------------------
-IMPLEMENTATION [!debug && serial]:
-
-#include "kernel_console.h"
-
-static Console *uart = Kconsole::console()->find_console(Console::UART);
-
-PUBLIC static
-int
-Vkey::get()
-{
- return uart->getchar(false);
-}
-
-//----------------------------------------------------------------------------
-IMPLEMENTATION[!debug && !serial]:
-
-PUBLIC static
-int
-Vkey::get()
-{ return -1; }
-
-//----------------------------------------------------------------------------
-IMPLEMENTATION[!debug || !serial]:
-
PUBLIC static inline
int
Vkey::check_(int = -1)