os_timer: move preemption from shell to ticktimer server

This is responsible for preemption in the system. Move it to the timer
server since it seems to make more sense to have there.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-11-27 14:07:44 +08:00
parent 513b99f916
commit 684ba69a31
2 changed files with 79 additions and 74 deletions

View file

@ -4,6 +4,8 @@
mod api; mod api;
use api::Opcode; use api::Opcode;
mod os_timer;
use core::convert::TryFrom; use core::convert::TryFrom;
use heapless::binary_heap::{BinaryHeap, Min}; use heapless::binary_heap::{BinaryHeap, Min};
@ -260,6 +262,9 @@ fn recalculate_sleep(
#[xous::xous_main] #[xous::xous_main]
fn xmain() -> ! { fn xmain() -> ! {
// Start the OS timer which is responsible for setting up preemption.
os_timer::init();
log_server::init_wait().unwrap(); log_server::init_wait().unwrap();
// "Sleep" commands get put in here and are ordered as necessary // "Sleep" commands get put in here and are ordered as necessary