]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
lint1
authorcaternuson <caternuson@gmail.com>
Fri, 21 May 2021 22:53:16 +0000 (15:53 -0700)
committercaternuson <caternuson@gmail.com>
Fri, 21 May 2021 22:53:16 +0000 (15:53 -0700)
src/adafruit_blinka/board/feather_u2if.py
src/adafruit_blinka/board/itsybitsy_u2if.py
src/adafruit_blinka/board/qt2040_trinkey_u2if.py
src/adafruit_blinka/board/qtpy_u2if.py
src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py

index c02864ce2bfafe3f8a0db7cb51ad0d8138e8d4f2..a6ba7596a77d973f5a9b7b5b83e512293dffad6e 100644 (file)
@@ -1,6 +1,6 @@
-"""Pin definitions for the Feather RP2040 with u2if firmware."""
-
 """
+Pin definitions for the Feather RP2040 with u2if firmware.
+
 Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040
 >>> import board
 >>> board.
@@ -41,4 +41,5 @@ MOSI = pin.GP19
 MISO = pin.GP20
 
 # access u2if via pin instance to open for specifc VID/PID
+# pylint:disable = protected-access
 pin.GP0._u2if_open_hid(0x239A, 0x00F1)
index 952847f2688fff04ca476656b0c92ef08ab031ea..c13d24cd60f401de6084ccb558aa101748e66ec3 100644 (file)
@@ -1,6 +1,6 @@
-"""Pin definitions for the ItsyBitsy RP2040 with u2if firmware."""
-
 """
+Pin definitions for the ItsyBitsy RP2040 with u2if firmware.
+
 Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit ItsyBitsy RP2040 with rp2040
 >>> import board
 >>> board.
@@ -50,4 +50,5 @@ NEOPIXEL_POWER = pin.GP16
 BUTTON = pin.GP13
 
 # access u2if via pin instance to open for specifc VID/PID
+# pylint:disable = protected-access
 pin.GP0._u2if_open_hid(0x239A, 0x00FD)
index d48b71b4bd81189ba44630376e265a210efea2b9..d71bea8c87dbfb33951885f88f3768f1060fcf6d 100644 (file)
@@ -10,4 +10,5 @@ SDA = pin.GP16
 NEOPIXEL = pin.GP27
 
 # access u2if via pin instance to open for specifc VID/PID
+# pylint:disable = protected-access
 pin.GP0._u2if_open_hid(0x239A, 0x0109)
index 76e2c869c92e05b3e12699af58906cc25aa5f83f..569ace2387df330558e3e77987e6aaae26ecfd2b 100644 (file)
@@ -1,6 +1,6 @@
-"""Pin definitions for the QT Py RP2040 with u2if firmware."""
-
 """
+Pin definitions for the QT Py RP2040 with u2if firmware.
+
 Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit QTPy RP2040 with rp2040
 >>> import board
 >>> board.
@@ -50,4 +50,5 @@ NEOPIXEL_POWER = pin.GP11
 BUTTON = pin.GP21
 
 # access u2if via pin instance to open for specifc VID/PID
+# pylint:disable = protected-access
 pin.GP0._u2if_open_hid(0x239A, 0x00F7)
index 96a06b4e2b24f0b005e5258b4745e08dcf2efbe6..6431f94482f0906b5aabf24856af74e8df9ed16a 100644 (file)
@@ -68,22 +68,15 @@ class RP2040_u2if:
     PWM_GET_DUTY_NS = 0x37
 
     def __init__(self):
+        self._vid = None
+        self._pid = None
+        self._hid = None
         self._opened = False
         self._i2c_index = None
         self._spi_index = None
         self._serial = None
         self._neopixel_initialized = False
-        # self._vid = vid
-        # self._pid = pid
-        # self._hid = hid.device()
-        # self._hid.open(self._vid, self._pid)
-        # if RP2040_U2IF_RESET_DELAY >= 0:
-        #     self._reset()
-        # self._i2c_index = None
-        # self._spi_index = None
-        # self._serial = None
-        # self._neopixel_initialized = False
-        # self._uart_rx_buffer = None
+        self._uart_rx_buffer = None
 
     def _hid_xfer(self, report, response=True):
         """Perform HID Transfer"""
@@ -113,6 +106,8 @@ class RP2040_u2if:
     # MISC
     # ----------------------------------------------------------------
     def open(self, vid, pid):
+        """Open HID interface for given USB VID and PID."""
+
         if self._opened:
             return
         self._vid = vid