pass P0 to init, derive GreaterThanOrEqual for U0

This commit is contained in:
Jorge Aparicio 2017-04-14 00:15:49 -05:00
parent 398a5ebc5c
commit bf17ee7422
2 changed files with 6 additions and 4 deletions

View file

@ -76,8 +76,8 @@ fn main() {
} }
// GreaterThanOrEqual // GreaterThanOrEqual
for i in 1..(1 << bits) + 1 { for i in 0..(1 << bits) + 1 {
for j in 1..(i + 1) { for j in 0..(i + 1) {
let i = Ident::new(format!("U{}", i)); let i = Ident::new(format!("U{}", i));
let j = Ident::new(format!("U{}", j)); let j = Ident::new(format!("U{}", j));

View file

@ -364,12 +364,14 @@ macro_rules! tasks {
}) => { }) => {
fn main() { fn main() {
$crate::critical(|cmax| { $crate::critical(|cmax| {
init(cmax); let p0 = unsafe { ::core::ptr::read(0x0 as *const P0) };
init(p0, cmax);
set_priorities(); set_priorities();
enable_tasks(); 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() { fn set_priorities() {
// NOTE(safe) this function runs in an interrupt free context // NOTE(safe) this function runs in an interrupt free context