Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
parent
56d10459ed
commit
ff026bff7c
@ -330,6 +330,8 @@ impl ATABus {
|
||||
// Wait command end
|
||||
(*INTERRUPT_FUTURE).await;
|
||||
println!("Command sent");
|
||||
|
||||
self.wait_command_end();
|
||||
}
|
||||
|
||||
fn wait_busy(&mut self) {
|
||||
@ -360,6 +362,15 @@ impl ATABus {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn wait_command_end(&mut self) {
|
||||
let mut status = ATA_BSY;
|
||||
while (status & ATA_BSY) != 0 && (status & ATA_DRQ) != 0 {
|
||||
unsafe {
|
||||
status = self.status.read();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user