Refactor the implementation

This commit is contained in:
Jianfeng Jiang
2023-10-08 17:40:58 +08:00
committed by Tate, Hongliang Tian
parent 50761a5cc5
commit 0d6f6f001c
54 changed files with 433 additions and 326 deletions

View File

@ -60,7 +60,7 @@ impl Timer {
let mut lock = self.inner.lock_irq_disabled();
match &lock.timer_callback {
Some(callback) => {
callback.disable();
callback.cancel();
}
None => {}
}
@ -94,7 +94,7 @@ impl Timer {
pub fn clear(&self) {
let mut lock = self.inner.lock_irq_disabled();
if let Some(callback) = &lock.timer_callback {
callback.disable();
callback.cancel();
}
lock.timeout_tick = 0;
lock.start_tick = 0;