1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-02-19 13:54:23 +01:00

rework HID class functions scopes

This commit is contained in:
Martino Facchin 2015-07-01 16:58:26 +02:00 committed by Cristian Maglie
parent 97a3771772
commit 5defaeaa97
6 changed files with 6 additions and 9 deletions

View File

@ -66,7 +66,7 @@ int HID_GetDescriptor(int8_t t)
}
}
void HID_SendReport(u8 id, const void* data, int len)
void HID_::SendReport(u8 id, const void* data, int len)
{
USB_Send(HID_TX, &id, 1);
USB_Send(HID_TX | TRANSFER_RELEASE,data,len);

View File

@ -47,14 +47,9 @@ class HID_
public:
HID_(void);
int begin(void);
void SendReport(uint8_t id, const void* data, int len);
};
int8_t HID_Plug(void);
int HID_GetInterface(u8* interfaceNum);
int HID_GetDescriptor(int8_t t);
bool HID_Setup(Setup& setup, u8 i);
void HID_SendReport(uint8_t id, const void* data, int len);
extern HID_ HID;
typedef struct

View File

@ -44,7 +44,7 @@ void Keyboard_::end(void)
void Keyboard_::sendReport(KeyReport* keys)
{
HID_SendReport(2,keys,sizeof(KeyReport));
HID.SendReport(2,keys,sizeof(KeyReport));
}
const u8 _hidReportDescriptor[] PROGMEM = {

View File

@ -96,5 +96,6 @@ public:
virtual void releaseAll(void);
};
extern Keyboard_ Keyboard;
extern HID_ HID;
#endif

View File

@ -93,7 +93,7 @@ void Mouse_::move(signed char x, signed char y, signed char wheel)
m[1] = x;
m[2] = y;
m[3] = wheel;
HID_SendReport(1,m,4);
HID.SendReport(1,m,4);
}
void Mouse_::buttons(uint8_t b)

View File

@ -56,6 +56,7 @@ public:
bool isPressed(uint8_t b = MOUSE_LEFT); // check LEFT by default
};
extern Mouse_ Mouse;
extern HID_ HID;
#endif
#endif