add wait command end
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2022-12-15 21:08:31 +01:00
parent 56d10459ed
commit ff026bff7c

@ -330,6 +330,8 @@ impl ATABus {
// Wait command end // Wait command end
(*INTERRUPT_FUTURE).await; (*INTERRUPT_FUTURE).await;
println!("Command sent"); println!("Command sent");
self.wait_command_end();
} }
fn wait_busy(&mut self) { 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();
}
}
}
} }