diff options
| author | hathach <[email protected]> | 2024-11-26 16:31:39 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2024-11-26 16:32:19 +0700 |
| commit | d9f3e7dd25973818d36831534612f3640e8ea241 (patch) | |
| tree | 9ff4ed53a9d1e10286fe433de95415b76d43b62a /examples | |
| parent | a5f9947a206962c82c6d3728b763b033d94b408a (diff) | |
add TUH_EPBUF_DEF for hid host
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/host/cdc_msc_hid_freertos/src/msc_app.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/host/cdc_msc_hid_freertos/src/msc_app.c b/examples/host/cdc_msc_hid_freertos/src/msc_app.c index 9ffd5d965..6b9cdab85 100644 --- a/examples/host/cdc_msc_hid_freertos/src/msc_app.c +++ b/examples/host/cdc_msc_hid_freertos/src/msc_app.c @@ -25,7 +25,10 @@ #include "tusb.h" -static scsi_inquiry_resp_t inquiry_resp; +// define the buffer to be place in USB/DMA memory with correct alignment/cache line size +CFG_TUH_MEM_SECTION static struct { + TUH_EPBUF_TYPE_DEF(scsi_inquiry_resp_t, inquiry); +} scsi_resp; void msc_app_init(void) { // nothing to do @@ -41,7 +44,7 @@ bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const *cb_dat } // Print out Vendor ID, Product ID and Rev - printf("%.8s %.16s rev %.4s\r\n", inquiry_resp.vendor_id, inquiry_resp.product_id, inquiry_resp.product_rev); + printf("%.8s %.16s rev %.4s\r\n", scsi_resp.inquiry.vendor_id, scsi_resp.inquiry.product_id, scsi_resp.inquiry.product_rev); // Get capacity of device uint32_t const block_count = tuh_msc_get_block_count(dev_addr, cbw->lun); @@ -58,7 +61,7 @@ void tuh_msc_mount_cb(uint8_t dev_addr) { printf("A MassStorage device is mounted\r\n"); uint8_t const lun = 0; - tuh_msc_inquiry(dev_addr, lun, &inquiry_resp, inquiry_complete_cb, 0); + tuh_msc_inquiry(dev_addr, lun, &scsi_resp.inquiry, inquiry_complete_cb, 0); } void tuh_msc_umount_cb(uint8_t dev_addr) { |
