11static constexpr uint32_t MAX_PACE_SPAN_MS = 4000;
19 if (
millis() - start_time > 100) {
20 ESP_LOGE(TAG,
"Reading from UART timed out at byte %zu!", this->
available());
30 if (room != SIZE_MAX) {
38 return std::max<size_t>(1, paced);
45 int32_t
val = clamp<int32_t>((this->
baud_rate_ / (bytelength * 1000 / time)) - 1, 1, 120);
53 const size_t chunk = std::min(
len,
sizeof(buf));
uint32_t get_loop_interval() const
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
UARTParityOptions parity_
size_t paced_write_room(uint32_t last_write_ms)
void write_array_progmem(const uint8_t *data, size_t len)
bool check_read_timeout_(size_t len=1)
void write_array(const std::vector< uint8_t > &data)
void set_rx_full_threshold_ms(uint8_t time)
virtual void set_rx_full_threshold(size_t rx_full_threshold)
virtual size_t available()=0
virtual size_t available_for_write()
ESPHOME_LOG_TAG(TAG, "uart.binary_sensor")
@ UART_CONFIG_PARITY_NONE
void progmem_memcpy(void *dst, const void *src, size_t len)
uint32_t IRAM_ATTR HOT millis()
Application App
Global storage of Application pointer - only one Application can exist.