[core] Convert LOG_UPDATE_INTERVAL macro to function to reduce flash usage (#10636)

This commit is contained in:
J. Nick Koston
2025-09-07 16:09:15 -05:00
committed by GitHub
parent a8b8507ffc
commit 0c737fc4df
10 changed files with 27 additions and 16 deletions

View File

@@ -342,6 +342,18 @@ void Component::status_momentary_error(const std::string &name, uint32_t length)
this->set_timeout(name, length, [this]() { this->status_clear_error(); });
}
void Component::dump_config() {}
// Function implementation of LOG_UPDATE_INTERVAL macro to reduce code size
void log_update_interval(const char *tag, PollingComponent *component) {
uint32_t update_interval = component->get_update_interval();
if (update_interval == SCHEDULER_DONT_RUN) {
ESP_LOGCONFIG(tag, " Update Interval: never");
} else if (update_interval < 100) {
ESP_LOGCONFIG(tag, " Update Interval: %.3fs", update_interval / 1000.0f);
} else {
ESP_LOGCONFIG(tag, " Update Interval: %.1fs", update_interval / 1000.0f);
}
}
float Component::get_actual_setup_priority() const {
// Check if there's an override in the global vector
if (setup_priority_overrides) {