mirror of
https://github.com/iceHtwoO/novaOS.git
synced 2026-04-17 04:32:27 +00:00
Enable GPIO Pull Up and Down
This commit is contained in:
@@ -4,15 +4,15 @@ fn read_clo() -> u32 {
|
||||
unsafe { return core::ptr::read_volatile(TIMER_CLO as *const u32) }
|
||||
}
|
||||
|
||||
pub unsafe fn sleep(microseconds: u32) {
|
||||
pub fn sleep(microseconds: u32) {
|
||||
let start = read_clo();
|
||||
while read_clo() - start < microseconds {
|
||||
core::arch::asm!("nop");
|
||||
unsafe { core::arch::asm!("nop") }
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn delay_nops(count: u32) {
|
||||
pub fn delay_nops(count: u32) {
|
||||
for _ in 0..count {
|
||||
core::arch::asm!("nop");
|
||||
unsafe { core::arch::asm!("nop") }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user