summaryrefslogtreecommitdiff
path: root/tinyusb/class
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-11-30 22:29:37 +0700
committerhathach <[email protected]>2013-11-30 22:29:37 +0700
commit6e30a068d254fdd1367fffdf046b3c8783b8ee21 (patch)
tree6f3693d32404968578eb9d542cfa3e485a595a6d /tinyusb/class
parentaf87e231c53e8f22cb1c6caea6ad973cf9eb4e0c (diff)
completely change the dcd for lpc11u & lpc13u to overcome the fact that lpc11u dma cannot transfer more than 64 bytes
each buffer. This implement an soft DMA for lpc11u & lpc13u (previously 1023 max) queued transfer
Diffstat (limited to 'tinyusb/class')
-rw-r--r--tinyusb/class/msc_device.c2
-rw-r--r--tinyusb/class/msc_device.h6
2 files changed, 5 insertions, 3 deletions
diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c
index 2edc234f4..6fc36fc03 100644
--- a/tinyusb/class/msc_device.c
+++ b/tinyusb/class/msc_device.c
@@ -154,7 +154,7 @@ static bool read10_write10_data_xfer(mscd_interface_t* p_msc)
tusbd_msc_write10_cb(edpt_hdl.coreid, p_cbw->lun, &p_buffer, lba, block_count);
xferred_block = min16_of(xferred_block, block_count);
- uint16_t xferred_byte = xferred_block * (p_cbw->xfer_bytes / block_count);
+ uint16_t const xferred_byte = xferred_block * (p_cbw->xfer_bytes / block_count);
if ( 0 == xferred_block )
{ // xferred_block is zero will cause pipe is stalled & status in CSW set to failed
diff --git a/tinyusb/class/msc_device.h b/tinyusb/class/msc_device.h
index 9c2a5dd67..2919e68d6 100644
--- a/tinyusb/class/msc_device.h
+++ b/tinyusb/class/msc_device.h
@@ -63,12 +63,14 @@
void tusbd_msc_mounted_cb(uint8_t coreid);
void tusbd_msc_unmounted_cb(uint8_t coreid);
-// p_length [in,out] allocated/maximum length, application update with actual length
-msc_csw_status_t tusbd_msc_scsi_received_isr (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void ** pp_buffer, uint16_t* p_length);
+// return 0 will end up with stall transaction
uint16_t tusbd_msc_read10_cb (uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count) ATTR_WARN_UNUSED_RESULT;
uint16_t tusbd_msc_write10_cb(uint8_t coreid, uint8_t lun, void** pp_buffer, uint32_t lba, uint16_t block_count) ATTR_WARN_UNUSED_RESULT;
+// p_length [in,out] allocated/maximum length, application update with actual length
+msc_csw_status_t tusbd_msc_scsi_received_isr (uint8_t coreid, uint8_t lun, uint8_t scsi_cmd[16], void ** pp_buffer, uint16_t* p_length);
+
/** @} */
/** @} */