Skip to content

Commit 41d45dd

Browse files
committed
update hid composite to work with funhouse
1 parent c63bf0e commit 41d45dd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

examples/HID/hid_composite/hid_composite.ino

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@
1919
* Depending on the board, the button pin
2020
* and its active state (when pressed) are different
2121
*/
22-
#if defined ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS || defined ARDUINO_NRF52840_CIRCUITPLAY
22+
#if defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(ARDUINO_NRF52840_CIRCUITPLAY)
2323
const int pin = 4; // Left Button
2424
bool activeState = true;
2525

26+
#elif defined(ARDUINO_FUNHOUSE_ESP32S2)
27+
const int pin = BUTTON_DOWN;
28+
bool activeState = true;
29+
2630
#elif defined PIN_BUTTON1
2731
const int pin = PIN_BUTTON1;
2832
bool activeState = false;
@@ -57,7 +61,7 @@ Adafruit_USBD_HID usb_hid(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROT
5761
// the setup function runs once when you press reset or power the board
5862
void setup()
5963
{
60-
// Following function has no affect on ESP32
64+
// Notes: following commented-out functions has no affect on ESP32
6165
// usb_hid.setPollInterval(2);
6266
// usb_hid.setReportDescriptor();
6367
// usb_hid.setStringDescriptor("TinyUSB HID Composite");
@@ -131,7 +135,7 @@ void loop()
131135
{
132136
// Consumer Control is used to control Media playback, Volume, Brightness etc ...
133137
// Consumer report is 2-byte containing the control code of the key
134-
// For list of control check out https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h#L544
138+
// For list of control check out https://github.com/hathach/tinyusb/blob/master/src/class/hid/hid.h
135139

136140
// use to send consumer release report
137141
static bool has_consumer_key = false;

0 commit comments

Comments
 (0)