mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-08 04:56:43 +00:00
fix timebase of delays in loader
should be tied to the system clock frequency
This commit is contained in:
parent
05c9828106
commit
406e39a0d5
2 changed files with 3 additions and 2 deletions
|
|
@ -54,4 +54,4 @@ pub const GUARD_MEMORY_BYTES: usize = 8 * crate::PAGE_SIZE; // 1 extra page for
|
|||
pub const SWAPPER_PID: u8 = 2;
|
||||
|
||||
#[cfg(feature = "bao1x")]
|
||||
pub const SYSTEM_CLOCK_FREQUENCY: u32 = 800_000_000;
|
||||
pub const SYSTEM_CLOCK_FREQUENCY: u32 = bao1x_hal::board::DEFAULT_FCLK_FREQUENCY / 2;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ pub fn delay(quantum: usize) {
|
|||
use utralib::{CSR, utra};
|
||||
// abuse the d11ctime timer to create some time-out like thing
|
||||
let mut d11c = CSR::new(utra::d11ctime::HW_D11CTIME_BASE as *mut u32);
|
||||
d11c.wfo(utra::d11ctime::CONTROL_COUNT, 333_333); // 1.0ms per interval
|
||||
// 1.0ms per interval
|
||||
d11c.wfo(utra::d11ctime::CONTROL_COUNT, crate::SYSTEM_CLOCK_FREQUENCY / 1000);
|
||||
let mut polarity = d11c.rf(utra::d11ctime::HEARTBEAT_BEAT);
|
||||
for _ in 0..quantum {
|
||||
while polarity == d11c.rf(utra::d11ctime::HEARTBEAT_BEAT) {}
|
||||
|
|
|
|||
Loading…
Reference in a new issue