?? test.c
字號:
#include <stdio.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
static int fd = -1;
int main(void)
{
int i,out;
out = 0xe0;
fd = open("/dev/IO/0",O_RDWR);
if(fd<0)
{
printf("failed to open the device \n");
}
else
printf("successed to open the device \n");
while(1)
{
ioctl(fd , out);
for(i=0;i<5000000;i++);
out=(out<<1) & 0xf0; //注意,這里一定要加“& 0xf0”這一項,因為0xe0<<1后就變成了0x1c0,為了把那個1變成0而只獲取有用的四位,所以加“& 0xf0”這一項
// printf("out=%x \n",out);
if(out!=0xe0) out|=0x10;
// printf("out=%x \n",out);
}
close(fd);
printf("end of test \n");
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -