mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
commit
582e5dbac5
@ -65,10 +65,12 @@ MKDIR = mkdir
|
|||||||
ifeq ($(CMDEXE),1)
|
ifeq ($(CMDEXE),1)
|
||||||
CP = copy
|
CP = copy
|
||||||
RM = del
|
RM = del
|
||||||
|
PYTHON = python
|
||||||
else
|
else
|
||||||
SED = sed
|
SED = sed
|
||||||
CP = cp
|
CP = cp
|
||||||
RM = rm
|
RM = rm
|
||||||
|
PYTHON = python3
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#-------------- Source files and compiler flags --------------
|
#-------------- Source files and compiler flags --------------
|
||||||
|
@ -70,4 +70,5 @@ $(BUILD)/$(PROJECT).spk: $(MKSPK)
|
|||||||
|
|
||||||
# flash
|
# flash
|
||||||
flash: $(BUILD)/$(PROJECT).spk
|
flash: $(BUILD)/$(PROJECT).spk
|
||||||
@$(TOP)/hw/mcu/sony/cxd56/tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $<
|
@echo FLASH $<
|
||||||
|
@$(PYTHON) $(TOP)/hw/mcu/sony/cxd56/tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $<
|
||||||
|
@ -601,16 +601,27 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
|
|||||||
// skip status if epin is currently stalled, will do it when received Clear Stall request
|
// skip status if epin is currently stalled, will do it when received Clear Stall request
|
||||||
if ( !usbd_edpt_stalled(rhport, p_msc->ep_in) )
|
if ( !usbd_edpt_stalled(rhport, p_msc->ep_in) )
|
||||||
{
|
{
|
||||||
if ( (p_msc->total_len > p_msc->xferred_len) && is_data_in(p_cbw->dir) )
|
if ( (p_cbw->total_bytes > p_msc->xferred_len) && is_data_in(p_cbw->dir) )
|
||||||
{
|
{
|
||||||
// 6.7 The 13 Cases: case 5 (Hi > Di): STALL before status
|
// 6.7 The 13 Cases: case 5 (Hi > Di): STALL before status
|
||||||
TU_LOG(MSC_DEBUG, " SCSI case 5 (Hi > Di): %lu > %lu\r\n", p_msc->total_len, p_msc->xferred_len);
|
TU_LOG(MSC_DEBUG, " SCSI case 5 (Hi > Di): %lu > %lu\r\n", p_cbw->total_bytes, p_msc->xferred_len);
|
||||||
usbd_edpt_stall(rhport, p_msc->ep_in);
|
usbd_edpt_stall(rhport, p_msc->ep_in);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
TU_ASSERT( send_csw(rhport, p_msc) );
|
TU_ASSERT( send_csw(rhport, p_msc) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if TU_CHECK_MCU(CXD56)
|
||||||
|
// WORKAROUND: cxd56 has its own nuttx usb stack which does not forward Set/ClearFeature(Endpoint) to DCD.
|
||||||
|
// There is no way for us to know when EP is un-stall, therefore we will unconditionally un-stall here and
|
||||||
|
// hope everything will work
|
||||||
|
if ( usbd_edpt_stalled(rhport, p_msc->ep_in) )
|
||||||
|
{
|
||||||
|
usbd_edpt_clear_stall(rhport, p_msc->ep_in);
|
||||||
|
send_csw(rhport, p_msc);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user