-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all platforms: update Mycelium dependencies #343
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trying to figure out why the timer is wedged on D1
self.set_prescaler(TimerPrescaler::P8); // 24M / 8: 3.00M ticks/s | ||
self.set_mode(TimerMode::PERIODIC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same prescaler and mode configuration we set in the older code, so that's presumably not the problem...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: indeed it was not! #343 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more notes
SystemTime::now() | ||
.duration_since(SystemTime::UNIX_EPOCH) | ||
.unwrap() | ||
.as_micros() as u64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably we could make this use Instant
rather than SystemTime
, but we'd need to stuff an initial start time Instant
in a global so that this function can get at it. eventually i'd like to redo the Clock
API to let you actually put data into the Clock
at init...
if let Some(timer) = ptr::NonNull::new(TIMER.load(Ordering::Acquire)) { | ||
unsafe { timer.as_ref() }.advance_ticks(1); | ||
} | ||
IDIOTIC_CLOCK_TICKS.fetch_add(1, Ordering::Relaxed); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XXX ELIZA THIS SUCKS SO BAD LOL
25bdccb
to
5e4ff79
Compare
oh, the D1 timer0 problem is actually something much stupider; it's just that the interval timer mode is counting down from |
also, why did @jamesmunns make the downcounting interval start at |
idk why james did it that way
This implements an ancient TODO about how we ought to handle 32-bit timer 0 rollovers. I also abstracted a bunch more of the timer 0 configuration behind the timer module, so the rest of the kernel doesn't have to know about it.
self.set_prescaler(TimerPrescaler::P8); // 24M / 8: 3.00M ticks/s | ||
self.set_mode(TimerMode::PERIODIC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: indeed it was not! #343 (comment)
This updates our dependencies on Mycelium crates to
hawkw/mycelium@ba56bb4.
This picks up the new
maitake
timer API, as well as the upstreamchange hawkw/mycelium#487 to allow raw access to the IDT in the Mycelium
x86_64 HAL, which we need to do an async UART driver (see #337).
While updating everything to use the new timer API, I also made some
tweaks to our existing timer code, including implementing 32-bit timer
rollover for the D1's TIMER0 (our current timestamp source on that
platform). This was an ancient TODO item since basically forever.
Fixes #337