Skip to content

Commit 53ca17e

Browse files
committed
add agnostic files
1 parent 55c52a3 commit 53ca17e

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,7 @@ def lazily_generate_conditions():
10241024
yield self.board.QTPY_U2IF
10251025
yield self.board.QT2040_TRINKEY_U2IF
10261026
yield self.board.KB2040_U2IF
1027+
yield self.board.OS_AGNOSTIC_BOARD
10271028

10281029
return any(condition for condition in lazily_generate_conditions())
10291030

@@ -1093,6 +1094,11 @@ def microchip_mcp2221(self) -> bool:
10931094
"""Check whether the current board is a Microchip MCP2221."""
10941095
return self.id == boards.MICROCHIP_MCP2221
10951096

1097+
@property
1098+
def os_agnostic_board(self) -> bool:
1099+
"""Check whether the current board is an OS agnostic special case."""
1100+
return self.id == boards.OS_AGNOSTIC_BOARD
1101+
10961102
@property
10971103
def pico_u2if(self) -> bool:
10981104
"""Check whether the current board is a RPi Pico w/ u2if."""

adafruit_platformdetect/chip.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def id(
9898
"BLINKA_MCP2221 environment variable "
9999
+ "set, but no MCP2221 device found"
100100
)
101+
if os.environ.get("BLINKA_OS_AGNOSTIC"):
102+
# we don't need to look for this chip, it's just a flag
103+
self._chip_id = chips.OS_AGNOSTIC
104+
return self._chip_id
101105
if os.environ.get("BLINKA_U2IF"):
102106
import hid
103107

adafruit_platformdetect/constants/boards.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,3 +588,6 @@
588588

589589
# Luckfox
590590
_LUCKFOX_IDS = (LUCKFOX_PICO_MAX,)
591+
592+
# Agnostic board
593+
OS_AGNOSTIC_BOARD = "OS_AGNOSTIC_BOARD"

adafruit_platformdetect/constants/chips.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
"""Definition of chips."""
66
A311D = "A311D"
7+
OS_AGNOSTIC = "OS_AGNOSTIC"
78
AM33XX = "AM33XX"
89
AM625X = "AM625X"
910
AM65XX = "AM65XX"

0 commit comments

Comments
 (0)