Skip to content

Commit f295aaf

Browse files
committed
add hcd abort xfer for rp2040 pio usb
1 parent c122e9d commit f295aaf

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

hw/bsp/rp2040/board.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@
5454
// default to pin on Adafruit Feather rp2040 USB Host or Tester if defined
5555
//--------------------------------------------------------------------+
5656

57-
// #define USE_ADAFRUIT_RP2040_TESTER
58-
#ifdef USE_ADAFRUIT_RP2040_TESTER
59-
#define PICO_DEFAULT_PIO_USB_DP_PIN 20
60-
#define PICO_DEFAULT_PIO_USB_VBUSEN_PIN 22
57+
// #define USE_ADAFRUIT_FEATHER_RP2040_USBHOST
58+
#ifdef USE_ADAFRUIT_FEATHER_RP2040_USBHOST
59+
#define PICO_DEFAULT_PIO_USB_DP_PIN 16
60+
#define PICO_DEFAULT_PIO_USB_VBUSEN_PIN 18
6161
#endif
6262

6363
#ifndef PICO_DEFAULT_PIO_USB_DP_PIN
64-
#define PICO_DEFAULT_PIO_USB_DP_PIN 16
64+
#define PICO_DEFAULT_PIO_USB_DP_PIN 20
6565
#endif
6666

6767
// VBUS enable pin and its active state
6868
#ifndef PICO_DEFAULT_PIO_USB_VBUSEN_PIN
69-
#define PICO_DEFAULT_PIO_USB_VBUSEN_PIN 18
69+
#define PICO_DEFAULT_PIO_USB_VBUSEN_PIN 22
7070
#endif
7171

7272
// VBUS enable state

src/portable/raspberrypi/pio_usb/hcd_pio_usb.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,8 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t *
139139
}
140140

141141
bool hcd_edpt_abort_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr) {
142-
(void) rhport;
143-
(void) dev_addr;
144-
(void) ep_addr;
145-
// TODO not implemented yet
146-
return false;
142+
uint8_t const pio_rhport = RHPORT_PIO(rhport);
143+
return pio_usb_host_endpoint_abort_transfer(pio_rhport, dev_addr, ep_addr);
147144
}
148145

149146
bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8])

tools/get_deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
'950819b7de9b32f92c3edf396bc5ffb8d66e7009',
5555
'kinetis_k32l2 kinetis_kl lpc51 lpc54 lpc55 mcx imxrt'],
5656
'hw/mcu/raspberry_pi/Pico-PIO-USB': ['https://github.com/sekigon-gonnoc/Pico-PIO-USB.git',
57-
'58879cfa0eca5725d8db6443ec17f8896a321042',
57+
'd00a10a8c425d0d40f81b87169102944b01f3bb3',
5858
'rp2040'],
5959
'hw/mcu/renesas/fsp': ['https://github.com/renesas/fsp.git',
6060
'8dc14709f2a6518b43f71efad70d900b7718d9f1',

0 commit comments

Comments
 (0)