driver/ps2: move EnableReporting to the end of mouse init sequence

This commit is contained in:
Edgaru089 2021-10-28 16:02:39 +08:00
parent 218e5c2c96
commit 430a3abf7d
2 changed files with 6 additions and 5 deletions

View File

@ -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;
}

View File

@ -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();