1
This commit is contained in:
parent
2fb1fe39d0
commit
b3b1cf49f8
@ -101,8 +101,8 @@ impl<T> ListHead<T> {
|
||||
|
||||
pub fn replace_init(head: &Rc::<RefCell::<Self>>, pnew: &Rc::<RefCell::<Self>>) {
|
||||
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<T> ListHead<T> {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -227,7 +227,7 @@ impl XTimer {
|
||||
}
|
||||
println!("zzzzzzz idx:{} index:{}", idx, index);
|
||||
if !tv[index].borrow().empty() {
|
||||
let mut cascade_list = crate::ListHead::<TimerList>::new_head();
|
||||
let cascade_list = crate::ListHead::<TimerList>::new_head();
|
||||
crate::ListHead::<TimerList>::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::<TimerList>::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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user