1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 15:12:21 +01:00
This commit is contained in:
J. Nick Koston
2025-09-23 22:21:44 -05:00
parent efc0d86aa6
commit 6ba720d126

View File

@@ -266,6 +266,9 @@ void USBUartComponent::start_input(USBUartChannel *channel) {
}
void USBUartComponent::start_output(USBUartChannel *channel) {
// IMPORTANT: This function must only be called from the main loop!
// The output_buffer_ is not thread-safe and can only be accessed from main loop.
// USB callbacks use defer() to ensure this function runs in the correct context.
if (channel->output_started_.load())
return;
if (channel->output_buffer_.is_empty()) {