diff --git a/build.rs b/build.rs index 2879705f80..d31301f5af 100644 --- a/build.rs +++ b/build.rs @@ -76,8 +76,8 @@ fn main() { } // GreaterThanOrEqual - for i in 1..(1 << bits) + 1 { - for j in 1..(i + 1) { + for i in 0..(1 << bits) + 1 { + for j in 0..(i + 1) { let i = Ident::new(format!("U{}", i)); let j = Ident::new(format!("U{}", j)); diff --git a/src/lib.rs b/src/lib.rs index 4c94019a6b..39144740a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -364,12 +364,14 @@ macro_rules! tasks { }) => { fn main() { $crate::critical(|cmax| { - init(cmax); + let p0 = unsafe { ::core::ptr::read(0x0 as *const P0) }; + init(p0, cmax); set_priorities(); enable_tasks(); }); - idle(unsafe { ::core::ptr::read(0x0 as *const P0) }); + let p0 = unsafe { ::core::ptr::read(0x0 as *const P0) }; + idle(p0); fn set_priorities() { // NOTE(safe) this function runs in an interrupt free context