diff --git a/src/listhead.rs b/src/listhead.rs index dde7f55..ab6645b 100644 --- a/src/listhead.rs +++ b/src/listhead.rs @@ -101,8 +101,8 @@ impl ListHead { pub fn replace_init(head: &Rc::>, pnew: &Rc::>) { if !head.borrow().empty() { - let timer = &head.borrow().first_entry(); - let a = timer.upgrade().unwrap(); + //let timer = &head.borrow().first_entry(); + //let a = timer.upgrade().unwrap(); } else { return; } @@ -113,8 +113,8 @@ impl ListHead { pnew.borrow_mut().prev.upgrade().unwrap().borrow_mut().next = Rc::downgrade(pnew); head.borrow_mut().init(); if !pnew.borrow().empty() { - let timer = &pnew.borrow().first_entry(); - let a = timer.upgrade().unwrap(); + //let timer = &pnew.borrow().first_entry(); + //let a = timer.upgrade().unwrap(); } } diff --git a/src/xtimer.rs b/src/xtimer.rs index 2617fa3..f81d9a3 100644 --- a/src/xtimer.rs +++ b/src/xtimer.rs @@ -227,7 +227,7 @@ impl XTimer { } println!("zzzzzzz idx:{} index:{}", idx, index); if !tv[index].borrow().empty() { - let mut cascade_list = crate::ListHead::::new_head(); + let cascade_list = crate::ListHead::::new_head(); crate::ListHead::::replace_init (&tv[index], &cascade_list); @@ -245,15 +245,7 @@ impl XTimer { } pub fn update(&mut self) { - let mut tick = 0; - match &self.get_tick_count { - Some(v) => { - tick = (*v)(); - } - None => { - - } - } + let tick = (*self.get_tick_count.as_ref().unwrap())(); while tick >= self.timer_tick { let index = (self.timer_tick & (TVR_MASK as i64)) as usize; if index == 0 && @@ -263,7 +255,6 @@ impl XTimer { self.cascade(3); } self.timer_tick += 1; - println!("wwwwwwwwwwww"); //println!("timer_tick:{} index:{} empty:{}", self.timer_tick, index, self.tv1[index].borrow().empty()); crate::ListHead::::replace_init @@ -272,7 +263,7 @@ impl XTimer { while !self.work_list.borrow().empty() { let timer = &self.work_list.borrow().first_entry(); self.running_timer = timer.clone(); - let a = timer.upgrade().unwrap(); + //let a = timer.upgrade().unwrap(); match &mut timer.upgrade().unwrap().borrow_mut().cb { Some(v) => { (*v)(TimerEvent::Exec, None);