micropython icon indicating copy to clipboard operation
micropython copied to clipboard

renesas-ra/usb: Use interrupt rather than polling for usb task.

Open andrewleech opened this issue 1 year ago • 2 comments

Summary

Most ports using TinyUSB now service the usb tasks from the usb interrupt. Based on issues reported in https://github.com/micropython/micropython/pull/14462#issuecomment-2251555449 I noticed the renesas port was still using the older polling pattern for this.

A quick test on a "EK-RA4W1 with usb cable patched on" I've got showed that the interrupt wrap approach appears to work correctly here, so submitted this change.

Testing

So far just flashing this change to "EK-RA4W1 with usb cable patched on" and tested that repl is still available in mpremote

The board I have uses the renesas full-speed peripheral, this change has not been tested on renesas board with high-speed usb.

andrewleech avatar Jul 26 '24 00:07 andrewleech

@andrewleech I finally had a chance to test this and USB is working fine with this change.

iabdalkader avatar Aug 26 '24 08:08 iabdalkader

That's great thanks @iabdalkader

andrewleech avatar Aug 26 '24 09:08 andrewleech

Thanks @andrewleech, it's good to make all TinyUSB ports use the same mechanism.

And thanks to @iabdalkader for testing.

dpgeorge avatar Sep 26 '24 07:09 dpgeorge