瀏覽代碼

update timer handler

Signed-off-by: FuangCao <cavan.cao@foxmail.com>
FuangCao 5 年之前
父節點
當前提交
5719a669e9
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      Application/libs/shark_task.c
  2. 1 1
      Application/libs/shark_task.h

+ 1 - 1
Application/libs/shark_task.c

@@ -86,7 +86,7 @@ static u32 shark_timer_task_handler(void)
 
 		if (timer != &shark_timer_head) {
 			shark_timer_cancel(timer);
-			timer->handler();
+			timer->handler(timer);
 		} else {
 			break;
 		}

+ 1 - 1
Application/libs/shark_task.h

@@ -12,7 +12,7 @@ typedef struct shark_timer {
 	u64 time;
 	struct shark_timer *prev;
 	struct shark_timer *next;
-	void (*handler)(void);
+	void (*handler)(struct shark_timer *timer);
 } shark_timer_t;
 
 u64 shark_get_mseconds(void);