新增注释
This commit is contained in:
parent
cd1fa03ca1
commit
1cc63fe40c
@ -797,10 +797,10 @@ static pthread_t led_thread;
|
||||
static void gpio_init_yellow(void) {
|
||||
int fd = open("/sys/class/gpio/export", O_WRONLY);
|
||||
if (fd >= 0) {
|
||||
write(fd, "113", 3);
|
||||
write(fd, "113", 3); // TODO 注意改版对应脚名称
|
||||
close(fd);
|
||||
}
|
||||
fd = open("/sys/class/gpio/gpio113/direction", O_WRONLY);
|
||||
fd = open("/sys/class/gpio/gpio113/direction", O_WRONLY); // TODO 注意改版对应脚名称
|
||||
if (fd >= 0) {
|
||||
write(fd, "out", 3);
|
||||
close(fd);
|
||||
@ -808,7 +808,7 @@ static void gpio_init_yellow(void) {
|
||||
}
|
||||
|
||||
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;
|
||||
while (led_running) {
|
||||
write(fd, "1", 1);
|
||||
@ -841,7 +841,7 @@ static void set_yellow_on(void) {
|
||||
stop_yellow_blink();
|
||||
// 初始化GPIO并置为高电平
|
||||
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;
|
||||
write(fd, "1", 1);
|
||||
close(fd);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user