rename a bunch of configure macros
This commit is contained in:
@@ -37,14 +37,14 @@
|
||||
|
||||
#include "hid.h"
|
||||
|
||||
#if defined TUSB_CLASS_HID && defined CFG_TUSB_DEVICE
|
||||
#if defined DEVICE_CLASS_HID && defined TUSB_CFG_DEVICE
|
||||
|
||||
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
USB_HID_KeyboardReport_t hid_keyboard_report;
|
||||
volatile static bool bKeyChanged = false;
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CLASS_HID_MOUSE
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
USB_HID_MouseReport_t hid_mouse_report;
|
||||
volatile static bool bMouseChanged = false;
|
||||
#endif
|
||||
@@ -64,7 +64,7 @@ ErrorCode_t HID_GetReport( USBD_HANDLE_T hHid, USB_SETUP_PACKET* pSetup, uint8_t
|
||||
|
||||
switch (pHidCtrl->protocol)
|
||||
{
|
||||
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
case HID_PROTOCOL_KEYBOARD:
|
||||
*pBuffer = (uint8_t*) &hid_keyboard_report;
|
||||
*plength = sizeof(USB_HID_KeyboardReport_t);
|
||||
@@ -77,7 +77,7 @@ ErrorCode_t HID_GetReport( USBD_HANDLE_T hHid, USB_SETUP_PACKET* pSetup, uint8_t
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CLASS_HID_MOUSE
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
case HID_PROTOCOL_MOUSE:
|
||||
*pBuffer = (uint8_t*) &hid_mouse_report;
|
||||
*plength = sizeof(USB_HID_MouseReport_t);
|
||||
@@ -127,7 +127,7 @@ ErrorCode_t HID_EpIn_Hdlr (USBD_HANDLE_T hUsb, void* data, uint32_t event)
|
||||
USB_HID_CTRL_T* pHidCtrl = (USB_HID_CTRL_T*)data;
|
||||
switch(pHidCtrl->protocol)
|
||||
{
|
||||
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
case HID_PROTOCOL_KEYBOARD:
|
||||
if (!bKeyChanged)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ ErrorCode_t HID_EpIn_Hdlr (USBD_HANDLE_T hUsb, void* data, uint32_t event)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CLASS_HID_MOUSE
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
case HID_PROTOCOL_MOUSE:
|
||||
if (!bMouseChanged)
|
||||
{
|
||||
@@ -222,18 +222,18 @@ TUSB_Error_t tusb_hid_init(USBD_HANDLE_T hUsb, USB_INTERFACE_DESCRIPTOR const *c
|
||||
/**************************************************************************/
|
||||
TUSB_Error_t tusb_hid_configured(USBD_HANDLE_T hUsb)
|
||||
{
|
||||
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
USBD_API->hw->WriteEP(hUsb , HID_KEYBOARD_EP_IN , (uint8_t* ) &hid_keyboard_report , sizeof(USB_HID_KeyboardReport_t) ); // initial packet for IN endpoint , will not work if omitted
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CLASS_HID_MOUSE
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
USBD_API->hw->WriteEP(hUsb , HID_MOUSE_EP_IN , (uint8_t* ) &hid_mouse_report , sizeof(USB_HID_MouseReport_t) ); // initial packet for IN endpoint, will not work if omitted
|
||||
#endif
|
||||
|
||||
return tERROR_NONE;
|
||||
}
|
||||
|
||||
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||
#ifdef TUSB_CFG_DEVICE_HID_KEYBOARD
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the supplied key codes out via HID USB keyboard emulation
|
||||
@@ -295,7 +295,7 @@ TUSB_Error_t tusb_hid_keyboard_sendKeys(uint8_t modifier, uint8_t keycodes[], ui
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CFG_CLASS_HID_MOUSE
|
||||
#ifdef TUSB_CFG_DEVICE_HID_MOUSE
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Send the supplied mouse event out via HID USB mouse emulation
|
||||
|
||||
Reference in New Issue
Block a user