diff options
| author | hathach <[email protected]> | 2019-04-26 15:54:42 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-04-26 15:54:42 +0700 |
| commit | b74eca4f120ae0d17c4c583d6b865f507f48996a (patch) | |
| tree | 4c58e8b5d19cd453c6d851dda42895f8d0ed652e /src/class/msc/msc_device.c | |
| parent | 99f4c061976349221f62b51a8897528288f6a2cc (diff) | |
add msc multiple lun support
- remove CFG_TUD_MSC_MAXLUN
- add tud_msc_maxlun_cb()
- add msc_dual_lun exmaple
Diffstat (limited to 'src/class/msc/msc_device.c')
| -rw-r--r-- | src/class/msc/msc_device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c index a6b65557c..e2cf92324 100644 --- a/src/class/msc/msc_device.c +++ b/src/class/msc/msc_device.c @@ -163,8 +163,10 @@ bool mscd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque case MSC_REQ_GET_MAX_LUN:
{
- // returned MAX LUN is minus 1 by specs
- uint8_t maxlun = CFG_TUD_MSC_MAXLUN-1;
+ // MAX LUN is minus 1 by specs
+ uint8_t maxlun = 0;
+ if (tud_msc_maxlun_cb) maxlun = tud_msc_maxlun_cb() -1;
+
usbd_control_xfer(rhport, p_request, &maxlun, 1);
}
break;
|
