Merge pull request #353 from brentru/add-agnostic-board

Add support for OS-agnostic board (CI runner)
This commit is contained in:
Melissa LeBlanc-Williams 2024-05-31 11:52:04 -07:00 committed by GitHub
commit b8c5355145
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 0 deletions

View file

@ -65,6 +65,8 @@ class Board:
board_id = self._armbian_id() or self._allwinner_variants_id()
elif chip_id == chips.BCM2XXX:
board_id = self._pi_id()
elif chip_id == chips.OS_AGNOSTIC:
board_id = boards.OS_AGNOSTIC_BOARD
elif chip_id == chips.AM625X:
board_id = self._beaglebone_id()
elif chip_id == chips.AM33XX:
@ -1036,6 +1038,7 @@ class Board:
yield self.board.QTPY_U2IF
yield self.board.QT2040_TRINKEY_U2IF
yield self.board.KB2040_U2IF
yield self.board.OS_AGNOSTIC_BOARD
return any(condition for condition in lazily_generate_conditions())
@ -1105,6 +1108,11 @@ class Board:
"""Check whether the current board is a Microchip MCP2221."""
return self.id == boards.MICROCHIP_MCP2221
@property
def os_agnostic_board(self) -> bool:
"""Check whether the current board is an OS agnostic special case."""
return self.id == boards.OS_AGNOSTIC_BOARD
@property
def pico_u2if(self) -> bool:
"""Check whether the current board is a RPi Pico w/ u2if."""

View file

@ -98,6 +98,10 @@ class Chip:
"BLINKA_MCP2221 environment variable "
+ "set, but no MCP2221 device found"
)
if os.environ.get("BLINKA_OS_AGNOSTIC"):
# we don't need to look for this chip, it's just a flag
self._chip_id = chips.OS_AGNOSTIC
return self._chip_id
if os.environ.get("BLINKA_U2IF"):
import hid

View file

@ -596,3 +596,6 @@ _LUCKFOX_IDS = (
LUCKFOX_PICO_MAX,
LUCKFOX_PICO_MINI,
)
# Agnostic board
OS_AGNOSTIC_BOARD = "OS_AGNOSTIC_BOARD"

View file

@ -4,6 +4,7 @@
"""Definition of chips."""
A311D = "A311D"
OS_AGNOSTIC = "OS_AGNOSTIC"
AM33XX = "AM33XX"
AM625X = "AM625X"
AM65XX = "AM65XX"