Skip to content

Commit 8b6c083

Browse files
authored
Merge pull request #160 from MarkAYoder/master
Switched to new Blue gpio numbering: GP0_0 is now GP0_3
2 parents 538e564 + 6ef19e2 commit 8b6c083

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

source/common.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,17 @@ pins_t table[] = {
169169
{ "DGND", "P9_46", 0, -1, -1},
170170

171171
// These are for the Blue
172-
{ "GPO_0", "GP0_0", 57, -1, -1},
173-
{ "GP0_1", "GP0_1", 49, -1, -1},
174-
{ "GP0_2", "GP0_2", 116, -1, -1},
175-
{ "GP0_3", "GP0_3", 113, -1, -1},
176-
{ "GP1_0", "GP1_0", 98, -1, -1},
177-
{ "GP1_1", "GP1_1", 97, -1, -1},
172+
{ "GPO_3", "GP0_3", 57, -1, -1},
173+
{ "GP0_4", "GP0_4", 49, -1, -1},
174+
{ "GP0_5", "GP0_5", 116, -1, -1},
175+
{ "GP0_6", "GP0_6", 113, -1, -1},
176+
{ "GP1_3", "GP1_3", 98, -1, -1},
177+
{ "GP1_4", "GP1_4", 97, -1, -1},
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)

source/examples/python/gpio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import Adafruit_BBIO.GPIO as GPIO
44
import time
55

6-
LEDs = ["GP0_0", "GP0_1", "GP0_2", "GP0_3", "GP1_0", "GP1_1", "UT1_0"]
6+
LEDs = ["GP0_3", "GP0_4", "GP0_5", "GP0_6", "GP1_3", "GP1_4",
7+
"RED_LED", "GREEN_LED"]
78
for LED in LEDs:
89
print(LED)
910
GPIO.setup(LED, GPIO.OUT)
@@ -13,4 +14,3 @@
1314
GPIO.output(LED, GPIO.HIGH)
1415
time.sleep(0.1)
1516
GPIO.output(LED, GPIO.LOW)
16-
time.sleep(0.1)

0 commit comments

Comments
 (0)