File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,27 @@ BBIO_err gpio_export(unsigned int gpio)
85
85
goto exit ;
86
86
}
87
87
88
+ // Is GPIO an LED?
89
+ if ( ((gpio >= USR_LED_GPIO_MIN ) && (gpio <= USR_LED_GPIO_MAX ))
90
+ ||
91
+ ( beaglebone_blue ()
92
+ &&
93
+ (
94
+ (gpio == USR_LED_RED )
95
+ || (gpio == USR_LED_GREEN )
96
+ || (gpio == BAT25 )
97
+ || (gpio == BAT50 )
98
+ || (gpio == BAT75 )
99
+ || (gpio == BAT100 )
100
+ || (gpio == WIFI )
101
+ )
102
+ )
103
+ )
104
+ {
105
+ syslog (LOG_WARNING , "Adafruit_BBIO: gpio_export: %u not applicable to built-in LEDs" , gpio );
106
+ return BBIO_OK ; // export is not applicable to the USR LED pins
107
+ }
108
+
88
109
// already exported by someone else?
89
110
char gpio_path [64 ];
90
111
snprintf (gpio_path , sizeof (gpio_path ), "/sys/class/gpio/gpio%d" , gpio );
You can’t perform that action at this time.
0 commit comments