From 430a3abf7dacb56f30e13e8e6cd993e29aa6fe6e Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Thu, 28 Oct 2021 16:02:39 +0800 Subject: [PATCH] driver/ps2: move EnableReporting to the end of mouse init sequence --- driver/irq/pic/ps2/ps2.c | 10 +++++----- driver/irq/pic/ps2/ps2.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/driver/irq/pic/ps2/ps2.c b/driver/irq/pic/ps2/ps2.c index bf1d137..1b87612 100644 --- a/driver/irq/pic/ps2/ps2.c +++ b/driver/irq/pic/ps2/ps2.c @@ -55,11 +55,6 @@ void irq_pic_ps2_Init() { } io_Printf("%X ", data); - // enable mouse reporting - io_WriteConsoleASCII("MOUSE_ENABLE_REPORTING... "); - __ps2_WriteCommandData(IRQ_PIC_PS2_CMD_SEND_MOUSE, IRQ_PIC_PS2_CMD_DEVICE_MOUSE_ENABLE_REPORTING); - __ps2_ReadACK(); // receive ACK - // enable 4-byte mode for mouse, pure magic! irq_pic_ps2_Mouse4Bytes = false; __ps2_SetMouseRate(200); @@ -79,6 +74,11 @@ void irq_pic_ps2_Init() { // set the actual mouse sample rate __ps2_SetMouseRate(IRQ_PIC_PS2_MOUSE_SAMPLERATE); + // enable mouse reporting + io_WriteConsoleASCII("MOUSE_ENABLE_REPORTING... "); + __ps2_WriteCommandData(IRQ_PIC_PS2_CMD_SEND_MOUSE, IRQ_PIC_PS2_CMD_DEVICE_MOUSE_ENABLE_REPORTING); + __ps2_ReadACK(); // receive ACK + INTERRUPT_RESTORE; } diff --git a/driver/irq/pic/ps2/ps2.h b/driver/irq/pic/ps2/ps2.h index 254759c..15fd075 100644 --- a/driver/irq/pic/ps2/ps2.h +++ b/driver/irq/pic/ps2/ps2.h @@ -46,6 +46,7 @@ extern "C" { #define IRQ_PIC_PS2_CMD_DEVICE_RESET 0xff #define IRQ_PIC_PS2_CMD_DEVICE_MOUSE_DISABLE_REPORTING 0xf5 #define IRQ_PIC_PS2_CMD_DEVICE_MOUSE_ENABLE_REPORTING 0xf4 +#define IRQ_PIC_PS2_CMD_DEVICE_MOUSE_REQUEST_PACKET 0xeb void irq_pic_ps2_Init();