diff --git a/esphome/components/usb_uart/usb_uart.cpp b/esphome/components/usb_uart/usb_uart.cpp index d3179e14bd..0bd77571ef 100644 --- a/esphome/components/usb_uart/usb_uart.cpp +++ b/esphome/components/usb_uart/usb_uart.cpp @@ -209,7 +209,6 @@ bool USBUartChannel::read_array(uint8_t *data, size_t len) { this->parent_->start_input(this); return status; } -#if defined(USE_ESP8266) || defined(USE_ESP32) void USBUartChannel::load_settings(bool dump_config) { if (this->parent_ == nullptr || !this->initialised_.load()) { return; @@ -218,13 +217,9 @@ void USBUartChannel::load_settings(bool dump_config) { } void USBUartChannel::load_settings() { this->load_settings(true); } -#endif void USBUartComponent::setup() { USBClient::setup(); } -void USBUartComponent::load_settings(USBUartChannel *channel, bool dump_config) { - static_cast(channel); - static_cast(dump_config); -} +void USBUartComponent::load_settings([[maybe_unused]] USBUartChannel *channel, [[maybe_unused]] bool dump_config) {} void USBUartComponent::loop() { bool had_work = this->process_usb_events_(); diff --git a/esphome/components/usb_uart/usb_uart.h b/esphome/components/usb_uart/usb_uart.h index 345eec2664..ba9f7db2d2 100644 --- a/esphome/components/usb_uart/usb_uart.h +++ b/esphome/components/usb_uart/usb_uart.h @@ -149,10 +149,8 @@ class USBUartChannel : public uart::UARTComponent, public Parenteddummy_receiver_ = dummy_receiver; } void set_debug_prefix(const char *prefix) { this->debug_prefix_ = StringRef(prefix); } void set_flush_timeout(uint32_t flush_timeout_ms) override { this->flush_timeout_ms_ = flush_timeout_ms; } -#if defined(USE_ESP8266) || defined(USE_ESP32) void load_settings(bool dump_config) override; void load_settings() override; -#endif /// Register a callback invoked immediately after data is pushed to the input ring buffer. /// Called from USBUartComponent::loop() in the main loop context. @@ -192,7 +190,7 @@ class USBUartComponent : public usb_host::USBClient { std::vector get_channels() { return this->channels_; } void add_channel(USBUartChannel *channel) { this->channels_.push_back(channel); } - virtual void load_settings(USBUartChannel *channel, bool dump_config); + virtual void load_settings([[maybe_unused]] USBUartChannel *channel, [[maybe_unused]] bool dump_config); void start_input(USBUartChannel *channel); void start_output(USBUartChannel *channel);