-
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
update Mycelium dependencies #343
base: main
Are you sure you want to change the base?
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
@@ -344,22 +337,16 @@ impl D1 { | |||
} | |||
} | |||
|
|||
timer0.start_counter(0xFFFF_FFFF); |
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.
I wonder if this line moving is why the D1 is wedged. The new code has moved the call to start_counter
into Timer0::into_maitake_clock
, which gets called before PLIC setup. Perhaps starting the counter before the PLIC is configured breaks something...
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.
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
platforms/pomelo/src/main.rs
Outdated
// TODO(anatol) please fix this for me thanks :) | ||
unimplemented!("FIGURE OUT HOW TO GET A NORMAL TIMESTAMP OUT OF WASM LOL") |
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.
one way to make this work with the current Clock
interface is to stuff a DateTime<Local>
into a global so it can be grabbed by this function. i'll probably just go do that.
perhaps there's a nicer way to get a global integer timestamp on wasm, but i don't know what it is.
This updates everything to hawkw/mycelium@ba56bb4.