Skip to content

Commit dde79b9

Browse files
authored
Merge pull request #5 from adafruit/pi_1_revision_detect
WIP: first pass at switching up pi 1 revision detection
2 parents 732bef2 + 205604e commit dde79b9

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

adafruit_platformdetect/board.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
NODEMCU = "NODEMCU"
2727
ORANGE_PI_PC = "ORANGE_PI_PC"
2828

29-
RASPBERRY_PI_B = "RASPBERRY_PI_B"
29+
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
30+
RASPBERRY_PI_B_REV2 = "RASPBERRY_PI_B_REV2"
3031
RASPBERRY_PI_B_PLUS = "RASPBERRY_PI_B_PLUS"
3132
RASPBERRY_PI_A = "RASPBERRY_PI_A"
3233
RASPBERRY_PI_A_PLUS = "RASPBERRY_PI_A_PLUS"
@@ -40,6 +41,17 @@
4041
RASPBERRY_PI_3A_PLUS = "RASPBERRY_PI_3A_PLUS"
4142
# pylint: enable=bad-whitespace
4243

44+
_RASPBERRY_PI_40_PIN_IDS = (
45+
RASPBERRY_PI_B_PLUS,
46+
RASPBERRY_PI_A_PLUS,
47+
RASPBERRY_PI_ZERO,
48+
RASPBERRY_PI_ZERO_W,
49+
RASPBERRY_PI_2B,
50+
RASPBERRY_PI_3B,
51+
RASPBERRY_PI_3B_PLUS,
52+
RASPBERRY_PI_3A_PLUS
53+
)
54+
4355
_BEAGLEBONE_IDS = (
4456
BEAGLEBONE,
4557
BEAGLEBONE_BLACK,
@@ -58,17 +70,6 @@
5870
OSD3358_SM_RED,
5971
)
6072

61-
_RASPBERRY_PI_40_PIN_IDS = (
62-
RASPBERRY_PI_B_PLUS,
63-
RASPBERRY_PI_A_PLUS,
64-
RASPBERRY_PI_ZERO,
65-
RASPBERRY_PI_ZERO_W,
66-
RASPBERRY_PI_2B,
67-
RASPBERRY_PI_3B,
68-
RASPBERRY_PI_3B_PLUS,
69-
RASPBERRY_PI_3A_PLUS
70-
)
71-
7273
# BeagleBone eeprom board ids from:
7374
# https://github.com/beagleboard/image-builder
7475
# Thanks to zmatt on freenode #beagle for pointers.
@@ -138,7 +139,8 @@
138139
# https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
139140

140141
_PI_REV_CODES = {
141-
RASPBERRY_PI_B: ('0002', '0003', '0004', '0005', '0006', '000d', '000e', '000f'),
142+
RASPBERRY_PI_B_REV1: ('0002', '0003'),
143+
RASPBERRY_PI_B_REV2: ('0005', '0006', '000d', '000e', '000f'),
142144
RASPBERRY_PI_B_PLUS: ('0010', '0013', '900032'),
143145
RASPBERRY_PI_A: ('0007', '0008', '0009'),
144146
RASPBERRY_PI_A_PLUS: ('0012', '0015', '900021'),

0 commit comments

Comments
 (0)