|
19 | 19 | * Depending on the board, the button pin
|
20 | 20 | * and its active state (when pressed) are different
|
21 | 21 | */
|
22 |
| -#if defined ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS || defined ARDUINO_NRF52840_CIRCUITPLAY |
| 22 | +#if defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(ARDUINO_NRF52840_CIRCUITPLAY) |
23 | 23 | const int pin = 4; // Left Button
|
24 | 24 | bool activeState = true;
|
25 | 25 |
|
| 26 | +#elif defined(ARDUINO_FUNHOUSE_ESP32S2) |
| 27 | + const int pin = BUTTON_DOWN; |
| 28 | + bool activeState = true; |
| 29 | + |
26 | 30 | #elif defined PIN_BUTTON1
|
27 | 31 | const int pin = PIN_BUTTON1;
|
28 | 32 | bool activeState = false;
|
@@ -57,7 +61,7 @@ Adafruit_USBD_HID usb_hid(desc_hid_report, sizeof(desc_hid_report), HID_ITF_PROT
|
57 | 61 | // the setup function runs once when you press reset or power the board
|
58 | 62 | void setup()
|
59 | 63 | {
|
60 |
| - // Following function has no affect on ESP32 |
| 64 | + // Notes: following commented-out functions has no affect on ESP32 |
61 | 65 | // usb_hid.setPollInterval(2);
|
62 | 66 | // usb_hid.setReportDescriptor();
|
63 | 67 | // usb_hid.setStringDescriptor("TinyUSB HID Composite");
|
@@ -131,7 +135,7 @@ void loop()
|
131 | 135 | {
|
132 | 136 | // Consumer Control is used to control Media playback, Volume, Brightness etc ...
|
133 | 137 | // 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 |
135 | 139 |
|
136 | 140 | // use to send consumer release report
|
137 | 141 | static bool has_consumer_key = false;
|
|
0 commit comments