mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
fix timer primitive for ov driver
This commit is contained in:
parent
c0b942b801
commit
0081575e80
1 changed files with 3 additions and 3 deletions
|
|
@ -273,14 +273,14 @@ impl Ov2640 {
|
||||||
use utralib::{CSR, utra};
|
use utralib::{CSR, utra};
|
||||||
// abuse the d11ctime timer to create some time-out like thing
|
// abuse the d11ctime timer to create some time-out like thing
|
||||||
let mut d11c = CSR::new(utra::d11ctime::HW_D11CTIME_BASE as *mut u32);
|
let mut d11c = CSR::new(utra::d11ctime::HW_D11CTIME_BASE as *mut u32);
|
||||||
d11c.wfo(utra::d11ctime::CONTROL_COUNT, 33 / 2); // 0.5ms per interval
|
d11c.wfo(utra::d11ctime::CONTROL_COUNT, 333_333); // 1.0ms per interval
|
||||||
let mut polarity = d11c.rf(utra::d11ctime::HEARTBEAT_BEAT);
|
let mut polarity = d11c.rf(utra::d11ctime::HEARTBEAT_BEAT);
|
||||||
for _ in 0..quantum {
|
for _ in 0..quantum {
|
||||||
while polarity == d11c.rf(utra::d11ctime::HEARTBEAT_BEAT) {}
|
while polarity == d11c.rf(utra::d11ctime::HEARTBEAT_BEAT) {}
|
||||||
|
polarity = d11c.rf(utra::d11ctime::HEARTBEAT_BEAT);
|
||||||
}
|
}
|
||||||
// we have to split this because we don't know where we caught the previous interval
|
// we have to split this because we don't know where we caught the previous interval
|
||||||
polarity = d11c.rf(utra::d11ctime::HEARTBEAT_BEAT);
|
if quantum == 1 {
|
||||||
for _ in 0..quantum {
|
|
||||||
while polarity == d11c.rf(utra::d11ctime::HEARTBEAT_BEAT) {}
|
while polarity == d11c.rf(utra::d11ctime::HEARTBEAT_BEAT) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue