/****************************************************************************** * @brief Sends an updated report to HID * Sends an updated report to HID interface if a key was pressed/released * * @return None *****************************************************************************/ void TI_USBKBD_Report_Update(void) { if (Report_buff.Update == TRUE_t) { while (USBHID_sendReport((uint8_t *)&Report_buff.Buff[0], HID_Keyboard) == kUSBHID_intfBusyError) ; Report_buff.Update = FALSE_t; } }
/* * ======== sendState ======== */ static int sendState(USBCDCMOUSE_State *mouseState, unsigned int timeout) { unsigned int key; int retValue; MouseReport mouseReport = {0}; /* Set the bit packed button values */ mouseReport.buttons |= (mouseState->button1) ? 0x01 : 0; mouseReport.buttons |= (mouseState->button2) ? 0x02 : 0; mouseReport.buttons |= (mouseState->button3) ? 0x04 : 0; mouseReport.dX = mouseState->deltaX; mouseReport.dY = mouseState->deltaY; /* Acquire lock */ key = GateMutex_enter(gateMouse); USBHID_sendReport((void*)&mouseReport, M_INTFNUM); retValue = Semaphore_pend(semMouse, timeout); /* Release lock */ GateMutex_leave(gateMouse, key); return (retValue); }
void Keyboard_sendReport() { USBHID_sendReport( keyUnion.keyArray, HID0_INTFNUM); }