mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
corrections and improvements to the current PR
- set slack to 0 - change panic to advisory statement reasons are commented in the code.
This commit is contained in:
parent
18f3ac5507
commit
13e01fd823
2 changed files with 14 additions and 5 deletions
|
|
@ -193,8 +193,12 @@ fn main() -> ! {
|
||||||
let len_after = awaiting.len();
|
let len_after = awaiting.len();
|
||||||
assert!(len_before != len_after);
|
assert!(len_before != len_after);
|
||||||
|
|
||||||
// As a final check, make sure the last notification is from us.
|
// Note multiple events elapsing since the last recalculate. Theorized to be harmless.
|
||||||
assert!(ticktimer.last_response() == sender);
|
if ticktimer.last_response() != sender {
|
||||||
|
log::warn!("Multiple events triggered before we could recalculate sleep: ticktimer.last_response() {:?} != sender {:?}; sleep_heap.len(): {}",
|
||||||
|
ticktimer.last_response(), sender, sleep_heap.len()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recalculate sleep with the newly-adjusted hash and re-enable
|
// Recalculate sleep with the newly-adjusted hash and re-enable
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,14 @@ use utralib::generated::*;
|
||||||
|
|
||||||
use xous::definitions::MessageSender;
|
use xous::definitions::MessageSender;
|
||||||
|
|
||||||
/// Add some slack to ensure that when we set the timeout, it
|
/// Latency slack may be necessary for hardware implementations that can't handle
|
||||||
/// doesn't end up in the past due to processing latencies.
|
/// events that happened in the past. However, for Precursor hardware, alarms will
|
||||||
const LATENCY_SLACK_MS: i64 = 3;
|
/// trigger based on a "less than or equal to current time" basis, so even if an
|
||||||
|
/// alarm happens in the "past" due to slippage between the current time reading
|
||||||
|
/// and the alarm setting, the alarm should still trigger.
|
||||||
|
///
|
||||||
|
/// Note that setting this number larger than 0 will degrade scheduler performance.
|
||||||
|
const LATENCY_SLACK_MS: i64 = 0;
|
||||||
|
|
||||||
pub struct XousTickTimer {
|
pub struct XousTickTimer {
|
||||||
csr: utralib::CSR<u32>,
|
csr: utralib::CSR<u32>,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue