⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.h

📁 南京航空航天大学开发的一个类Unix和Linux的操作系统,好不好看看就知道了,
💻 H
字号:
#ifndef _TIMER_H#define _TIMER_H#include <lib/queue.h>#include "time.h"/* one shot timer, don't support periodic timer */struct timer_t {	CHAIN(,timer_t);	/* never chanage once init */	tick_t period;	vfp_t func;	void * data;	/* tempory variable */	tick_t lefttick, starttick;	long magic;	bool active() { return next != NULL; }	void start();	void stop();	void start(tick_t period_) { period = period_; start(); }	void restart() { stop(); start(); }	void restart(tick_t period_) { stop(); start(period_); }	void init(tick_t period_, vfp_t func_, void * data_);	timer_t() { next = prev = NULL; magic = 0x3721748; }	~timer_t() { stop(); magic = 0x3721dead; }};QUEUE(,timer_t);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -