mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[HWCDC] Test for ESP32-C3/C6/S3 HWCDC issues
This commit is contained in:
@@ -211,7 +211,9 @@ lib_ignore =
|
||||
;platform = https://github.com/Jason2866/platform-espressif32.git
|
||||
platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.02.10/platform-espressif32.zip
|
||||
;platform_packages =
|
||||
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2119/framework-arduinoespressif32-release_v5.1-a28d368.zip
|
||||
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2119/framework-arduinoespressif32-release_v5.1-a28d368.zip
|
||||
;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2180/framework-arduinoespressif32-all-release_v5.1-735d740.zip
|
||||
platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/2189/framework-arduinoespressif32-all-release_v5.1-be1a568.zip
|
||||
build_flags = -DESP32_STAGE
|
||||
-DESP_IDF_VERSION_MAJOR=5
|
||||
-DLIBRARIES_NO_LOG=1
|
||||
|
||||
@@ -155,7 +155,7 @@ void EspEasy_Console_t::reInit()
|
||||
|
||||
#if USES_HWCDC
|
||||
if (mainSerialPort == ESPEasySerialPort::usb_hw_cdc) {
|
||||
buffsize = 512;
|
||||
buffsize = 2048;
|
||||
}
|
||||
#endif // if USES_HWCDC
|
||||
|
||||
|
||||
@@ -67,29 +67,35 @@ size_t SerialWriteBuffer_t::write(Stream& stream, size_t nrBytesToWrite)
|
||||
}
|
||||
|
||||
if (nrBytesToWrite > 0) {
|
||||
// FIXME TD-er: Work-around for bug in HWCDC when writing exactly the amount of free bytes in the buffer.
|
||||
// --nrBytesToWrite;
|
||||
if (nrBytesToWrite > bufferSize) {
|
||||
nrBytesToWrite = bufferSize;
|
||||
}
|
||||
|
||||
while (nrBytesToWrite > 0 && !_buffer.empty()) {
|
||||
#ifdef ESP32
|
||||
uint8_t tmpBuffer[1]{};
|
||||
#else
|
||||
uint8_t tmpBuffer[16]{};
|
||||
#endif
|
||||
|
||||
size_t tmpBufferUsed = 0;
|
||||
|
||||
auto it = _buffer.begin();
|
||||
|
||||
for (; tmpBufferUsed < sizeof(tmpBuffer) && tmpBufferUsed < nrBytesToWrite && it != _buffer.end(); ) {
|
||||
bool done = false;
|
||||
|
||||
for (; tmpBufferUsed < sizeof(tmpBuffer) &&
|
||||
!done &&
|
||||
it != _buffer.end(); ) {
|
||||
tmpBuffer[tmpBufferUsed] = (uint8_t)(*it);
|
||||
if (*it == '\n' ||
|
||||
tmpBufferUsed >= nrBytesToWrite) {
|
||||
done = true;
|
||||
}
|
||||
++tmpBufferUsed;
|
||||
++it;
|
||||
}
|
||||
|
||||
bool done = false;
|
||||
const size_t written = stream.write(tmpBuffer, tmpBufferUsed);
|
||||
// done = false;
|
||||
const size_t written = (tmpBufferUsed == 0) ? 0 : stream.write(tmpBuffer, tmpBufferUsed);
|
||||
|
||||
if (written < tmpBufferUsed) {
|
||||
done = true;
|
||||
|
||||
Reference in New Issue
Block a user