Loop on serial input
Fix issue with serial and cascade interrupts not being ackd
This commit is contained in:
@@ -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) };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user