Attention is currently required from: Stefan Reinauer, Angel Pons.
8 comments:
File Makefile:
CONFIG_SYSFSGPIO ?= no
nit: move this above CONFIG_PRINT_WIKI
Done
File meson.build:
Patch Set #4, Line 71: config_sysfsgpio
We don't use this anywhere.
Done
Patch Set #4, Line 313: if host_machine.system() == 'linux'
Maybe it should be used here. Also, this depends on `config_bitbang_spi`. […]
Done
File sysfsgpio.c:
Patch Set #4, Line 93: snprintf(s, sizeof(s), "/sys/class/gpio/gpio%s/", desc->pin);
Hmmm... I think you should be able to define the common prefix in a macro and do the following: […]
Done
I want to know why not use snprintf. The changes you hope will make the code messier.
snprintf(s, sizeof(s), "/sys/class/gpio/gpio%s/direction", desc->pin);
desc->fd_direction = open(s, O_WRONLY);
if (desc->fd_direction < 0) {
msg_perr("Error: failed to open %s\n", s);
return -1;
}
snprintf(s, sizeof(s), "/sys/class/gpio/gpio%s/value", desc->pin);
desc->fd_value = open(s, O_RDONLY);
if (desc->fd_value < 0) {
msg_perr("Error: failed to open %s\n", s);
return -1;
}
Here, you could do the following instead: […]
I want to know why not use snprintf. The changes you hope will make the code messier.
Patch Set #4, Line 135: desc->fd_direction = -1;
Also invalidate the pin string: […]
Done
Patch Set #4, Line 204: static int parse_pins(struct sysfsgpio_pins *pins)
if (v < 0 || v > 9999999)
break
99999 is a large enough number, but I don’t think there is a speed requirement here. You can hand it to export_sysfsgpio to determine whether the value of v is valid.
> const long v = strtol(token, &suffix, 10);
I don’t think it is necessary to limit the use of decimal numbers
To view, visit change 49254. To unsubscribe, or for help writing mail filters, visit settings.