summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/i8042.c2
-rw-r--r--common/keyboard.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/common/i8042.c b/common/i8042.c
index 35e1f2b094..54eb668f3c 100644
--- a/common/i8042.c
+++ b/common/i8042.c
@@ -46,7 +46,7 @@ static int i8042_irq_enabled = 0;
/* Reset all i8042 buffer */
-void i8042_init()
+void i8042_flush_buffer()
{
head_to_buffer = tail_to_buffer = 0;
keyboard_clear_buffer();
diff --git a/common/keyboard.c b/common/keyboard.c
index 2d69dba438..6b2dc48088 100644
--- a/common/keyboard.c
+++ b/common/keyboard.c
@@ -255,9 +255,9 @@ static void reset_rate_and_delay(void)
}
-static void clear_underlying_buffer(void)
+void keyboard_clear_underlying_buffer(void)
{
- i8042_init();
+ i8042_flush_buffer();
}
@@ -482,25 +482,25 @@ int handle_keyboard_data(uint8_t data, uint8_t *output)
case I8042_CMD_ENABLE:
output[out_len++] = I8042_RET_ACK;
keyboard_enable(1);
- clear_underlying_buffer();
+ keyboard_clear_underlying_buffer();
break;
case I8042_CMD_RESET_DIS:
output[out_len++] = I8042_RET_ACK;
keyboard_enable(0);
reset_rate_and_delay();
- clear_underlying_buffer();
+ keyboard_clear_underlying_buffer();
break;
case I8042_CMD_RESET_DEF:
output[out_len++] = I8042_RET_ACK;
reset_rate_and_delay();
- clear_underlying_buffer();
+ keyboard_clear_underlying_buffer();
break;
case I8042_CMD_RESET_BAT:
reset_rate_and_delay();
- clear_underlying_buffer();
+ keyboard_clear_underlying_buffer();
output[out_len++] = I8042_RET_ACK;
output[out_len++] = I8042_RET_BAT;
output[out_len++] = I8042_RET_BAT;
@@ -613,7 +613,7 @@ int handle_keyboard_command(uint8_t command, uint8_t *output)
} else {
CPRINTF("[Unsupported cmd: 0x%02x]\n", command);
reset_rate_and_delay();
- clear_underlying_buffer();
+ keyboard_clear_underlying_buffer();
output[out_len++] = I8042_RET_NAK;
data_port_state = STATE_NORMAL;
}