Подключены ESP32|Linux, обновлен интерфейс

This commit is contained in:
2026-09-11 20:53:38 +03:00
parent 9fce687690
commit e7a01aaeda
23 changed files with 477 additions and 647 deletions
+3
View File
@@ -6,10 +6,13 @@ set(requires
web_server
esp_netif
esp_event
nvs_flash
)
if("${target}" STREQUAL "linux")
list(APPEND requires protocol_examples_tapif_io)
else()
list(APPEND requires protocol_examples_common)
endif()
idf_component_register(
+9
View File
@@ -0,0 +1,9 @@
dependencies:
protocol_examples_tapif_io:
path: ${IDF_PATH}/examples/common_components/protocol_examples_tapif_io
rules:
- if: "target in [linux]"
protocol_examples_common:
path: ${IDF_PATH}/examples/common_components/protocol_examples_common
rules:
- if: "target not in [linux]"
+6 -10
View File
@@ -5,26 +5,22 @@
#include "esp_event.h"
#include "esp_netif.h"
#include "esp_log.h"
#ifdef CONFIG_IDF_TARGET_LINUX
#include "nvs_flash.h"
#include "protocol_examples_common.h"
#endif
static const char *TAG = "main";
void app_main(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
device_list_init();
arp_monitor_init();
#ifdef CONFIG_IDF_TARGET_LINUX
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
ESP_ERROR_CHECK(example_connect());
ESP_LOGI(TAG, "Linux network interface initialized");
#else
ESP_LOGW(TAG, "Network initialization for the ESP32 target is not configured");
#endif
ESP_LOGI(TAG, "Network interface initialized");
web_server_init();
}