Fix building of KeyboardHostWithParser and MouseHostWithParser demos broken by HIDParser API changes.

This commit is contained in:
Dean Camera 2009-09-21 06:32:16 +00:00
parent 0029cb454e
commit 6bbd2a99c2
2 changed files with 16 additions and 8 deletions

View File

@ -188,12 +188,16 @@ void Keyboard_HID_Task(void)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
/* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
CurrReportIDInfo->ReportID,
((CurrReportIDInfo->BitsIn >> 3) + (CurrReportIDInfo->BitsIn & 0x07)),
((CurrReportIDInfo->BitsOut >> 3) + (CurrReportIDInfo->BitsOut & 0x07)),
((CurrReportIDInfo->BitsFeature >> 3) + (CurrReportIDInfo->BitsFeature & 0x07)));
CurrReportIDInfo->ReportID,
((ReportSizeInBits >> 3) + ((ReportSizeInBits & 0x07) != 0)),
((ReportSizeOutBits >> 3) + ((ReportSizeOutBits & 0x07) != 0)),
((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0)));
}
puts_P(PSTR("Keyboard Enumerated.\r\n"));

View File

@ -187,13 +187,17 @@ void Mouse_HID_Task(void)
for (uint8_t i = 0; i < HIDReportInfo.TotalDeviceReports; i++)
{
HID_ReportSizeInfo_t* CurrReportIDInfo = &HIDReportInfo.ReportIDSizes[i];
uint8_t ReportSizeInBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_In];
uint8_t ReportSizeOutBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Out];
uint8_t ReportSizeFeatureBits = CurrReportIDInfo->ReportSizeBits[REPORT_ITEM_TYPE_Feature];
/* Print out the byte sizes of each report within the device */
printf_P(PSTR(" + Report ID %d - In: %d bytes, Out: %d bytes, Feature: %d bytes\r\n"),
CurrReportIDInfo->ReportID,
((CurrReportIDInfo->BitsIn >> 3) + (CurrReportIDInfo->BitsIn & 0x07)),
((CurrReportIDInfo->BitsOut >> 3) + (CurrReportIDInfo->BitsOut & 0x07)),
((CurrReportIDInfo->BitsFeature >> 3) + (CurrReportIDInfo->BitsFeature & 0x07)));
CurrReportIDInfo->ReportID,
((ReportSizeInBits >> 3) + ((ReportSizeInBits & 0x07) != 0)),
((ReportSizeOutBits >> 3) + ((ReportSizeOutBits & 0x07) != 0)),
((ReportSizeFeatureBits >> 3) + ((ReportSizeFeatureBits & 0x07) != 0)));
}
puts_P(PSTR("Mouse Enumerated.\r\n"));