Exposes load_settings to UARTComponent class (#5920)

This commit is contained in:
Edward Firmo 2023-12-13 23:45:08 +01:00 committed by GitHub
parent 9a8bc9484d
commit 81aa48a5f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View file

@ -62,6 +62,10 @@ class UARTComponent {
UARTParityOptions get_parity() const { return this->parity_; } UARTParityOptions get_parity() const { return this->parity_; }
void set_baud_rate(uint32_t baud_rate) { baud_rate_ = baud_rate; } void set_baud_rate(uint32_t baud_rate) { baud_rate_ = baud_rate; }
uint32_t get_baud_rate() const { return baud_rate_; } uint32_t get_baud_rate() const { return baud_rate_; }
#ifdef USE_ESP32
virtual void load_settings() = 0;
virtual void load_settings(bool dump_config) = 0;
#endif // USE_ESP32
#ifdef USE_UART_DEBUGGER #ifdef USE_UART_DEBUGGER
void add_debug_callback(std::function<void(UARTDirection, uint8_t)> &&callback) { void add_debug_callback(std::function<void(UARTDirection, uint8_t)> &&callback) {

View file

@ -44,7 +44,8 @@ class ESP32ArduinoUARTComponent : public UARTComponent, public Component {
* *
* This will load the current UART interface with the latest settings (baud_rate, parity, etc). * This will load the current UART interface with the latest settings (baud_rate, parity, etc).
*/ */
void load_settings(bool dump_config = true); void load_settings(bool dump_config) override;
void load_settings() override { this->load_settings(true); }
protected: protected:
void check_logger_conflict() override; void check_logger_conflict() override;

View file

@ -38,7 +38,8 @@ class IDFUARTComponent : public UARTComponent, public Component {
* *
* This will load the current UART interface with the latest settings (baud_rate, parity, etc). * This will load the current UART interface with the latest settings (baud_rate, parity, etc).
*/ */
void load_settings(bool dump_config = true); void load_settings(bool dump_config) override;
void load_settings() override { this->load_settings(true); }
protected: protected:
void check_logger_conflict() override; void check_logger_conflict() override;