add ESP32_NATIVE_USB setting to make it clear which usb we are dealing with
This commit is contained in:
parent
d379e56c4f
commit
31c20caf2c
1 changed files with 15 additions and 4 deletions
|
|
@ -21,6 +21,10 @@
|
||||||
// bin_files[] is defined accordingly
|
// bin_files[] is defined accordingly
|
||||||
#include "esp_binaries.h"
|
#include "esp_binaries.h"
|
||||||
|
|
||||||
|
// 1 if programming ESP32-S2/S3 via native USB
|
||||||
|
// 0 if programming ESP32/8266 via USB-to-UART chip such as FTDI/CP210x/CH9102f
|
||||||
|
#define ESP32_NATIVE_USB 1
|
||||||
|
|
||||||
#define ESP32_RESET 27
|
#define ESP32_RESET 27
|
||||||
#define ESP32_IO0 28
|
#define ESP32_IO0 28
|
||||||
|
|
||||||
|
|
@ -31,15 +35,22 @@
|
||||||
// CDC Host object
|
// CDC Host object
|
||||||
Adafruit_USBH_CDC SerialHost;
|
Adafruit_USBH_CDC SerialHost;
|
||||||
|
|
||||||
// Defined an boot rom object that use SerialHost
|
#if ESP32_NATIVE_USB
|
||||||
// Declare BootROM without IO0 and Reset will use SerialHost.setDtrRts() for bootloader reset
|
|
||||||
// This is for programming ESP32/8266 via USB-to-UART chip such as FTDI/CP210x/CH9102f
|
|
||||||
//ESP32BootROMClass ESP32BootROM(SerialHost);
|
|
||||||
|
|
||||||
// Declare BootROM with IO0 and Reset will use GPIO for bootloader reset
|
// Declare BootROM with IO0 and Reset will use GPIO for bootloader reset
|
||||||
// This is typically for programming ESP32-S2/S3 via native USB
|
// This is typically for programming ESP32-S2/S3 via native USB
|
||||||
ESP32BootROMClass ESP32BootROM(SerialHost, ESP32_IO0, ESP32_RESET);
|
ESP32BootROMClass ESP32BootROM(SerialHost, ESP32_IO0, ESP32_RESET);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
// Defined an boot rom object that use SerialHost
|
||||||
|
// Declare BootROM without IO0 and Reset will use SerialHost.setDtrRts() for bootloader reset
|
||||||
|
// This is for programming ESP32/8266 via USB-to-UART chip such as FTDI/CP210x/CH9102f
|
||||||
|
ESP32BootROMClass ESP32BootROM(SerialHost);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
// Setup and Loop on Core0
|
// Setup and Loop on Core0
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue