Loop on serial input

Fix issue with serial and cascade interrupts not being ackd
This commit is contained in:
Jeremy Soller
2017-03-24 20:38:02 -06:00
parent 906ef94ffd
commit 7817122662
2 changed files with 10 additions and 5 deletions

View File

@@ -85,13 +85,15 @@ impl SerialPort {
}
pub fn on_receive(&mut self) {
let data = self.data.read();
while self.line_sts().contains(INPUT_FULL) {
let data = self.data.read();
extern {
fn debug_input(byte: u8);
extern {
fn debug_input(byte: u8);
}
unsafe { debug_input(data) };
}
unsafe { debug_input(data) };
}
}

View File

@@ -50,14 +50,17 @@ interrupt!(keyboard, {
interrupt!(cascade, {
// No need to do any operations on cascade
pic::MASTER.ack();
});
interrupt!(com2, {
COM2.lock().on_receive();
pic::MASTER.ack();
});
interrupt!(com1, {
COM1.lock().on_receive();
pic::MASTER.ack();
});
interrupt!(lpt2, {