Skip to content

Commit 6ef19e2

Browse files
committed
Added PAUSE and MODE buttons.
Also add 100ms sleep after exporting a new pin to give the OS time to set the correct owner and group
1 parent af47930 commit 6ef19e2

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

source/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ pins_t table[] = {
178178
{ "RED_LED", "RED", 66, -1, -1}, // LEDs
179179
{ "GREEN_LED", "GREEN", 67, -1, -1},
180180

181-
{ "UT1_0", "P9_26", 14, 1, -1},
182-
{ "UT1_1", "P9_24", 15, 1, -1},
181+
{ "PAUSE", "P8_9", 69, 1, -1},
182+
{ "MODE", "P8_10", 68, 1, -1},
183183

184184

185185
{ NULL, NULL, 0, 0, 0 }

source/event_gpio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ BBIO_err gpio_export(unsigned int gpio)
125125
gpio, gpio_export, errno, strerror(errno));
126126
ret = BBIO_SYSFS;
127127
}
128+
usleep(100000); // Hack to wait for newly exported pins to get correct ownership
128129
return ret;
129130
}
130131

source/examples/python/button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
import Adafruit_BBIO.GPIO as GPIO
77
import time
88

9-
button="GP0_0" # PAUSE=P8_9, MODE=P8_10
10-
LED ="GP0_1"
9+
button="PAUSE" # PAUSE=P8_9, MODE=P8_10
10+
LED ="RED_LED"
1111

1212
# Set the GPIO pins:
1313
GPIO.setup(LED, GPIO.OUT)

0 commit comments

Comments
 (0)