?? leddrv_test.c
字號:
#include <stdio.h>#include <string.h>#include <malloc.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <signal.h>static void Delay(int);int main(void){ int fd,count; int i=3; unsigned long rgcon; if((fd=open("/dev/leddrv",O_RDWR))==-1) { perror("open error"); exit(1); } rgcon=(unsigned int)(1<<14)|(unsigned int)(1<<23); while(i--){ if((count=write(fd,(char *)&rgcon,4))!=4) { perror("write1 error"); exit(1); } Delay(100); } close(fd); return 0;}static void Delay(int x){ int i,j,k; for(i=0;i<x;i++) for(j=0;j<0xff;j++) for(k=0;k<0xff;k++);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -