FOC: Fetch serial input without '-serial_esc' option

With this patch, the kernel fetches serial data also when the
'-serial_esc' option is not set.

To keep the patch minimally invasive, the 'serial ESC' functionality gets
enabled by default and the existence of the '-serial_esc' argument gets only
checked when an ESC character was received and the decision of entering the
kernel debugger or not needs to be made.

Fixes ssumpf/foc#3.
This commit is contained in:
Christian Prochaska
2013-03-08 16:43:57 +01:00
committed by Sebastian Sumpf
parent 658efaee17
commit 2c02a4b89f
2 changed files with 4 additions and 3 deletions

View File

@@ -233,8 +233,8 @@ void Config::init()
esc_hack = true;
#ifdef CONFIG_SERIAL
if ( Koptions::o()->opt(Koptions::F_serial_esc)
&& !Koptions::o()->opt(Koptions::F_noserial)
if ( /*Koptions::o()->opt(Koptions::F_serial_esc)
&&*/ !Koptions::o()->opt(Koptions::F_noserial)
# ifdef CONFIG_KDB
&& Koptions::o()->opt(Koptions::F_nokdb)
# endif

View File

@@ -31,6 +31,7 @@ IMPLEMENTATION [debug && serial && !ux]:
#include "globals.h"
#include "kernel_console.h"
#include "keycodes.h"
#include "koptions.h"
#include "uart.h"
static Vkey::Echo_type vkey_echo;
@@ -116,7 +117,7 @@ Vkey::check_()
if (c == -1)
break;
if (c == KEY_ESC)
if ((c == KEY_ESC) && (Koptions::o()->opt(Koptions::F_serial_esc)))
{
ret = 0; // break into kernel debugger
break;