File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 46
46
RASPBERRY_PI_3B_PLUS
47
47
)
48
48
49
+ ANY_RASPBERRY_PI_40PIN = (
50
+ RASPBERRY_PI_B_PLUS ,
51
+ RASPBERRY_PI_A_PLUS ,
52
+ RASPBERRY_PI_ZERO ,
53
+ RASPBERRY_PI_ZERO_W ,
54
+ RASPBERRY_PI_2B ,
55
+ RASPBERRY_PI_3B ,
56
+ RASPBERRY_PI_3B_PLUS ,
57
+ RASPBERRY_PI_3A_PLUS
58
+ )
59
+
49
60
# BeagleBone eeprom board ids from:
50
61
# https://github.com/beagleboard/image-builder
51
62
# Thanks to zmatt on freenode #beagle for pointers.
@@ -219,6 +230,11 @@ def any_raspberry_pi_2_or_3(self):
219
230
"""Check whether the current board is any Raspberry Pi 2 or 3."""
220
231
return self .id in ANY_RASPBERRY_PI_2_OR_3
221
232
233
+ @property
234
+ def any_raspberry_pi_40pin (self ):
235
+ """Check whether the current board is any 40-pin Raspberry Pi."""
236
+ return self .id in ANY_RASPBERRY_PI_40PIN
237
+
222
238
def __getattr__ (self , attr ):
223
239
"""
224
240
Detect whether the given attribute is the currently-detected board. See list
Original file line number Diff line number Diff line change 9
9
print ("Board id: " , detector .board .id )
10
10
11
11
print ("Is this a Pi 3B+?" , detector .board .RASPBERRY_PI_3B_PLUS )
12
+ print ("Is this a 40-pin Raspberry Pi?" , detector .board .any_raspberry_pi_40pin )
12
13
print ("Is this a BBB?" , detector .board .BEAGLEBONE_BLACK )
13
14
print ("Is this an Orange Pi PC?" , detector .board .ORANGE_PI_PC )
14
15
print ("Is this a generic Linux PC?" , detector .board .GENERIC_LINUX_PC )
You can’t perform that action at this time.
0 commit comments