summaryrefslogtreecommitdiff
path: root/src/class/msc/msc_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-04-28 00:43:36 +0700
committerhathach <[email protected]>2019-04-28 00:43:36 +0700
commit89ace295ba2b509dcb42d3df9501134df968c2f4 (patch)
tree9f8102583f6a8e8a559b527ab1afd0417af10f22 /src/class/msc/msc_device.c
parent25bd3fef47114bba845d3dbf397a50efb0ee777c (diff)
add TUD_ to HID_REPORT_DESC_* template
Diffstat (limited to 'src/class/msc/msc_device.c')
-rw-r--r--src/class/msc/msc_device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/class/msc/msc_device.c b/src/class/msc/msc_device.c
index e2cf92324..360503d9b 100644
--- a/src/class/msc/msc_device.c
+++ b/src/class/msc/msc_device.c
@@ -163,9 +163,12 @@ bool mscd_control_request(uint8_t rhport, tusb_control_request_t const * p_reque
case MSC_REQ_GET_MAX_LUN:
{
+ uint8_t maxlun = 1;
+ if (tud_msc_maxlun_cb) maxlun = tud_msc_maxlun_cb();
+ TU_VERIFY(maxlun);
+
// MAX LUN is minus 1 by specs
- uint8_t maxlun = 0;
- if (tud_msc_maxlun_cb) maxlun = tud_msc_maxlun_cb() -1;
+ maxlun--;
usbd_control_xfer(rhport, p_request, &maxlun, 1);
}