mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fixed tab/space and added comments
This commit is contained in:
parent
c1c955c225
commit
83a52b5063
3 changed files with 44 additions and 41 deletions
|
@ -7,6 +7,7 @@
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Override HIDComposite to be able to select which interface we want to hook into
|
||||||
class HIDSelector : public HIDComposite
|
class HIDSelector : public HIDComposite
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -17,6 +18,7 @@ protected:
|
||||||
bool SelectInterface(uint8_t iface, uint8_t proto);
|
bool SelectInterface(uint8_t iface, uint8_t proto);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Return true for the interface we want to hook into
|
||||||
bool HIDSelector::SelectInterface(uint8_t iface, uint8_t proto)
|
bool HIDSelector::SelectInterface(uint8_t iface, uint8_t proto)
|
||||||
{
|
{
|
||||||
if(proto != 0)
|
if(proto != 0)
|
||||||
|
@ -25,6 +27,7 @@ bool HIDSelector::SelectInterface(uint8_t iface, uint8_t proto)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Will be called for all HID data received from the USB interface
|
||||||
void HIDSelector::ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf) {
|
void HIDSelector::ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf) {
|
||||||
#if 1
|
#if 1
|
||||||
if (len && buf) {
|
if (len && buf) {
|
||||||
|
|
Loading…
Reference in a new issue