From 65fa92ad7556f8a9155b3a957b8f386255acceef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Luk=C3=A1=C5=A1?= Date: Mon, 19 Sep 2022 17:01:22 +0200 Subject: [PATCH 1/4] Added component manifest used by the new esp-idf component manager --- idf_component.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 idf_component.yml diff --git a/idf_component.yml b/idf_component.yml new file mode 100644 index 0000000..2f27974 --- /dev/null +++ b/idf_component.yml @@ -0,0 +1,5 @@ +version: "idf-v5.0-support" +description: "A porting effort to the ESP-IDF framework for the e-Radionica InkPlate software." +dependencies: + idf: + version: ">=5.0" From d8897b4ed69bd8dca1d26d4c88cab4d7da220fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Luk=C3=A1=C5=A1?= Date: Fri, 16 Dec 2022 19:38:54 +0100 Subject: [PATCH 2/4] Fixed compilation crash due to format related bugs being treated as errors in v5.0 --- include/services/esp.hpp | 2 +- src/services/network_client.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/services/esp.hpp b/include/services/esp.hpp index 8bdc189..f2bcbfc 100644 --- a/include/services/esp.hpp +++ b/include/services/esp.hpp @@ -64,7 +64,7 @@ class ESP mem = heap_caps_malloc(size, MALLOC_CAP_SPIRAM); } if (mem == nullptr) { - ESP_LOGE(TAG, "Not enough memory on PSRAM!!! (Asking %u bytes)", size); + ESP_LOGE(TAG, "Not enough memory on PSRAM!!! (Asking %lu bytes)", size); } return mem; } diff --git a/src/services/network_client.cpp b/src/services/network_client.cpp index 0bebd2a..d39a896 100644 --- a/src/services/network_client.cpp +++ b/src/services/network_client.cpp @@ -60,7 +60,7 @@ static void sta_event_handler(void * arg, int32_t event_id, void * event_data) { - ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %d.", (unsigned int) event_base, event_id); + ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %ld.", (unsigned int) event_base, event_id); if (event_base == WIFI_EVENT) { if (event_id == WIFI_EVENT_STA_START) { @@ -212,7 +212,7 @@ static esp_err_t http_event_handler(esp_http_client_event_t * evt) //ESP_LOGI(TAG, "key = %s, value = %s", evt->header_key, evt->header_value); if (strcmp("Content-Length", evt->header_key) == 0) { buffer_size = atoi(evt->header_value); - ESP_LOGI(TAG, "Donwload file size: %d", buffer_size); + ESP_LOGI(TAG, "Donwload file size: %ld", buffer_size); } break; case HTTP_EVENT_ON_DATA: @@ -276,7 +276,7 @@ NetworkClient::downloadFile(const char * url, int32_t * defaultLen) esp_err_t err = esp_http_client_perform(client); if (err == ESP_OK) { - ESP_LOGI(TAG, "Status = %d, content_length = %d", + ESP_LOGI(TAG, "Status = %d, content_length = %lld", esp_http_client_get_status_code(client), esp_http_client_get_content_length(client)); } From bf3ddbc66eaf7c77ed5a06b289ae6dae19ff2098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Luk=C3=A1=C5=A1?= Date: Fri, 16 Dec 2022 19:53:07 +0100 Subject: [PATCH 3/4] Fixed idf component manager discarding the component for non-semantic version number --- idf_component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component.yml b/idf_component.yml index 2f27974..f948aa0 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,4 +1,4 @@ -version: "idf-v5.0-support" +version: "0.9.8" description: "A porting effort to the ESP-IDF framework for the e-Radionica InkPlate software." dependencies: idf: From c6199d5e1f6cce156d7537f8957fe7c1b41b5d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Luk=C3=A1=C5=A1?= Date: Mon, 6 Feb 2023 17:43:22 +0100 Subject: [PATCH 4/4] Replaced %d, %x and %ld with their PRI variants --- src/drivers/mcp23017.cpp | 7 +++++-- src/services/network_client.cpp | 7 ++++--- src/services/wire.cpp | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/drivers/mcp23017.cpp b/src/drivers/mcp23017.cpp index e39deb3..858bbf3 100644 --- a/src/drivers/mcp23017.cpp +++ b/src/drivers/mcp23017.cpp @@ -21,6 +21,9 @@ Distributed as-is; no warranty is given. */ #define __MCP__ 1 + +#include + #include "mcp23017.hpp" #include "esp_log.h" @@ -32,7 +35,7 @@ Distributed as-is; no warranty is given. bool MCP23017::check_presence() { - if (!present) ESP_LOGE(TAG, "The MCP at address 0x%X has not been detected.", mcp_address); + if (!present) ESP_LOGE(TAG, "The MCP at address 0x%" PRIX8 " has not been detected.", mcp_address); return present; } @@ -69,7 +72,7 @@ MCP23017::setup() wire.begin_transmission(mcp_address); present = wire.end_transmission() == ESP_OK; - ESP_LOGI(TAG, "MCP at address 0x%X has%s been detected", mcp_address, present ? "" : " NOT"); + ESP_LOGI(TAG, "MCP at address 0x%" PRIX8 " has%s been detected", mcp_address, present ? "" : " NOT"); read_all_registers(); registers[Reg::IODIRA] = 0xff; diff --git a/src/services/network_client.cpp b/src/services/network_client.cpp index d39a896..937264b 100644 --- a/src/services/network_client.cpp +++ b/src/services/network_client.cpp @@ -19,6 +19,7 @@ Distributed as-is; no warranty is given. #include "esp_log.h" #include +#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" @@ -60,7 +61,7 @@ static void sta_event_handler(void * arg, int32_t event_id, void * event_data) { - ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %ld.", (unsigned int) event_base, event_id); + ESP_LOGI(TAG, "STA Event, Base: %08x, Event: %" PRIu32 ".", (unsigned int) event_base, event_id); if (event_base == WIFI_EVENT) { if (event_id == WIFI_EVENT_STA_START) { @@ -212,7 +213,7 @@ static esp_err_t http_event_handler(esp_http_client_event_t * evt) //ESP_LOGI(TAG, "key = %s, value = %s", evt->header_key, evt->header_value); if (strcmp("Content-Length", evt->header_key) == 0) { buffer_size = atoi(evt->header_value); - ESP_LOGI(TAG, "Donwload file size: %ld", buffer_size); + ESP_LOGI(TAG, "Donwload file size: %" PRIi32, buffer_size); } break; case HTTP_EVENT_ON_DATA: @@ -276,7 +277,7 @@ NetworkClient::downloadFile(const char * url, int32_t * defaultLen) esp_err_t err = esp_http_client_perform(client); if (err == ESP_OK) { - ESP_LOGI(TAG, "Status = %d, content_length = %lld", + ESP_LOGI(TAG, "Status = %d, content_length = %" PRIi64, esp_http_client_get_status_code(client), esp_http_client_get_content_length(client)); } diff --git a/src/services/wire.cpp b/src/services/wire.cpp index 26d620e..99721bc 100644 --- a/src/services/wire.cpp +++ b/src/services/wire.cpp @@ -47,7 +47,7 @@ Wire::begin_transmission(uint8_t addr) { if (!initialized) setup(); - ESP_LOGD(TAG, "Begin Transmission to address %x", addr); + ESP_LOGD(TAG, "Begin Transmission to address %" PRIx8, addr); if (initialized) { address = addr;