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

📄 timeout.c

📁 linux2.6驱动模块
💻 C
字号:
#include <asm/irq.h>#include "../inc/inc.h"extern MANAGER *Mg_p;void Liid_timer_del(unsigned long data){    printk("deleting the timer\r\n");    del_timer(&Mg_p->Liid_timer_list);}void Liid_timer_alarm(unsigned long data){    struct timeval tv1;    static int time = 0;    int tmp;    Mg_p->Liid_timer_list.expires = jiffies + (10*HZ / 4);    time ++;        if((time % 10) > 4){        *Mg_p->led = ~((1 << (5 - (time%5)))<<4);    }else{        *Mg_p->led = ~((1 << (time%5))<<4);    }    printk("%#x ", time);    //*Mg_p->led = ~((1 << (time%4))<<4);    //memset(Mg_p->video.base_addr, 0xcc, 1*1024*1000);    //writeb(time, Mg_p->video.base_addr + time);    for(tmp = 0; tmp < 1*1024*1000; tmp ++){        *(char *)(Mg_p->video.base_addr + tmp) = jiffies + tmp;        mb();            }    //*(char *)(Mg_p->video.base_addr + time) = time;    del_timer(&Mg_p->Liid_timer_list);    add_timer(&Mg_p->Liid_timer_list);    if(time > 0xf){        Liid_timer_del(0);    }}void Liid_timer_init(unsigned long data){    struct timeval tv1;    static int time;    init_timer(&Mg_p->Liid_timer_list);    Mg_p->Liid_timer_list.expires = jiffies + (2*HZ);    Mg_p->Liid_timer_list.function = Liid_timer_alarm;    printk("begin %x ", time ++);    del_timer(&Mg_p->Liid_timer_list);    add_timer(&Mg_p->Liid_timer_list);}#define	LED4_OFF( ) __raw_writel(__raw_readl(S3C2410_GPFDAT) | 0x80, S3C2410_GPFDAT)		

⌨️ 快捷键说明

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