mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-01-31 14:51:11 +03:00
Merge remote-tracking branch 'origin/master' into httpd
Conflicts: components/wifi-manager/http_server.c
This commit is contained in:
@@ -62,6 +62,8 @@ menu "Squeezelite-ESP32"
|
||||
Type of hardware platform
|
||||
config SQUEEZEAMP
|
||||
bool "SqueezeAMP (TAS575x & Bluetooth)"
|
||||
config A1S
|
||||
bool "ESP32-A1S module"
|
||||
config BASIC_I2C_BT
|
||||
bool "Generic I2S & Bluetooth"
|
||||
endchoice
|
||||
@@ -75,7 +77,7 @@ menu "Squeezelite-ESP32"
|
||||
I2S dma channel to use.
|
||||
config I2S_BCK_IO
|
||||
int "I2S Bit clock GPIO number. "
|
||||
default 26
|
||||
default 33
|
||||
help
|
||||
I2S Bit Clock gpio pin to use.
|
||||
config I2S_WS_IO
|
||||
@@ -85,29 +87,13 @@ menu "Squeezelite-ESP32"
|
||||
I2S Word Select gpio pin to use.
|
||||
config I2S_DO_IO
|
||||
int "I2S Data I/O GPIO number. "
|
||||
default 22
|
||||
default 32
|
||||
help
|
||||
I2S data I/O gpio pin to use.
|
||||
choice
|
||||
prompt "Bit Depth for I2S output"
|
||||
default I2S_BITS_PER_CHANNEL_16
|
||||
config I2S_BITS_PER_CHANNEL_24
|
||||
bool "24 Bits"
|
||||
config I2S_BITS_PER_CHANNEL_16
|
||||
bool "16 Bits"
|
||||
config I2S_BITS_PER_CHANNEL_8
|
||||
bool "8 Bits"
|
||||
endchoice
|
||||
config I2S_BITS_PER_CHANNEL
|
||||
int
|
||||
default 16
|
||||
default 16 if I2S_BITS_PER_CHANNEL_16
|
||||
default 24 if I2S_BITS_PER_CHANNEL_24
|
||||
default 8 if I2S_BITS_PER_CHANNEL_8
|
||||
endmenu
|
||||
|
||||
menu "SPDIF settings"
|
||||
depends on BASIC_I2C_BT
|
||||
depends on BASIC_I2C_BT || A1S
|
||||
config SDIF_NUM
|
||||
int "SDPIF/I2S channel (0 or 1)"
|
||||
default 0
|
||||
@@ -115,19 +101,19 @@ menu "Squeezelite-ESP32"
|
||||
I2S dma channel to use.
|
||||
config SPDIF_BCK_IO
|
||||
int "SDPIF/I2S Bit clock GPIO number"
|
||||
default 26
|
||||
default -1
|
||||
help
|
||||
Not used but must be configured.
|
||||
Must be set even if you don't use SPDIF
|
||||
config SPDIF_WS_IO
|
||||
int "SPDIF/I2S Word Select GPIO number"
|
||||
default 25
|
||||
default -1
|
||||
help
|
||||
Not used but must be configured.
|
||||
Must be set even if you don't use SPDIF
|
||||
config SPDIF_DO_IO
|
||||
int "I2S Data I/O GPIO number"
|
||||
default 15
|
||||
default -1
|
||||
help
|
||||
SPDIF/I2S data I/O gpio pin to use
|
||||
Must be set even if you don't use SPDIF
|
||||
endmenu
|
||||
|
||||
menu "A2DP settings"
|
||||
@@ -217,6 +203,11 @@ menu "Squeezelite-ESP32"
|
||||
default -1
|
||||
help
|
||||
Set to -1 for no LED
|
||||
config JACK_GPIO
|
||||
int "Jack insertion GPIO"
|
||||
default -1
|
||||
help
|
||||
GPIO to detect speaker jack insertion (0 = inserted). Set to -1 for no detection
|
||||
endmenu
|
||||
|
||||
endmenu
|
||||
@@ -226,14 +226,14 @@ void run_command(char * line){
|
||||
esp_err_t err = esp_console_run(line, &ret);
|
||||
|
||||
if (err == ESP_ERR_NOT_FOUND) {
|
||||
printf("Unrecognized command\n");
|
||||
ESP_LOGE(TAG,"Unrecognized command: %s\n", line);
|
||||
} else if (err == ESP_ERR_INVALID_ARG) {
|
||||
// command was empty
|
||||
} else if (err == ESP_OK && ret != ESP_OK) {
|
||||
printf("Command returned non-zero error code: 0x%x (%s)\n", ret,
|
||||
ESP_LOGW(TAG,"Command returned non-zero error code: 0x%x (%s)\n", ret,
|
||||
esp_err_to_name(err));
|
||||
} else if (err != ESP_OK) {
|
||||
printf("Internal error: %s\n", esp_err_to_name(err));
|
||||
ESP_LOGE(TAG,"Internal error: %s\n", esp_err_to_name(err));
|
||||
}
|
||||
}
|
||||
static void * console_thread() {
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <math.h>
|
||||
#include "config.h"
|
||||
#include "audio_controls.h"
|
||||
#include "telnet.h"
|
||||
|
||||
static const char certs_namespace[] = "certificates";
|
||||
static const char certs_key[] = "blob";
|
||||
@@ -305,29 +306,43 @@ void register_default_nvs(){
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "i2c_config");
|
||||
config_set_default(NVS_TYPE_STR, "i2c_config", "", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "Vcc_GPIO");
|
||||
config_set_default(NVS_TYPE_STR, "Vcc_GPIO", "", 0);
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "set_GPIO");
|
||||
config_set_default(NVS_TYPE_STR, "set_GPIO", "", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "metadata_config");
|
||||
config_set_default(NVS_TYPE_STR, "metadata_config", "", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "telnet_enable");
|
||||
config_set_default(NVS_TYPE_STR, "telnet_enable", "", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "telnet_buffer");
|
||||
config_set_default(NVS_TYPE_STR, "telnet_buffer", "40000", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "telnet_block");
|
||||
config_set_default(NVS_TYPE_STR, "telnet_block", "500", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Registering default value for key %s", "stats");
|
||||
config_set_default(NVS_TYPE_STR, "stats", "n", 0);
|
||||
|
||||
ESP_LOGD(TAG,"Done setting default values in nvs.");
|
||||
}
|
||||
|
||||
void app_main()
|
||||
{
|
||||
char * fwurl = NULL;
|
||||
esp_err_t update_certificates();
|
||||
ESP_LOGI(TAG,"Starting app_main");
|
||||
initialize_nvs();
|
||||
ESP_LOGI(TAG,"Setting up telnet.");
|
||||
init_telnet(); // align on 32 bits boundaries
|
||||
|
||||
ESP_LOGI(TAG,"Setting up config subsystem.");
|
||||
config_init();
|
||||
|
||||
ESP_LOGD(TAG,"Creating event group for wifi");
|
||||
wifi_event_group = xEventGroupCreate();
|
||||
ESP_LOGD(TAG,"Clearing CONNECTED_BIT from wifi group");
|
||||
xEventGroupClearBits(wifi_event_group, CONNECTED_BIT);
|
||||
|
||||
ESP_LOGI(TAG,"Starting app_main");
|
||||
initialize_nvs();
|
||||
|
||||
ESP_LOGI(TAG,"Setting up config subsystem.");
|
||||
config_init();
|
||||
|
||||
ESP_LOGI(TAG,"Registering default values");
|
||||
register_default_nvs();
|
||||
@@ -381,6 +396,10 @@ void app_main()
|
||||
wifi_manager_start();
|
||||
wifi_manager_set_callback(EVENT_STA_GOT_IP, &cb_connection_got_ip);
|
||||
wifi_manager_set_callback(EVENT_STA_DISCONNECTED, &cb_connection_sta_disconnected);
|
||||
/* Start the telnet service after we are certain that the network stack has been properly initialized.
|
||||
* This can be either after we're started the AP mode, or after we've started the STA mode */
|
||||
wifi_manager_set_callback(ORDER_START_AP, &start_telnet);
|
||||
wifi_manager_set_callback(ORDER_CONNECT_STA, &start_telnet);
|
||||
}
|
||||
console_start();
|
||||
if(fwurl && strlen(fwurl)>0){
|
||||
|
||||
Reference in New Issue
Block a user