mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
Merge remote-tracking branch 'origin/wifi_phy_mode_esp8266' into integration
This commit is contained in:
@@ -309,6 +309,18 @@ bool CompactString::operator==(const StringRef &other) const {
|
||||
/// └──────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_INFO
|
||||
#ifdef USE_WIFI_PHY_MODE
|
||||
// Use if-chain instead of switch to avoid jump table in RODATA (wastes RAM on ESP8266)
|
||||
static const LogString *phy_mode_to_log_string(WiFi8266PhyMode mode) {
|
||||
if (mode == WIFI_8266_PHY_MODE_11B)
|
||||
return LOG_STR("11B");
|
||||
if (mode == WIFI_8266_PHY_MODE_11G)
|
||||
return LOG_STR("11G");
|
||||
if (mode == WIFI_8266_PHY_MODE_11N)
|
||||
return LOG_STR("11N");
|
||||
return LOG_STR("Auto");
|
||||
}
|
||||
#endif
|
||||
// Use if-chain instead of switch to avoid jump table in RODATA (wastes RAM on ESP8266)
|
||||
static const LogString *retry_phase_to_log_string(WiFiRetryPhase phase) {
|
||||
if (phase == WiFiRetryPhase::INITIAL_CONNECT)
|
||||
@@ -1535,6 +1547,9 @@ void WiFiComponent::dump_config() {
|
||||
break;
|
||||
}
|
||||
ESP_LOGCONFIG(TAG, " Band Mode: %s", band_mode_s);
|
||||
#endif
|
||||
#ifdef USE_WIFI_PHY_MODE
|
||||
ESP_LOGCONFIG(TAG, " PHY Mode: %s", LOG_STR_ARG(phy_mode_to_log_string(this->phy_mode_)));
|
||||
#endif
|
||||
if (this->is_connected()) {
|
||||
this->print_connect_params_();
|
||||
|
||||
Reference in New Issue
Block a user