Merge branch 'main' of git.sr.ht:~fabianmv/triviOS

This commit is contained in:
Alejandro Diaz 2023-09-12 00:21:39 -06:00
commit 6d138ed9b7
2 changed files with 2 additions and 6 deletions

View file

@ -5,10 +5,6 @@ int init_gpio();
void cleanup_gpio();
int set_pin_state(int pin, int state);
int read_button(int pin);
int turn_on_pin(int pin);
int turn_off_pin(int pin);

View file

@ -22,7 +22,7 @@ void cleanup_gpio() {
gpiod_chip_close(chip);
}
int set_pin_state(int pin, int state) {
static int set_pin_state(int pin, int state) {
// https://libgpiod-dlang.dpldocs.info/gpiod.gpiod_chip_get_line.html
struct gpiod_line *line = gpiod_chip_get_line(chip, pin); // this may need an offset
if (!line) {
@ -73,7 +73,7 @@ int turn_off_all_pins() {
return 0;
}
int button_presssed(int event, unsigned int pin, const struct timespec * timestamp, void *data) {
static int button_presssed(int event, unsigned int pin, const struct timespec * timestamp, void *data) {
(void) event;
(void) timestamp;
* (int *) data = (int) pin;