提交 40f239a7 编写于 作者: G Guangyao Ma

fix: Ctrl-C move out of LOS_MAGIC_KEY_ENABLE

由于没有tty,当前的Ctrl-C实现基于uart回调特定函数实现,后续tty实现后
可以重新考虑Ctrl-C设计实现。本次将Ctrl-C移除LOS_MAGIC_KEY_ENABLE,保
证任意情况下可以生效。

Change-Id: I4e1e51b2d92535879bbdbbfa91b0229119d0e90e
Signed-off-by: NGuangyao Ma <guangyao.ma@outlook.com>
上级 ee54cd8b
......@@ -66,12 +66,6 @@ STATIC MagicKeyOp g_magicHelpOp = {
.magicKey = 0x1a /* ctrl + z */
};
STATIC MagicKeyOp g_magicKillPgrp = {
.opHandler = KillPgrp,
.helpMsg = "Show all magic op key(ctrl+c) ",
.magicKey = 0x03 /* ctrl + c */
};
/*
* NOTICE:Suggest don't use
* ctrl+h/backspace=0x8,
......@@ -87,7 +81,7 @@ STATIC MagicKeyOp *g_magicOpTable[MAGIC_KEY_NUM] = {
&g_magicPanicOp, /* ctrl + p */
&g_magicTaskShowOp, /* ctrl + t */
&g_magicHelpOp, /* ctrl + z */
&g_magicKillPgrp /* ctrl + c */
NULL
};
STATIC VOID OsMagicHelp(VOID)
......@@ -129,7 +123,11 @@ INT32 CheckMagicKey(CHAR key)
#ifdef LOSCFG_ENABLE_MAGICKEY
INT32 i;
STATIC UINT32 magicKeySwitch = 0;
if (key == 0x12) { /* ctrl + r */
if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
} else if (key == 0x12) { /* ctrl + r */
magicKeySwitch = ~magicKeySwitch;
if (magicKeySwitch != 0) {
PRINTK("Magic key on\n");
......@@ -137,11 +135,7 @@ INT32 CheckMagicKey(CHAR key)
PRINTK("Magic key off\n");
}
return 1;
} else if (key == 0x03) { /* ctrl + c */
KillPgrp();
return 0;
}
if (magicKeySwitch != 0) {
for (i = 0; i < MAGIC_KEY_NUM; i++) {
if (g_magicOpTable[i] != NULL && key == g_magicOpTable[i]->magicKey) {
......
......@@ -10,6 +10,5 @@ LOSCFG_BOARD_CONFIG_PATH="device/qemu/arm_virt/liteos_a/config/board"
# LOSCFG_FS_VFS is not set
# LOSCFG_NET_LWIP_SACK is not set
# LOSCFG_PLATFORM_ADAPT is not set
# LOSCFG_ENABLE_MAGICKEY is not set
# LOSCFG_DRIVERS is not set
# LOSCFG_SECURITY is not set
......@@ -8,7 +8,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -9,7 +9,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -10,7 +10,6 @@ LOSCFG_KERNEL_VDSO=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -9,7 +9,6 @@ LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -8,7 +8,6 @@ LOSCFG_FS_FAT_CACHE_SYNC_THREAD=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_NET_LWIP_SACK_2_0=y
LOSCFG_ENABLE_OOM_LOOP_TASK=y
# LOSCFG_ENABLE_MAGICKEY is not set
LOSCFG_DRIVERS_USB_HOST_XHCI=y
LOSCFG_DRIVERS_USB_ETHERNET=y
LOSCFG_DRIVERS_USB_WIRELESS=y
......
......@@ -6,7 +6,6 @@ LOSCFG_FS_FAT=y
LOSCFG_FS_FAT_DISK=y
LOSCFG_FS_FAT_VIRTUAL_PARTITION=y
LOSCFG_FS_VFS_BLOCK_DEVICE=y
LOSCFG_ENABLE_MAGICKEY=y
LOSCFG_DEBUG_VERSION=y
# LOSCFG_SHELL_LK is not set
LOSCFG_USER_INIT_DEBUG=y
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册