mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:07:33 +00:00
Tighten usb_uart load_settings overrides
This commit is contained in:
committed by
GitHub
parent
a6643517ea
commit
61bb46b75b
@@ -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<void>(channel);
|
||||
static_cast<void>(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_();
|
||||
|
||||
|
||||
@@ -149,10 +149,8 @@ class USBUartChannel : public uart::UARTComponent, public Parented<USBUartCompon
|
||||
void set_dummy_receiver(bool dummy_receiver) { this->dummy_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<USBUartChannel *> 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);
|
||||
|
||||
Reference in New Issue
Block a user