fix sonar compile

This commit is contained in:
proddy
2024-08-16 16:14:07 +02:00
parent 1d287b6e20
commit bc8a840695
4 changed files with 8 additions and 2 deletions

View File

@@ -1834,7 +1834,7 @@ void EMSdevice::mqtt_ha_entity_config_create() {
#endif #endif
} }
} }
#ifdef EMSESP_DEBUG #if defined(EMSESP_DEBUG) || defined(EMSESP_STANDALONE)
if (count) { if (count) {
EMSESP::logger().debug("Created %d HA-%s-configs", count, device_type_name()); EMSESP::logger().debug("Created %d HA-%s-configs", count, device_type_name());
} }

View File

@@ -1538,7 +1538,9 @@ EMSESP::EMSESP()
// start all the core services // start all the core services
// the services must be loaded in the correct order // the services must be loaded in the correct order
void EMSESP::start() { void EMSESP::start() {
#ifndef EMSESP_STANDALONE
system_.PSram(ESP.getPsramSize()); system_.PSram(ESP.getPsramSize());
#endif
// don't need shell if running unit tests // don't need shell if running unit tests
#ifndef EMSESP_UNITY #ifndef EMSESP_UNITY
// Serial console's shell // Serial console's shell

View File

@@ -379,7 +379,9 @@ std::string Helpers::data_to_hex(const uint8_t * data, const uint8_t length) {
return "<empty>"; return "<empty>";
} }
char str[length * 3] = {0}; char str[length * 3];
memset(str, 0, length * sizeof(char));
char buffer[4]; char buffer[4];
char * p = &str[0]; char * p = &str[0];
for (uint8_t i = 0; i < length; i++) { for (uint8_t i = 0; i < length; i++) {

View File

@@ -81,6 +81,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
#endif #endif
} }
#ifndef EMSESP_STANDALONE
const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, nullptr); const esp_partition_t * partition = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_APP_FACTORY, nullptr);
root["has_loader"] = partition != NULL && partition != esp_ota_get_running_partition(); root["has_loader"] = partition != NULL && partition != esp_ota_get_running_partition();
partition = esp_ota_get_next_update_partition(nullptr); partition = esp_ota_get_next_update_partition(nullptr);
@@ -91,6 +92,7 @@ void WebStatusService::systemStatus(AsyncWebServerRequest * request) {
} else { } else {
root["has_partition"] = false; root["has_partition"] = false;
} }
#endif
response->setLength(); response->setLength();
request->send(response); request->send(response);