X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/050c6e5bdbe0d75d4b0f053addb368421835a3a7..03c4bc1d41655d8e73ff89039b2a8ec34b3649ca:/src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py diff --git a/src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py b/src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py index 995d14c..96a06b4 100644 --- a/src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py +++ b/src/adafruit_blinka/microcontroller/rp2040_u2if/rp2040_u2if.py @@ -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()