@@ -65,7 +65,7 @@ def id(self):
65
65
66
66
try :
67
67
return os .environ ["BLINKA_FORCEBOARD" ]
68
- except KeyError : # no forced board, continue with testing!
68
+ except ( AttributeError , KeyError ) : # no forced board, continue with testing!
69
69
pass
70
70
71
71
chip_id = self .detector .chip .id
@@ -80,7 +80,7 @@ def id(self):
80
80
elif chip_id == chips .GENERIC_X86 :
81
81
board_id = boards .GENERIC_LINUX_PC
82
82
elif chip_id == chips .SUN8I :
83
- board_id = self ._armbian_id ()
83
+ board_id = self ._armbian_id () or self . _allwinner_variants_id ()
84
84
elif chip_id == chips .SAMA5 :
85
85
board_id = self ._sama5_id ()
86
86
elif chip_id == chips .IMX8MX :
@@ -93,6 +93,8 @@ def id(self):
93
93
board_id = boards .FEATHER_M0_EXPRESS
94
94
elif chip_id == chips .STM32F405 :
95
95
board_id = boards .PYBOARD
96
+ elif chip_id == chips .RP2040 :
97
+ board_id = boards .RASPBERRY_PI_PICO
96
98
elif chip_id == chips .S805 :
97
99
board_id = boards .ODROID_C1
98
100
elif chip_id == chips .S905 :
@@ -134,9 +136,9 @@ def id(self):
134
136
elif chip_id == chips .H6 :
135
137
board_id = self ._pine64_id ()
136
138
elif chip_id == chips .H5 :
137
- board_id = self ._armbian_id ()
139
+ board_id = self ._armbian_id () or self . _allwinner_variants_id ()
138
140
elif chip_id == chips .H616 :
139
- board_id = self ._armbian_id ()
141
+ board_id = self ._armbian_id () or self . _allwinner_variants_id ()
140
142
elif chip_id == chips .A33 :
141
143
board_id = self ._clockwork_pi_id ()
142
144
elif chip_id == chips .RK3308 :
@@ -432,6 +434,27 @@ def _asus_tinker_board_id(self):
432
434
board = boards ._ASUS_TINKER_BOARD_IDS
433
435
return board
434
436
437
+ def _allwinner_variants_id (self ):
438
+ """Try to detect the id of allwinner based board. (orangepi, nanopi)"""
439
+ board_value = self .detector .get_device_model ()
440
+ board = None
441
+ if not board_value :
442
+ return board
443
+ board_value = board_value .lower ()
444
+ chip_id = self .detector .chip .id
445
+ if "nanopi" in board_value :
446
+ if "neo" in board_value and "SUN8I" in chip_id :
447
+ board = boards .NANOPI_NEO_AIR
448
+ # TODO: Add other specifc board contexts here
449
+ elif "orange pi" in board_value :
450
+ if "zero" in board_value :
451
+ if "H5" in chip_id :
452
+ board = boards .ORANGE_PI_ZERO_PLUS_2H5
453
+ elif "H616" in chip_id :
454
+ board = boards .ORANGE_PI_ZERO_2
455
+ # TODO: Add other specifc board contexts here
456
+ return board
457
+
435
458
@property
436
459
def any_nanopi (self ):
437
460
"""Check whether the current board is any defined Nano Pi."""
0 commit comments