mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
Update esp32 platform to 2024.04.14 (#21299)
* use new HWCDC Arduino code
This commit is contained in:
parent
fd148a8d12
commit
117cee9e6e
@ -77,7 +77,7 @@ lib_ignore = ${esp32_defaults.lib_ignore}
|
|||||||
ccronexpr
|
ccronexpr
|
||||||
|
|
||||||
[core32]
|
[core32]
|
||||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.04.12/platform-espressif32.zip
|
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.04.14/platform-espressif32.zip
|
||||||
platform_packages =
|
platform_packages =
|
||||||
build_unflags = ${esp32_defaults.build_unflags}
|
build_unflags = ${esp32_defaults.build_unflags}
|
||||||
build_flags = ${esp32_defaults.build_flags}
|
build_flags = ${esp32_defaults.build_flags}
|
||||||
|
@ -474,8 +474,10 @@ void setup(void) {
|
|||||||
|
|
||||||
bool is_connected_to_USB = false;
|
bool is_connected_to_USB = false;
|
||||||
#if SOC_USB_SERIAL_JTAG_SUPPORTED // Not S2
|
#if SOC_USB_SERIAL_JTAG_SUPPORTED // Not S2
|
||||||
|
TasConsole.setRxBufferSize(INPUT_BUFFER_SIZE);
|
||||||
|
TasConsole.begin(115200); // always start CDC to test plugged cable
|
||||||
for (uint32_t i = 0; i < 5; i++) { // wait up to 250 ms - maybe a shorter time is enough
|
for (uint32_t i = 0; i < 5; i++) { // wait up to 250 ms - maybe a shorter time is enough
|
||||||
is_connected_to_USB = usb_serial_jtag_is_connected();
|
is_connected_to_USB = HWCDCSerial.isPlugged();
|
||||||
if (is_connected_to_USB) { break; }
|
if (is_connected_to_USB) { break; }
|
||||||
delay(50);
|
delay(50);
|
||||||
}
|
}
|
||||||
@ -484,19 +486,20 @@ void setup(void) {
|
|||||||
#endif // SOC_USB_SERIAL_JTAG_SUPPORTED
|
#endif // SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||||
|
|
||||||
if (is_connected_to_USB) {
|
if (is_connected_to_USB) {
|
||||||
TasConsole.setRxBufferSize(INPUT_BUFFER_SIZE);
|
// TasConsole is already running
|
||||||
// TasConsole.setTxBufferSize(INPUT_BUFFER_SIZE);
|
|
||||||
TasConsole.begin(115200); // Will always be 115200 bps
|
|
||||||
#if !ARDUINO_USB_MODE
|
#if !ARDUINO_USB_MODE
|
||||||
USB.begin(); // This needs a serial console with DTR/DSR support
|
USB.begin(); // This needs a serial console with DTR/DSR support
|
||||||
#endif // No ARDUINO_USB_MODE
|
#endif // No ARDUINO_USB_MODE
|
||||||
TasConsole.println();
|
TasConsole.println();
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("CMD: Using USB CDC"));
|
AddLog(LOG_LEVEL_INFO, PSTR("CMD: Using USB CDC"));
|
||||||
} else {
|
} else {
|
||||||
|
#if SOC_USB_SERIAL_JTAG_SUPPORTED // Not S2
|
||||||
|
HWCDCSerial.~HWCDC(); // not needed, deinit CDC
|
||||||
|
#endif // SOC_USB_SERIAL_JTAG_SUPPORTED
|
||||||
// Init command serial console preparing for AddLog use
|
// Init command serial console preparing for AddLog use
|
||||||
Serial.begin(TasmotaGlobal.baudrate);
|
Serial.begin(TasmotaGlobal.baudrate);
|
||||||
Serial.println();
|
Serial.println();
|
||||||
TasConsole = Serial; // Fallback
|
TasConsole = Serial; // Fallback
|
||||||
tasconsole_serial = true;
|
tasconsole_serial = true;
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR("CMD: Fall back to serial port, no SOF packet detected on USB port"));
|
AddLog(LOG_LEVEL_INFO, PSTR("CMD: Fall back to serial port, no SOF packet detected on USB port"));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user