Skip to content

Commit 9553b1a

Browse files
committed
Changed gpio_set_direction to ignore USR LEDs.
1 parent 5b8a2c0 commit 9553b1a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/event_gpio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ int gpio_set_direction(unsigned int gpio, unsigned int in_flag)
233233
char filename[40];
234234
char direction[10] = { 0 };
235235

236+
if ((gpio >= USR_LED_GPIO_MIN) && (gpio <= USR_LED_GPIO_MAX)) {
237+
return 0; // direction is not applicable to the USR LED pins
238+
}
239+
236240
snprintf(filename, sizeof(filename), "/sys/class/gpio/gpio%d/direction", gpio);
237241
if ((fd = open(filename, O_WRONLY)) < 0)
238242
return -1;

0 commit comments

Comments
 (0)