mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 12:43:28 +02:00
Store strings only used for logging in flash (#2274)
Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -58,21 +58,21 @@ void UARTDevice::check_uart_settings(uint32_t baud_rate, uint8_t stop_bits, UART
|
||||
this->parent_->data_bits_);
|
||||
}
|
||||
if (this->parent_->parity_ != parity) {
|
||||
ESP_LOGE(TAG, " Invalid parity: Integration requested parity %s but you have %s!", parity_to_str(parity),
|
||||
parity_to_str(this->parent_->parity_));
|
||||
ESP_LOGE(TAG, " Invalid parity: Integration requested parity %s but you have %s!",
|
||||
LOG_STR_ARG(parity_to_str(parity)), LOG_STR_ARG(parity_to_str(this->parent_->parity_)));
|
||||
}
|
||||
}
|
||||
|
||||
const char *parity_to_str(UARTParityOptions parity) {
|
||||
const LogString *parity_to_str(UARTParityOptions parity) {
|
||||
switch (parity) {
|
||||
case UART_CONFIG_PARITY_NONE:
|
||||
return "NONE";
|
||||
return LOG_STR("NONE");
|
||||
case UART_CONFIG_PARITY_EVEN:
|
||||
return "EVEN";
|
||||
return LOG_STR("EVEN");
|
||||
case UART_CONFIG_PARITY_ODD:
|
||||
return "ODD";
|
||||
return LOG_STR("ODD");
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
return LOG_STR("UNKNOWN");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user