From 30144d6da378c269215be4d6f4fff1a02d56e378 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Wed, 6 Oct 2021 14:50:52 -0400 Subject: [PATCH 1/3] add MacroPad RP2040 --- adafruit_platformdetect/board.py | 8 ++++++++ adafruit_platformdetect/chip.py | 3 ++- adafruit_platformdetect/constants/boards.py | 1 + bin/detect.py | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index cef6b0c8..64a9e10b 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -488,6 +488,9 @@ def _rp2040_u2if_id(self): # QT2040 Trinkey if product == 0x0109: return boards.QT2040_TRINKEY_U2IF + # MacroPad RP2040 (NEEDS NEW PID) + if product == 0x0000: + return boards.MACROPAD_U2IF # Will only reach here if a device was added in chip.py but here. raise RuntimeError("RP2040_U2IF device was added to chip but not board.") @@ -654,6 +657,11 @@ def itsybitsy_u2if(self): """Check whether the current board is a Itsy Bitsy w/ u2if.""" return self.id == boards.ITSYBITSY_U2IF + @property + def macropad_u2if(self): + """Check whether the current board is a MacroPad w/ u2if.""" + return self.id == boards.MACROPAD_U2IF + @property def qtpy_u2if(self): """Check whether the current board is a QT Py w/ u2if.""" diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 3d3fd767..45ec1904 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -126,8 +126,9 @@ def id( # Itsy Bitsy RP2040 # QT Py RP2040 # QT2040 Trinkey + # MacroPad RP2040 (NEEDS NEW PID) vendor == 0x239A - and product in (0x00F1, 0x00FD, 0x00F7, 0x0109) + and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0000) ): self._chip_id = chips.RP2040_U2IF return self._chip_id diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 8b0ec333..fdcdd085 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -120,6 +120,7 @@ PICO_U2IF = "PICO_U2IF" FEATHER_U2IF = "FEATHER_U2IF" ITSYBITSY_U2IF = "ITSYBITSY_U2IF" +MACROPAD_U2IF = "MACROPAD_U2IF" QTPY_U2IF = "QTPY_U2IF" QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF" diff --git a/bin/detect.py b/bin/detect.py index 42d07b6c..682166d9 100644 --- a/bin/detect.py +++ b/bin/detect.py @@ -37,6 +37,7 @@ | detector.board.PICO_U2IF | detector.board.FEATHER_U2IF | detector.board.ITSYBITY_U2IF + | detector.board.MACROPAD_U2IF | detector.board.QTPY_U2IF | detector.board.QT2040_TRINKEY_U2IF, ) From 2c46b7d4e7877f5fbd632bdeff5f2b9b917e041d Mon Sep 17 00:00:00 2001 From: John Furcean Date: Wed, 6 Oct 2021 19:17:52 -0400 Subject: [PATCH 2/3] update macropad PID --- adafruit_platformdetect/board.py | 4 ++-- adafruit_platformdetect/chip.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 64a9e10b..30412f2e 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -488,8 +488,8 @@ def _rp2040_u2if_id(self): # QT2040 Trinkey if product == 0x0109: return boards.QT2040_TRINKEY_U2IF - # MacroPad RP2040 (NEEDS NEW PID) - if product == 0x0000: + # MacroPad RP2040 + if product == 0x0107: return boards.MACROPAD_U2IF # Will only reach here if a device was added in chip.py but here. raise RuntimeError("RP2040_U2IF device was added to chip but not board.") diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 45ec1904..b5375bc8 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -128,7 +128,7 @@ def id( # QT2040 Trinkey # MacroPad RP2040 (NEEDS NEW PID) vendor == 0x239A - and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0000) + and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0107) ): self._chip_id = chips.RP2040_U2IF return self._chip_id From 881dddc7bee2fbb5b8b9d6ade781a40f5c877165 Mon Sep 17 00:00:00 2001 From: John Furcean Date: Thu, 14 Oct 2021 08:18:40 -0400 Subject: [PATCH 3/3] fix comment --- adafruit_platformdetect/chip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index b5375bc8..b633c974 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -126,7 +126,7 @@ def id( # Itsy Bitsy RP2040 # QT Py RP2040 # QT2040 Trinkey - # MacroPad RP2040 (NEEDS NEW PID) + # MacroPad RP2040 vendor == 0x239A and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0107) ):