mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-07 12:07:09 +03:00
fix Preset options, cleanup
This commit is contained in:
@@ -6,5 +6,4 @@ idf_component_register( SRC_DIRS . webapp UML-State-Machine-in-C/src
|
||||
PRIV_REQUIRES tools services platform_config esp_common json newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console esp_http_server console driver_bt
|
||||
)
|
||||
|
||||
|
||||
include(webapp/webapp.cmake)
|
||||
@@ -22,14 +22,13 @@ static esp_err_t start(spi_device_handle_t spi_handle, eth_config_t* ethernet_co
|
||||
|
||||
static void init_config(eth_config_t* ethernet_config) {
|
||||
DM9051.start = start;
|
||||
DM9051.rmii = true;
|
||||
DM9051.spi = false;
|
||||
DM9051.valid = true;
|
||||
}
|
||||
|
||||
network_ethernet_driver_t* DM9051_Detect(char* Driver) {
|
||||
if (!strcasestr(Driver, "DM9051"))
|
||||
return NULL;
|
||||
DM9051.rmii = true;
|
||||
DM9051.spi = false;
|
||||
#ifdef CONFIG_ETH_SPI_ETHERNET_DM9051
|
||||
DM9051.valid = true;
|
||||
#else
|
||||
|
||||
@@ -23,8 +23,6 @@ static esp_err_t start(spi_device_handle_t spi_handle, eth_config_t* ethernet_co
|
||||
|
||||
static void init_config(eth_config_t* ethernet_config) {
|
||||
LAN8720.start = start;
|
||||
LAN8720.rmii = true;
|
||||
LAN8720.spi = false;
|
||||
}
|
||||
|
||||
network_ethernet_driver_t* LAN8720_Detect(char* Driver) {
|
||||
@@ -35,6 +33,8 @@ network_ethernet_driver_t* LAN8720_Detect(char* Driver) {
|
||||
#else
|
||||
LAN8720.valid = false;
|
||||
#endif
|
||||
LAN8720.rmii = true;
|
||||
LAN8720.spi = false;
|
||||
LAN8720.init_config = init_config;
|
||||
return &LAN8720;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ static esp_err_t start(spi_device_handle_t spi_handle, eth_config_t* ethernet_co
|
||||
#endif
|
||||
}
|
||||
static void init_config(eth_config_t* ethernet_config) {
|
||||
// This function is called when the network interface is started
|
||||
// and performs any initialization that requires a valid ethernet
|
||||
// configuration .
|
||||
esp_netif_inherent_config_t loc_esp_netif_config = ESP_NETIF_INHERENT_DEFAULT_ETH();
|
||||
devcfg.command_bits = 16; // Actually it's the address phase in W5500 SPI frame
|
||||
devcfg.address_bits = 8; // Actually it's the control phase in W5500 SPI frame
|
||||
@@ -38,14 +41,14 @@ static void init_config(eth_config_t* ethernet_config) {
|
||||
W5500.cfg_netif = &cfg_spi;
|
||||
W5500.devcfg = &devcfg;
|
||||
W5500.start = start;
|
||||
W5500.spi = true;
|
||||
W5500.rmii = false;
|
||||
|
||||
}
|
||||
network_ethernet_driver_t* W5500_Detect(char* Driver, network_ethernet_driver_t* Device) {
|
||||
if (!strcasestr(Driver, "W5500"))
|
||||
return NULL;
|
||||
W5500.init_config = init_config;
|
||||
W5500.spi = true;
|
||||
W5500.rmii = false;
|
||||
#ifdef CONFIG_ETH_SPI_ETHERNET_W5500
|
||||
W5500.valid = true;
|
||||
#else
|
||||
|
||||
@@ -16,10 +16,11 @@ typedef struct {
|
||||
esp_eth_handle_t handle;
|
||||
esp_netif_config_t * cfg_netif;
|
||||
spi_device_interface_config_t * devcfg;
|
||||
// esp_eth_mac_t* (*mac_new)(spi_device_handle_t spi_handle, eth_config_t * eth_config);
|
||||
// esp_eth_phy_t *(*phy_new)( eth_config_t* eth_config);
|
||||
esp_err_t (*start)(spi_device_handle_t spi_handle,eth_config_t *ethernet_config);
|
||||
// This function is called when the network interface is started
|
||||
// and performs any initialization that requires a valid ethernet
|
||||
// configuration .
|
||||
void (*init_config)(eth_config_t * eth_config);
|
||||
esp_err_t (*start)(spi_device_handle_t spi_handle,eth_config_t *ethernet_config);
|
||||
} network_ethernet_driver_t;
|
||||
typedef network_ethernet_driver_t* network_ethernet_detect_func_t(const char* Driver);
|
||||
network_ethernet_driver_t* network_ethernet_driver_autodetect(const char* Driver);
|
||||
|
||||
@@ -404,9 +404,9 @@ char* network_manager_alloc_get_mac_string(uint8_t mac[6]);
|
||||
#define network_handler_print(State_Machine, begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"HANDLER START":"HANDLER END",State_Machine,false,__FUNCTION__)
|
||||
|
||||
#elif defined(LOG_LOCAL_LEVEL) && LOG_LOCAL_LEVEL >= ESP_LOG_DEBUG
|
||||
#define network_handler_entry_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"BEGIN ENTRY":"END ENTRY",State_Machine,false,__FUNCTION__)
|
||||
#define network_exit_handler_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"BEGIN EXIT":"END EXIT",State_Machine,false,__FUNCTION__)
|
||||
#define network_handler_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"HANDLER START":"HANDLER END",State_Machine,false,__FUNCTION__)
|
||||
#define network_handler_entry_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"BEGIN ENTRY":"END ENTRY",State_Machine,false,"")
|
||||
#define network_exit_handler_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"BEGIN EXIT":"END EXIT",State_Machine,false,"")
|
||||
#define network_handler_print(State_Machine, begin) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,begin?"HANDLER START":"HANDLER END",State_Machine,false,"")
|
||||
|
||||
#define NETWORK_PRINT_TRANSITION(begin, prefix, source,target, event, print_source,caller ) if(begin) network_manager_format_from_to_states(ESP_LOG_DEBUG, prefix, source,target, event, print_source,caller )#define NETWORK_EXECUTE_CB(mch) network_execute_cb(mch,__FUNCTION__);
|
||||
#define NETWORK_DEBUG_STATE_MACHINE(begin, cb_prefix,state_machine,print_from,caller) if(begin) network_manager_format_state_machine(ESP_LOG_DEBUG,cb_prefix,state_machine,print_from,caller)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifdef NETWORK_HTTP_SERVER_LOG_LEVEL
|
||||
#define LOG_LOCAL_LEVEL NETWORK_HTTP_SERVER_LOG_LEVEL
|
||||
#endif
|
||||
/*
|
||||
* Squeezelite for esp32
|
||||
*
|
||||
@@ -139,7 +142,7 @@ esp_err_t http_server_start()
|
||||
strlcpy(rest_context->base_path, "/res/", sizeof(rest_context->base_path));
|
||||
|
||||
httpd_config_t config = HTTPD_DEFAULT_CONFIG();
|
||||
config.max_uri_handlers = 25;
|
||||
config.max_uri_handlers = 30;
|
||||
config.max_open_sockets = 8;
|
||||
config.uri_match_fn = httpd_uri_match_wildcard;
|
||||
config.task_priority = ESP_TASK_PRIO_MIN;
|
||||
|
||||
Reference in New Issue
Block a user