File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/portable/renesas/usba Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -765,19 +765,17 @@ bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr)
765
765
{
766
766
uint16_t volatile * ctr = addr_to_pipectr (dev_addr , ep_addr );
767
767
TU_ASSERT (ctr );
768
+
769
+ const uint32_t pid = * ctr & 0x3 ;
770
+ if (pid & 2 ) {
771
+ * ctr = pid & 2 ;
772
+ * ctr = 0 ;
773
+ }
768
774
* ctr = USB_PIPECTR_SQCLR ;
769
775
unsigned const epn = tu_edpt_number (ep_addr );
770
776
if (!epn ) return true;
771
777
772
- if (tu_edpt_dir (ep_addr )) { /* IN */
773
- const unsigned num = _hcd .ep [dev_addr - 1 ][1 ][epn - 1 ];
774
- hcd_int_disable (0 );
775
- USB0 .PIPESEL .WORD = num ;
776
- if (USB0 .PIPECFG .BIT .TYPE != 1 ) {
777
- * ctr = USB_PIPECTR_PID_BUF ;
778
- }
779
- hcd_int_enable (0 );
780
- } else {
778
+ if (!tu_edpt_dir (ep_addr )) { /* OUT */
781
779
* ctr = USB_PIPECTR_PID_BUF ;
782
780
}
783
781
return true;
You can’t perform that action at this time.
0 commit comments