]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py
black
[Adafruit_Blinka-hackapet.git] / src / adafruit_blinka / microcontroller / rp2040_u2if / rp2040_u2if.py
index 995d14c89bafc644bec00fc949c0106ebd99822d..96a06b4e2b24f0b005e5258b4745e08dcf2efbe6 100644 (file)
@@ -380,7 +380,6 @@ class RP2040_u2if:
     # ----------------------------------------------------------------
     def neopixel_write(self, gpio, buf):
         """NeoPixel write."""
-        print("open serial")
         # open serial (data is sent over this)
         if self._serial is None:
             import serial
@@ -394,7 +393,6 @@ class RP2040_u2if:
         if self._serial is None:
             raise RuntimeError("Could not find Pico com port.")
 
-        print("init")
         # init
         if not self._neopixel_initialized:
             # deinit any current setup
@@ -415,7 +413,6 @@ class RP2040_u2if:
 
         self._serial.reset_output_buffer()
 
-        print("write")
         # write
         # command is done over HID
         remain_bytes = len(buf)
@@ -430,28 +427,22 @@ class RP2040_u2if:
                     "Neopixel write error : too many pixel for the firmware."
                 )
             elif resp[2] == 0x02:
-                print(resp[0:10])
                 raise RuntimeError(
                     "Neopixel write error : transfer already in progress."
                 )
             else:
                 raise RuntimeError("Neopixel write error.")
-        print("write 1")
         # buffer is sent over serial
         self._serial.write(buf)
         # hack (see u2if)
-        print("write 2")
         if len(buf) % 64 == 0:
             self._serial.write([0])
         self._serial.flush()
         # polling loop to wait for write complete?
-        print("write 3")
         time.sleep(0.1)
         resp = self._hid.read(64)
-        print("write 4")
         while resp[0] != self.WS2812B_WRITE:
             resp = self._hid.read(64)
-        print("write 5")
         if resp[1] != self.RESP_OK:
             raise RuntimeError("Neopixel write (flush) error.")
 
@@ -515,4 +506,5 @@ class RP2040_u2if:
         if resp[1] != self.RESP_OK:
             raise RuntimeError("PWM set duty cycle error.")
 
+
 rp2040_u2if = RP2040_u2if()