Commit df14c975 authored by Dean Camera's avatar Dean Camera
Browse files

Make CPPCheck tool happy by altering the program flow in the low level...

Make CPPCheck tool happy by altering the program flow in the low level keyboard example, so that the SendReport variable is not overwritten before its first read access.
parent c93259fb
......@@ -294,14 +294,11 @@ void SendNextReport(void)
{
static USB_KeyboardReport_Data_t PrevKeyboardReportData;
USB_KeyboardReport_Data_t KeyboardReportData;
bool SendReport = true;
bool SendReport = false;
/* Create the next keyboard report for transmission to the host */
CreateKeyboardReport(&KeyboardReportData);
/* Check to see if the report data has changed - if so a report MUST be sent */
SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);
/* Check if the idle period is set and has elapsed */
if (IdleCount && (!(IdleMSRemaining)))
{
......@@ -311,6 +308,11 @@ void SendNextReport(void)
/* Idle period is set and has elapsed, must send a report to the host */
SendReport = true;
}
else
{
/* Check to see if the report data has changed - if so a report MUST be sent */
SendReport = (memcmp(&PrevKeyboardReportData, &KeyboardReportData, sizeof(USB_KeyboardReport_Data_t)) != 0);
}
/* Select the Keyboard Report Endpoint */
Endpoint_SelectEndpoint(KEYBOARD_IN_EPADDR);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment