diff options
| author | Tianhao Wang <shrik3@mailbox.org> | 2024-04-17 23:59:03 +0200 |
|---|---|---|
| committer | Tianhao Wang <shrik3@mailbox.org> | 2024-06-11 15:16:34 +0200 |
| commit | 43d2363b0bf16df6932db54fff28089207f8e2b4 (patch) | |
| tree | a00b6aa39ace1b44892b223457dd96561d679696 /src/machine/keyctrl.rs | |
| parent | 6e5e38e7f21ea5a69ac0ac538584841df9f6b13f (diff) | |
formatting code
Diffstat (limited to 'src/machine/keyctrl.rs')
| -rw-r--r-- | src/machine/keyctrl.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/machine/keyctrl.rs b/src/machine/keyctrl.rs index dc3402d..9bdada5 100644 --- a/src/machine/keyctrl.rs +++ b/src/machine/keyctrl.rs @@ -92,7 +92,9 @@ impl KeyboardController { // TODO perhaps disable interrupts here // TODO set a timeout. The ACK reply may never come // 1. write command - unsafe {self.__block_until_cmd_buffer_empty();} + unsafe { + self.__block_until_cmd_buffer_empty(); + } self.dport.outb(Cmd::SetLed as u8); // 2. wait for ack let ack = unsafe { self.__block_for_ack() }; @@ -188,7 +190,9 @@ impl KeyboardController { pub fn fetch_key(&mut self) { // mask keyboard interrupts when polling. let was_masked = Self::is_int_masked(); - if !was_masked {Self::disable_keyboard_int();} + if !was_masked { + Self::disable_keyboard_int(); + } // I'd like to see if this panics.... let sr = self.read_status().unwrap(); @@ -197,7 +201,9 @@ impl KeyboardController { return; } self.update_state(self.dport.inb()); - if !was_masked {Self::enable_keyboard_int();} + if !was_masked { + Self::enable_keyboard_int(); + } } // this should be called by the "epilogue" @@ -273,7 +279,9 @@ impl KeyboardController { unsafe fn __block_until_cmd_buffer_empty(&self) { loop { let s = self.read_status().unwrap(); - if !s.contains(StatusReg::INB) {break;}; + if !s.contains(StatusReg::INB) { + break; + }; } } } |
