File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
ports/raspberrypi/common-hal/usb_host Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ static size_t get_usb_pio(void) {
114114
115115
116116usb_host_port_obj_t * common_hal_usb_host_port_construct (const mcu_pin_obj_t * dp , const mcu_pin_obj_t * dm ) {
117- if (dp -> number + 1 != dm -> number ) {
117+ if ((dp -> number + 1 != dm -> number )
118+ && (dp -> number - 1 != dm -> number )) {
118119 raise_ValueError_invalid_pins ();
119120 }
120121 usb_host_port_obj_t * self = & usb_host_instance ;
@@ -133,6 +134,8 @@ usb_host_port_obj_t *common_hal_usb_host_port_construct(const mcu_pin_obj_t *dp,
133134 pio_usb_configuration_t pio_cfg = PIO_USB_DEFAULT_CONFIG ;
134135 pio_cfg .skip_alarm_pool = true;
135136 pio_cfg .pin_dp = dp -> number ;
137+ if (dp -> number - 1 == dm -> number ) {
138+ pio_cfg .pinout = PIO_USB_PINOUT_DMDP ;
136139 }
137140 pio_cfg .pio_tx_num = get_usb_pio ();
138141 pio_cfg .pio_rx_num = pio_cfg .pio_tx_num ;
You can’t perform that action at this time.
0 commit comments