Skip to content

Commit

Permalink
Merge pull request #26 from MG-5/upgrade_to_idf_v5
Browse files Browse the repository at this point in the history
Upgrade to idf v5.1
  • Loading branch information
MG-5 authored Sep 15, 2023
2 parents a70d440 + 218c32f commit 8c9f2ff
Show file tree
Hide file tree
Showing 105 changed files with 15,204 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: release-v4.4
esp_idf_version: release-v5.1
target: esp32
2 changes: 1 addition & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "ESP-IDF",
"cStandard": "c11",
"cppStandard": "c++17",
"compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp32-elf/esp-2021r2-patch5-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
"compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
Expand Down
4 changes: 2 additions & 2 deletions main/Application.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ extern "C" void app_main(void) // NOLINT
auto currentHeapFreeSpace = esp_get_free_heap_size();

ESP_LOGI(Application::PrintTag, "Moin");
ESP_LOGI(Application::PrintTag, "Free memory: %d bytes", currentHeapFreeSpace);
ESP_LOGI(Application::PrintTag, "Application consumes %d bytes on heap",
ESP_LOGI(Application::PrintTag, "Free memory: %lu bytes", currentHeapFreeSpace);
ESP_LOGI(Application::PrintTag, "Application consumes %lu bytes on heap",
(previousHeapFreeSpace - currentHeapFreeSpace));

vTaskDelay(toOsTicks(100.0_ms));
Expand Down
10 changes: 10 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ idf_component_register(SRCS
sync.cxx
#StatusLed.cxx

REQUIRES
driver
esp_http_client
esp_app_format
esp_http_server
esp_wifi
json
nvs_flash
spiffs

INCLUDE_DIRS ".")

# Load web data into SPIFFS
Expand Down
10 changes: 5 additions & 5 deletions main/Timebase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class Timebase
//--------------------------------------------------------------------------------------------------
static void initTimeSychronization()
{
sntp_stop();
esp_sntp_stop();
ESP_LOGI(PrintTag, "Initializing SNTP");
sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, "pool.ntp.org");
sntp_set_time_sync_notification_cb(timeSynchronizationCallback);
sntp_init();
esp_sntp_setoperatingmode(ESP_SNTP_OPMODE_POLL);
esp_sntp_setservername(0, "pool.ntp.org");
esp_sntp_set_time_sync_notification_cb(timeSynchronizationCallback);
esp_sntp_init();
ESP_LOGI(PrintTag, "Update system time every %d minutes.",
CONFIG_LWIP_SNTP_UPDATE_DELAY / 1000 / 60);

Expand Down
2 changes: 1 addition & 1 deletion main/components/Time
Submodule Time updated 2 files
+7 −0 Time.cxx
+2 −1 Time.hpp
2 changes: 1 addition & 1 deletion main/components/util
2 changes: 0 additions & 2 deletions main/dfi/Dfi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ void Dfi::parseXml()
auto end =
std::remove_if(additionalVehicleList.begin(), additionalVehicleList.end(),
[this](LocalTransportVehicle &v) { return !isArrivalTimeInFuture(v); });
std::distance(end, additionalVehicleList.end());
additionalVehicleList.erase(end, additionalVehicleList.end());

// copy additional vehicles into our array
Expand Down Expand Up @@ -223,7 +222,6 @@ void Dfi::setAdditionalVehicles(AdditionalVehicleList &additionalVehicles)
auto end =
std::remove_if(additionalVehicles.begin(), additionalVehicles.end(),
[this](LocalTransportVehicle &v) { return !isArrivalTimeInFuture(v); });
std::distance(end, additionalVehicles.end());
additionalVehicles.erase(end, additionalVehicles.end());

additionalVehicleList = additionalVehicles;
Expand Down
7 changes: 7 additions & 0 deletions main/dfi/HttpClient.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "HttpClient.hpp"
#include "esp_log.h"

#include <string>

namespace
{
constexpr auto PrintTag = "[HttpClient]";
Expand Down Expand Up @@ -96,6 +98,11 @@ esp_err_t HttpClient::httpEventHandler(esp_http_client_event_t *event)
case HTTP_EVENT_DISCONNECTED:
ESP_LOGD(PrintTag, "HTTP_EVENT_DISCONNECTED");
break;

case HTTP_EVENT_REDIRECT:
ESP_LOGD(PrintTag, "HTTP_EVENT_REDIRECT");
return esp_http_client_set_redirection(event->client);
break;
}
return ESP_OK;
}
17 changes: 17 additions & 0 deletions main/idf_component.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## IDF Component Manager Manifest File
dependencies:
espressif/mdns: "^1.0.7"
## Required IDF version
idf:
version: ">=4.1.0"
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
4 changes: 2 additions & 2 deletions main/led/RenderTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "Timebase.hpp"
#include "helpers/freertos.hpp"

#include "esp_app_desc.h"
#include "esp_log.h"
#include "esp_ota_ops.h"

void RenderTask::taskMain(void *)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ void RenderTask::renderVehicles(bool showCurrentVehicle)
//--------------------------------------------------------------------------------------------------
void RenderTask::renderProjectInfos()
{
const esp_app_desc_t *appDesc = esp_ota_get_app_description();
const esp_app_desc_t *appDesc = esp_app_get_description();

renderer.print({0, 0}, appDesc->project_name);
snprintf(printBuffer, PrintBufferSize, "%s (%s)", appDesc->date, appDesc->version);
Expand Down
5 changes: 3 additions & 2 deletions main/rest/RestApiHandlers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
#include "wifi/Wireless.hpp"

#include "cJSON.h"
#include "esp_app_desc.h"
#include "esp_chip_info.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "esp_wifi.h"
#include <fcntl.h>

Expand Down Expand Up @@ -102,7 +103,7 @@ esp_err_t RestApiHandlers::systemInfoGetHandler(httpd_req_t *req)
cJSON *jsonRoot = cJSON_CreateObject();
esp_chip_info_t chipInfo;
esp_chip_info(&chipInfo);
const esp_app_desc_t *appDesc = esp_ota_get_app_description();
const esp_app_desc_t *appDesc = esp_app_get_description();

cJSON_AddStringToObject(jsonRoot, "projectName", appDesc->project_name);
cJSON_AddStringToObject(jsonRoot, "projectVersion", appDesc->version);
Expand Down
3 changes: 2 additions & 1 deletion main/wifi/Wireless.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "esp_event.h"
#include "esp_log.h"
#include "esp_mac.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "freertos/event_groups.h"
Expand Down Expand Up @@ -170,7 +171,7 @@ void Wireless::eventHandler(void *arg, esp_event_base_t eventBase, int32_t event
break;

default:
ESP_LOGD(PrintTag, "event: %d", eventId);
ESP_LOGD(PrintTag, "event: %ld", eventId);
break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions main/wifi/Wireless.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#pragma once

#include "esp_event.h"
#include "esp_netif_ip_addr.h"
#include "esp_wifi_types.h"

#include "helpers/freertos.hpp"
#include "wrappers/Task.hpp"

Expand Down
11 changes: 11 additions & 0 deletions managed_components/espressif__mdns/.build-test-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
components/mdns/examples:
disable:
- if: IDF_TARGET in ["esp32h2"]

components/mdns/tests/unit_test:
disable:
- if: IDF_TARGET in ["esp32h2"]

components/mdns/tests/test_apps:
disable:
- if: IDF_TARGET in ["esp32h2"]
1 change: 1 addition & 0 deletions managed_components/espressif__mdns/.component_hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d6665090cf41eb399c184aab6f34234251a773e052fb53ca044dcb576264c646
8 changes: 8 additions & 0 deletions managed_components/espressif__mdns/.cz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
commitizen:
bump_message: 'bump(mdns): $current_version -> $new_version'
pre_bump_hooks: python ../../ci/changelog.py mdns
tag_format: mdns-v$version
version: 1.2.1
version_files:
- idf_component.yml
Loading

0 comments on commit 8c9f2ff

Please sign in to comment.