add TUD_ to HID_REPORT_DESC_* template

This commit is contained in:
hathach
2019-04-28 00:43:36 +07:00
parent 25bd3fef47
commit 89ace295ba
5 changed files with 19 additions and 15 deletions

View File

@@ -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);
}