File tree 1 file changed +4
-1
lines changed
ports/raspberrypi/common-hal/usb_host 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) {
114
114
115
115
116
116
usb_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 )) {
118
119
raise_ValueError_invalid_pins ();
119
120
}
120
121
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,
133
134
pio_usb_configuration_t pio_cfg = PIO_USB_DEFAULT_CONFIG ;
134
135
pio_cfg .skip_alarm_pool = true;
135
136
pio_cfg .pin_dp = dp -> number ;
137
+ if (dp -> number - 1 == dm -> number ) {
138
+ pio_cfg .pinout = PIO_USB_PINOUT_DMDP ;
136
139
}
137
140
pio_cfg .pio_tx_num = get_usb_pio ();
138
141
pio_cfg .pio_rx_num = pio_cfg .pio_tx_num ;
You can’t perform that action at this time.
0 commit comments