Fix various warnings which become fatal with later gcc versons in esp-idf 5.x (#1268)

- we cannot use partial initialisation of structs in C++ files (copied from example C files initially it seems)
- IRAM_ATTR uses a COUNTER, do not use the attribute on the implementation
- provide missing copy implementations for Rgb and Hsv
- one no longer can |= on volatile variables; use = | instead
- fix project and header includes
- avoid redefining BLINK_GPIO
- Remove defined but unused variables
- Fix printf formats
- Add missing case statement (HTTP_EVENT_REDIRECT)
- RMT needs to be updated to new interface (CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is on currently; see https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/api-reference/peripherals/rmt.html)
- Adjust tcpip_adpater_* to esp_netif_*
- Use buffered versions of *ntoa* functions for IPv4 addresses and not a static on the stack (also fixes warnings)
- Whatever I missed

Co-authored-by: Bjoern A. Zeeb <patch@zabbadoz.net>
This commit is contained in:
bzfbd
2022-11-04 19:06:46 +00:00
committed by GitHub
parent 4ffde22bc6
commit 235861eaea
25 changed files with 194 additions and 92 deletions

View File

@@ -13,7 +13,7 @@
#define __HIDE_PASSWORD
static const char *TAG = "class_flow_MQTT";
//static const char *TAG = "class_flow_MQTT";
#define LWT_TOPIC "connection"
#define LWT_CONNECTED "connected"
@@ -143,7 +143,11 @@ void publishRuntimeData(std::string maintopic, int SetRetainFlag) {
sprintf(tmp_char, "%ld", (long)getUpTime());
MQTTPublish(maintopic + "/" + "uptime", std::string(tmp_char), SetRetainFlag);
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0))
sprintf(tmp_char, "%lu", esp_get_free_heap_size());
#else
sprintf(tmp_char, "%zu", esp_get_free_heap_size());
#endif
MQTTPublish(maintopic + "/" + "freeMem", std::string(tmp_char), SetRetainFlag);
sprintf(tmp_char, "%d", get_WIFI_RSSI());

View File

@@ -4,7 +4,9 @@
#include <string>
#ifndef BLINK_GPIO
#define BLINK_GPIO GPIO_NUM_4
#endif
#define CAMERA_MODEL_AI_THINKER