@@ -162,7 +162,11 @@ static void write_ep_ctrl_reg(const struct device *dev, const uint8_t ep,
162
162
163
163
static void rpi_pico_ep_cancel (const struct device * dev , const uint8_t ep )
164
164
{
165
- bool abort_handshake_supported = rp2040_chip_version () >= 2 ;
165
+ #ifdef CONFIG_SOC_SERIES_RP2040
166
+ const bool abort_handshake_supported = rp2040_chip_version () >= 2 ;
167
+ #else
168
+ const bool abort_handshake_supported = true;
169
+ #endif
166
170
const struct rpi_pico_config * config = dev -> config ;
167
171
usb_hw_t * base = config -> base ;
168
172
mm_reg_t abort_done_reg = (mm_reg_t )& base -> abort_done ;
@@ -177,8 +181,10 @@ static void rpi_pico_ep_cancel(const struct device *dev, const uint8_t ep)
177
181
}
178
182
179
183
if (abort_handshake_supported ) {
184
+ rpi_pico_bit_clr (abort_done_reg , ep_mask );
180
185
rpi_pico_bit_set (abort_reg , ep_mask );
181
186
while ((sys_read32 (abort_done_reg ) & ep_mask ) != ep_mask ) {
187
+ rpi_pico_bit_set (abort_reg , ep_mask );
182
188
}
183
189
}
184
190
@@ -187,6 +193,7 @@ static void rpi_pico_ep_cancel(const struct device *dev, const uint8_t ep)
187
193
188
194
if (abort_handshake_supported ) {
189
195
rpi_pico_bit_clr (abort_reg , ep_mask );
196
+ rpi_pico_bit_clr (abort_done_reg , ep_mask );
190
197
}
191
198
192
199
LOG_INF ("Canceled ep 0x%02x transaction" , ep );
0 commit comments