Update the patched UART component to ESPHome 2026.11.0
ESPHome 2026.11's tuya component calls uart.new_uart_component(), which the 2026.10.2 copy didn't have, so the build failed. Copy the UART component from 2026.11.0, reapply the PA13/PA14 patch, regenerate the patch file and point the refs at v1.0.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bcc6b3a42b
commit
1457e25d98
39 files changed
+907
-304
No files matched your search
@@ -1,8 +1,14 @@
|
||||
#include "uart_component.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace esphome::uart {
|
||||
|
||||
static const char *const TAG = "uart";
|
||||
ESPHOME_LOG_TAG(TAG, "uart");
|
||||
|
||||
// Keeps the pacing product in 32 bits up to about 10 Mbaud.
|
||||
static constexpr uint32_t MAX_PACE_SPAN_MS = 4000;
|
||||
|
||||
bool UARTComponent::check_read_timeout_(size_t len) {
|
||||
if (this->available() >= len)
|
||||
@@ -19,6 +25,19 @@ bool UARTComponent::check_read_timeout_(size_t len) {
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t UARTComponent::paced_write_room(uint32_t last_write_ms) {
|
||||
size_t room = this->available_for_write();
|
||||
if (room != SIZE_MAX) {
|
||||
return room;
|
||||
}
|
||||
// A pass woken early writes little.
|
||||
uint32_t span =
|
||||
std::min({App.get_loop_component_start_time() - last_write_ms, App.get_loop_interval(), MAX_PACE_SPAN_MS});
|
||||
// 10 bits per byte on the line.
|
||||
uint32_t paced = this->baud_rate_ / 10 * span / 1000;
|
||||
return std::max<size_t>(1, paced);
|
||||
}
|
||||
|
||||
void UARTComponent::set_rx_full_threshold_ms(uint8_t time) {
|
||||
uint8_t bytelength = this->data_bits_ + this->stop_bits_ + 1;
|
||||
if (this->parity_ != UARTParityOptions::UART_CONFIG_PARITY_NONE)
|
||||
@@ -27,4 +46,17 @@ void UARTComponent::set_rx_full_threshold_ms(uint8_t time) {
|
||||
this->set_rx_full_threshold(val);
|
||||
}
|
||||
|
||||
#ifdef USE_ESP8266
|
||||
void UARTComponent::write_array_progmem(const uint8_t *data, size_t len) {
|
||||
uint8_t buf[32];
|
||||
while (len > 0) {
|
||||
const size_t chunk = std::min(len, sizeof(buf));
|
||||
progmem_memcpy(buf, data, chunk);
|
||||
this->write_array(buf, chunk);
|
||||
data += chunk;
|
||||
len -= chunk;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace esphome::uart
|
||||
Reference in new issue
Block a user