Skip to content

Commit 4be0aed

Browse files
committed
update all example configure to work with esp32
1 parent 4d04364 commit 4be0aed

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

examples/DualRole/CDC/serial_host_bridge/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/HID/hid_device_report/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/HID/hid_mouse_log_filter/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/HID/hid_mouse_tremor_filter/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/HID/hid_remapper/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/MassStorage/msc_data_logger/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

examples/DualRole/MassStorage/msc_file_explorer/usbh_helper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,14 @@
5050

5151
#if defined(CFG_TUH_MAX3421) && CFG_TUH_MAX3421
5252
#include "SPI.h"
53+
54+
#ifdef ARDUINO_ARCH_ESP32
55+
// ESP32 specify SCK, MOSI, MISO, CS, INT
56+
Adafruit_USBH_Host USBHost(36, 35, 37, 15, 14);
57+
#else
5358
// USB Host using MAX3421E: SPI, CS, INT
5459
Adafruit_USBH_Host USBHost(&SPI, 10, 9);
60+
#endif
5561
#else
5662
Adafruit_USBH_Host USBHost;
5763
#endif

0 commit comments

Comments
 (0)