fixing some merging issues

This commit is contained in:
Sebastien
2020-03-10 20:01:18 -04:00
parent 2ab14d62be
commit 7adc14a5aa
2 changed files with 20 additions and 8 deletions

View File

@@ -35,7 +35,7 @@
#include "nvs_flash.h" #include "nvs_flash.h"
#include "esp_log.h" #include "esp_log.h"
#include "freertos/event_groups.h" #include "freertos/event_groups.h"
#include "mdns.h"
#include "lwip/api.h" #include "lwip/api.h"
#include "lwip/err.h" #include "lwip/err.h"
#include "lwip/netdb.h" #include "lwip/netdb.h"
@@ -44,8 +44,9 @@
#include "wifi_manager.h" #include "wifi_manager.h"
#include "squeezelite-ota.h" #include "squeezelite-ota.h"
#include <math.h> #include <math.h>
#include "platform_config.h" #include "config.h"
#include "audio_controls.h" #include "audio_controls.h"
#include "platform_config.h"
#include "telnet.h" #include "telnet.h"
#include "messaging.h" #include "messaging.h"
@@ -70,12 +71,22 @@ extern const uint8_t server_cert_pem_end[] asm("_binary_github_pem_end");
// as an exception _init function don't need include // as an exception _init function don't need include
extern void services_init(void); extern void services_init(void);
extern void display_init(char *welcome); extern void display_init(char *welcome);
bool is_recovery_running;
const char * str_or_unknown(const char * str) { return (str?str:unknown_string_placeholder); } const char * str_or_unknown(const char * str) { return (str?str:unknown_string_placeholder); }
bool is_recovery_running;
/* brief this is an exemple of a callback that you can setup in your own app to get notified of wifi manager event */ /* brief this is an exemple of a callback that you can setup in your own app to get notified of wifi manager event */
void cb_connection_got_ip(void *pvParameter){ void cb_connection_got_ip(void *pvParameter){
static ip4_addr_t ip;
tcpip_adapter_ip_info_t ipInfo;
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ipInfo);
if (ip.addr && ipInfo.ip.addr != ip.addr) {
ESP_LOGW(TAG, "IP change, need to reboot");
if(!wait_for_commit()){
ESP_LOGW(TAG,"Unable to commit configuration. ");
}
esp_restart();
}
ip.addr = ipInfo.ip.addr;
ESP_LOGI(TAG, "I have a connection!"); ESP_LOGI(TAG, "I have a connection!");
messaging_post_message(MESSAGING_INFO,MESSAGING_CLASS_SYSTEM,"Wifi connected"); messaging_post_message(MESSAGING_INFO,MESSAGING_CLASS_SYSTEM,"Wifi connected");
xEventGroupSetBits(wifi_event_group, CONNECTED_BIT); xEventGroupSetBits(wifi_event_group, CONNECTED_BIT);
@@ -375,6 +386,7 @@ void app_main()
ESP_LOGI(TAG,"Initializing display"); ESP_LOGI(TAG,"Initializing display");
display_init("SqueezeESP32"); display_init("SqueezeESP32");
if(!is_recovery_running){ if(!is_recovery_running){
ESP_LOGI(TAG,"Checking if certificates need to be updated"); ESP_LOGI(TAG,"Checking if certificates need to be updated");
update_certificates(); update_certificates();

View File

@@ -437,10 +437,10 @@ CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y
# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set # CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
CONFIG_LOG_DEFAULT_LEVEL_INFO=y # CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set # CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=3 CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_COLORS=y CONFIG_LOG_COLORS=y
CONFIG_LWIP_LOCAL_HOSTNAME="espressif" CONFIG_LWIP_LOCAL_HOSTNAME="espressif"
# CONFIG_LWIP_L2_TO_L3_COPY is not set # CONFIG_LWIP_L2_TO_L3_COPY is not set