mirror of
http://180.163.74.83:13000/zhangzhenghao/write_mac_tool.git
synced 2025-12-12 23:04:29 +00:00
新增注释
This commit is contained in:
parent
cd1fa03ca1
commit
1cc63fe40c
@ -797,10 +797,10 @@ static pthread_t led_thread;
|
|||||||
static void gpio_init_yellow(void) {
|
static void gpio_init_yellow(void) {
|
||||||
int fd = open("/sys/class/gpio/export", O_WRONLY);
|
int fd = open("/sys/class/gpio/export", O_WRONLY);
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
write(fd, "113", 3);
|
write(fd, "113", 3); // TODO 注意改版对应脚名称
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
fd = open("/sys/class/gpio/gpio113/direction", O_WRONLY);
|
fd = open("/sys/class/gpio/gpio113/direction", O_WRONLY); // TODO 注意改版对应脚名称
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
write(fd, "out", 3);
|
write(fd, "out", 3);
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -808,7 +808,7 @@ static void gpio_init_yellow(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void* led_blink_thread(void* arg) {
|
static void* led_blink_thread(void* arg) {
|
||||||
int fd = open("/sys/class/gpio/gpio113/value", O_WRONLY);
|
int fd = open("/sys/class/gpio/gpio113/value", O_WRONLY); // TODO 注意改版对应脚名称
|
||||||
if (fd < 0) return NULL;
|
if (fd < 0) return NULL;
|
||||||
while (led_running) {
|
while (led_running) {
|
||||||
write(fd, "1", 1);
|
write(fd, "1", 1);
|
||||||
@ -841,7 +841,7 @@ static void set_yellow_on(void) {
|
|||||||
stop_yellow_blink();
|
stop_yellow_blink();
|
||||||
// 初始化GPIO并置为高电平
|
// 初始化GPIO并置为高电平
|
||||||
gpio_init_yellow();
|
gpio_init_yellow();
|
||||||
int fd = open("/sys/class/gpio/gpio113/value", O_WRONLY);
|
int fd = open("/sys/class/gpio/gpio113/value", O_WRONLY); // TODO 注意改版对应脚名称
|
||||||
if (fd < 0) return;
|
if (fd < 0) return;
|
||||||
write(fd, "1", 1);
|
write(fd, "1", 1);
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user