Store strings only used for logging in flash (#2274)

Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
Oxan van Leeuwen
2021-09-13 09:48:52 +02:00
committed by GitHub
parent e18dfdd656
commit d594a6fcbc
25 changed files with 241 additions and 251 deletions
+7 -7
View File
@@ -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");
}
}