diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index 97984b85..3e28a2e5 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -21,7 +21,7 @@ #if( 0 < HID_CONTROLS ) #include "user_hid.h" -unsigned char g_hidData[HID_DATA_BYTES] = {0}; +unsigned char g_hidData[1] = {0}; #endif void GetADCCounts(unsigned samFreq, int &min, int &mid, int &max); @@ -880,7 +880,7 @@ void XUA_Buffer_Ep(register chanend c_aud_out, case XUD_SetData_Select(c_hid, ep_hid, result): { g_hidData[0]=0; - UserHIDGetData(g_hidData); + g_hidData[0]=UserHIDGetData(); XUD_SetReady_In(ep_hid, g_hidData, 1); } break; diff --git a/lib_xua/src/core/user/hid/user_hid.h b/lib_xua/src/core/user/hid/user_hid.h index 5288ee7b..35d2578d 100644 --- a/lib_xua/src/core/user/hid/user_hid.h +++ b/lib_xua/src/core/user/hid/user_hid.h @@ -3,13 +3,7 @@ #ifndef __USER_HID_H__ #define __USER_HID_H__ -/** - * \brief HID event identifiers - * - * This enumeration defines a constant value for each HID event. - * It defines one value for each of the four GPI pins supported in the standard voice products. - * It defines a further 28 values for generic events. - */ +/* These enumerated constants relate to the HID report desc - do not mod */ typedef enum hidEventId_t { HID_EVENT_ID_GPI0 = 0, HID_EVENT_ID_GPI1, @@ -45,40 +39,13 @@ typedef enum hidEventId_t { HID_EVENT_ID_EVT27 } hidEventId_t; -#define HID_DATA_BYTES 4 +#define HID_DATA_SIZE 1 #if( 0 < HID_CONTROLS ) -/** - * \brief Get the data for the next HID report - * - * \note This function returns the HID data as a list of unsigned char because the - * \c XUD_SetReady_In() accepts data for transmission to the USB Host using - * this type. - * - * \param{out} hidData The HID data - */ -void UserHIDGetData( unsigned char hidData[ HID_DATA_BYTES ]); - -/** - * \brief Initialize HID processing - */ +unsigned UserHIDGetData( void ); void UserHIDInit( void ); - -/** - * \brief Record that a HID event has occurred - * - * \param{in} hidEventId The identifier of an event which has occurred - * \param{in} hidEventData A list of data associated with the event - * \param{in} hidEventDataSize The length of the event data list - * - * \note At present, this function only takes a single element of event data, i.e. - * hidEventDataSize must equal 1. - * - * \note At present, this function treats the event data as a Boolean flag. - * Zero means False; all other values mean True. - */ -void UserHIDRecordEvent( const hidEventId_t hidEventId, const int * hidEventData, const unsigned hidEventDataSize ); +void UserHIDRegisterEvent( const hidEventId_t hidEventId, const int * hidEventData, const unsigned hidEventDataSize ); #endif /* ( 0 < HID_CONTROLS ) */ #endif /* __USER_HID_H__ */