Handle backspace for k210/qemu platform && Add lots of user tests.
This commit is contained in:
parent
9165e64d1b
commit
244c0ee84d
20 changed files with 361 additions and 35 deletions
|
@ -3,11 +3,16 @@ use crate::sbi::set_timer;
|
|||
use crate::config::CPU_FREQ;
|
||||
|
||||
const TICKS_PER_SEC: usize = 100;
|
||||
const MSEC_PER_SEC: usize = 1000;
|
||||
|
||||
pub fn get_time() -> usize {
|
||||
time::read()
|
||||
}
|
||||
|
||||
pub fn get_time_ms() -> usize {
|
||||
time::read() / (CPU_FREQ / MSEC_PER_SEC)
|
||||
}
|
||||
|
||||
pub fn set_next_trigger() {
|
||||
set_timer(get_time() + CPU_FREQ / TICKS_PER_SEC);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue