📄 onoff.c
字号:
#include <fcntl.h>#include <unistd.h>#include <stdio.h>#include <string.h>#include <linux/ioport.h>#include "trlight.h"#include <asm/io.h>int value=0;void main (int argc, char** argv){ int fd; if (argc<2){ printf("usage: onoff [1/0]\n"); exit(0); } fd=open("/dev/trlight",0); sscanf(argv[1],"%d",&value); printf("%d",value); if (value==1) value=TRLIGHT_START; else if (value==0) value=TRLIGHT_STOP; ioctl(fd,value,0); close(fd); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -