Make HIDReportViewer project show the IN, OUT and DATA report sizes as both bits and (rounded) bytes.

pull/1469/head
Dean Camera 14 years ago
parent bb0b761c65
commit 91bc546be0

@ -133,10 +133,16 @@ int main(void)
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature]; uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[HID_REPORT_ITEM_Feature];
/* Print out the byte sizes of each report within the device */ /* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %" PRId8 " - In: %" PRId8 " bytes, Out: %" PRId8 " bytes, Feature: %" PRId8 " bytes\r\n"), printf_P(PSTR(" + Report ID 0x%02" PRIX8 "\r\n"
" - Input Data: %" PRId8 " bits (%" PRId8 " bytes)\r\n"
" - Output Data: %" PRId8 " bits (%" PRId8 " bytes)\r\n"
" - Feature Data: %" PRId8 " bits (%" PRId8 " bytes)\r\n"),
CurrReportIDInfo->ReportID, CurrReportIDInfo->ReportID,
ReportSizeInBits,
((ReportSizeInBits >> 3) + ((ReportSizeInBits & 0x07) != 0)), ((ReportSizeInBits >> 3) + ((ReportSizeInBits & 0x07) != 0)),
ReportSizeOutBits,
((ReportSizeOutBits >> 3) + ((ReportSizeOutBits & 0x07) != 0)), ((ReportSizeOutBits >> 3) + ((ReportSizeOutBits & 0x07) != 0)),
ReportSizeFeatureBits,
((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0))); ((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0)));
} }

Loading…
Cancel
Save