@@ -353,7 +353,9 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y
353
353
HID_COLLECTION_END \
354
354
355
355
// FIDO U2F Authenticator Descriptor Template
356
- #define TUD_HID_REPORT_DESC_FIDO_U2F (...) \
356
+ // - 1st parameter is report size, which is 64 bytes maximum in U2F
357
+ // - 2nd parameter is HID_REPORT_ID(n) (optional)
358
+ #define TUD_HID_REPORT_DESC_FIDO_U2F (report_size , ...) \
357
359
HID_USAGE_PAGE_N ( HID_USAGE_PAGE_FIDO_ALLIANCE , 2 ) ,\
358
360
HID_USAGE ( HID_USAGE_FIDO_U2F_AUTHENTICATOR_DEVICE ) ,\
359
361
HID_COLLECTION ( HID_COLLECTION_APPLICATION ) ,\
@@ -362,16 +364,16 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y
362
364
/* Usage Data In */ \
363
365
HID_USAGE ( HID_USAGE_FIDO_INPUT_REPORT_DATA ) ,\
364
366
HID_LOGICAL_MIN ( 0 ) ,\
365
- HID_LOGICAL_MAX_N ( 255 , 2 ) ,\
367
+ HID_LOGICAL_MAX_N ( 0xff , 2 ) ,\
366
368
HID_REPORT_SIZE ( 8 ) ,\
367
- HID_REPORT_COUNT ( 64 ) ,\
369
+ HID_REPORT_COUNT ( report_size ) ,\
368
370
HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
369
371
/* Usage Data Out */ \
370
372
HID_USAGE ( HID_USAGE_FIDO_OUTPUT_REPORT_DATA ) ,\
371
373
HID_LOGICAL_MIN ( 0 ) ,\
372
- HID_LOGICAL_MAX_N ( 255 , 2 ) ,\
374
+ HID_LOGICAL_MAX_N ( 0xff , 2 ) ,\
373
375
HID_REPORT_SIZE ( 8 ) ,\
374
- HID_REPORT_COUNT ( 64 ) ,\
376
+ HID_REPORT_COUNT ( report_size ) ,\
375
377
HID_OUTPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\
376
378
HID_COLLECTION_END \
377
379
0 commit comments