mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-04-02 19:30:20 +03:00
chore: checkpoint current IDF 5.5 remediation state
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include "esp_attr.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_ota_ops.h"
|
||||
#include "esp_spi_flash.h"
|
||||
#include "messaging.h"
|
||||
#include "tools.h"
|
||||
static const char* TAG = "bootstate";
|
||||
@@ -140,4 +139,4 @@ void simple_restart() {
|
||||
});
|
||||
xTimerStart(timer, portMAX_DELAY);
|
||||
}
|
||||
bool is_restarting() { return restarting; }
|
||||
bool is_restarting() { return restarting; }
|
||||
|
||||
54
components/tools/tcpip_adapter_compat.h
Normal file
54
components/tools/tcpip_adapter_compat.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include "esp_netif.h"
|
||||
#include "esp_idf_version.h"
|
||||
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||
typedef enum {
|
||||
TCPIP_ADAPTER_IF_STA = 0,
|
||||
TCPIP_ADAPTER_IF_AP = 1,
|
||||
TCPIP_ADAPTER_IF_ETH = 2,
|
||||
TCPIP_ADAPTER_IF_MAX
|
||||
} tcpip_adapter_if_t;
|
||||
|
||||
typedef esp_netif_ip_info_t tcpip_adapter_ip_info_t;
|
||||
typedef esp_netif_dhcp_status_t tcpip_adapter_dhcp_status_t;
|
||||
|
||||
static inline esp_netif_t *tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if)
|
||||
{
|
||||
switch (tcpip_if) {
|
||||
case TCPIP_ADAPTER_IF_STA:
|
||||
return esp_netif_get_handle_from_ifkey("WIFI_STA_DEF");
|
||||
case TCPIP_ADAPTER_IF_AP:
|
||||
return esp_netif_get_handle_from_ifkey("WIFI_AP_DEF");
|
||||
case TCPIP_ADAPTER_IF_ETH:
|
||||
return esp_netif_get_handle_from_ifkey("ETH_DEF");
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static inline esp_err_t tcpip_adapter_get_hostname(tcpip_adapter_if_t tcpip_if, const char **hostname)
|
||||
{
|
||||
esp_netif_t *netif = tcpip_adapter_get_netif(tcpip_if);
|
||||
if (!netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
return esp_netif_get_hostname(netif, hostname);
|
||||
}
|
||||
|
||||
static inline bool tcpip_adapter_is_netif_up(tcpip_adapter_if_t tcpip_if)
|
||||
{
|
||||
esp_netif_t *netif = tcpip_adapter_get_netif(tcpip_if);
|
||||
return netif ? esp_netif_is_netif_up(netif) : false;
|
||||
}
|
||||
|
||||
static inline esp_err_t tcpip_adapter_get_ip_info(tcpip_adapter_if_t tcpip_if, tcpip_adapter_ip_info_t *ip_info)
|
||||
{
|
||||
esp_netif_t *netif = tcpip_adapter_get_netif(tcpip_if);
|
||||
if (!netif) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
return esp_netif_get_ip_info(netif, ip_info);
|
||||
}
|
||||
#endif
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "tools.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_mac.h"
|
||||
#include "esp_task.h"
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -365,11 +366,11 @@ char* alloc_get_fallback_unique_name() {
|
||||
#endif
|
||||
}
|
||||
|
||||
#define LOCAL_MAC_SIZE 20
|
||||
#define FORMATTED_MAC_SIZE 20
|
||||
char* alloc_get_formatted_mac_string(uint8_t mac[6]) {
|
||||
char* macStr = malloc_init_external(LOCAL_MAC_SIZE);
|
||||
char* macStr = malloc_init_external(FORMATTED_MAC_SIZE);
|
||||
if (macStr) {
|
||||
snprintf(macStr, LOCAL_MAC_SIZE, MACSTR, MAC2STR(mac));
|
||||
snprintf(macStr, FORMATTED_MAC_SIZE, MACSTR, MAC2STR(mac));
|
||||
}
|
||||
return macStr;
|
||||
}
|
||||
|
||||
@@ -257,9 +257,9 @@ void listFiles(const char* path_requested_char) {
|
||||
printf("Total : %lu bytes in %d file(s)\n", (unsigned long)total, nfiles);
|
||||
}
|
||||
|
||||
uint32_t tot = 0, used = 0;
|
||||
size_t tot = 0, used = 0;
|
||||
esp_spiffs_info(NULL, &tot, &used);
|
||||
printf("SPIFFS: free %d KB of %d KB\n", (tot - used) / 1024, tot / 1024);
|
||||
printf("SPIFFS: free %zu KB of %zu KB\n", (tot - used) / 1024, tot / 1024);
|
||||
printf("---------------------------------------------------------------------------------------"
|
||||
"---------------\n");
|
||||
}
|
||||
@@ -380,4 +380,4 @@ bool dump_structure(const pb_msgdesc_t* fields, const void* src_struct) {
|
||||
ESP_LOGE(TAG, "Error in dump_structure: %s", e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "esp_system.h"
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/queue.h>
|
||||
#include "esp_log.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "freertos/FreeRTOSConfig.h"
|
||||
@@ -40,4 +41,3 @@ mem_usage_trace_for_thread_t* memtrace_get_thread_entry(TaskHandle_t task) {
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user