mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 15:12:21 +01:00
ato
This commit is contained in:
@@ -266,6 +266,9 @@ void USBUartComponent::start_input(USBUartChannel *channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void USBUartComponent::start_output(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())
|
if (channel->output_started_.load())
|
||||||
return;
|
return;
|
||||||
if (channel->output_buffer_.is_empty()) {
|
if (channel->output_buffer_.is_empty()) {
|
||||||
|
Reference in New Issue
Block a user