Skip to content

Commit 4769224

Browse files
authored
Merge pull request #185 from jfurcean/add_macropad_rp2040
Add MacroPad RP2040 u2if Detection
2 parents 9a75043 + 881dddc commit 4769224

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

adafruit_platformdetect/board.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,9 @@ def _rp2040_u2if_id(self):
488488
# QT2040 Trinkey
489489
if product == 0x0109:
490490
return boards.QT2040_TRINKEY_U2IF
491+
# MacroPad RP2040
492+
if product == 0x0107:
493+
return boards.MACROPAD_U2IF
491494
# Will only reach here if a device was added in chip.py but here.
492495
raise RuntimeError("RP2040_U2IF device was added to chip but not board.")
493496

@@ -654,6 +657,11 @@ def itsybitsy_u2if(self):
654657
"""Check whether the current board is a Itsy Bitsy w/ u2if."""
655658
return self.id == boards.ITSYBITSY_U2IF
656659

660+
@property
661+
def macropad_u2if(self):
662+
"""Check whether the current board is a MacroPad w/ u2if."""
663+
return self.id == boards.MACROPAD_U2IF
664+
657665
@property
658666
def qtpy_u2if(self):
659667
"""Check whether the current board is a QT Py w/ u2if."""

adafruit_platformdetect/chip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ def id(
126126
# Itsy Bitsy RP2040
127127
# QT Py RP2040
128128
# QT2040 Trinkey
129+
# MacroPad RP2040
129130
vendor == 0x239A
130-
and product in (0x00F1, 0x00FD, 0x00F7, 0x0109)
131+
and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0107)
131132
):
132133
self._chip_id = chips.RP2040_U2IF
133134
return self._chip_id

adafruit_platformdetect/constants/boards.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
PICO_U2IF = "PICO_U2IF"
121121
FEATHER_U2IF = "FEATHER_U2IF"
122122
ITSYBITSY_U2IF = "ITSYBITSY_U2IF"
123+
MACROPAD_U2IF = "MACROPAD_U2IF"
123124
QTPY_U2IF = "QTPY_U2IF"
124125
QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF"
125126

bin/detect.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
| detector.board.PICO_U2IF
3838
| detector.board.FEATHER_U2IF
3939
| detector.board.ITSYBITY_U2IF
40+
| detector.board.MACROPAD_U2IF
4041
| detector.board.QTPY_U2IF
4142
| detector.board.QT2040_TRINKEY_U2IF,
4243
)

0 commit comments

Comments
 (0)