mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-05-02 03:19:29 +01:00
style: apply clang-format and enforce left pointer alignment
This commit is contained in:
@@ -68,7 +68,7 @@ void cb_connection_got_ip(nm_state_t new_state, int sub_state) {
|
||||
static ip4_addr_t ip;
|
||||
tcpip_adapter_ip_info_t ipInfo;
|
||||
network_get_ip_info(&ipInfo);
|
||||
if (ip.addr && ipInfo.ip.addr != ip.addr) {
|
||||
if(ip.addr && ipInfo.ip.addr != ip.addr) {
|
||||
config_raise_changed(false);
|
||||
ESP_LOGW(TAG, "IP change, need to reboot");
|
||||
simple_restart();
|
||||
@@ -78,13 +78,12 @@ void cb_connection_got_ip(nm_state_t new_state, int sub_state) {
|
||||
network_get_hostname(&hostname);
|
||||
mdns_init();
|
||||
mdns_hostname_set(hostname);
|
||||
|
||||
|
||||
ESP_LOGI(TAG, "Network connected and mDNS initialized with %s", hostname);
|
||||
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_SYSTEM, "Network connected");
|
||||
|
||||
led_unpush(LED_GREEN);
|
||||
if (is_recovery_running) {
|
||||
if(is_recovery_running) {
|
||||
// when running in recovery, send a LMS discovery message
|
||||
// to find a running instance. This is to enable using
|
||||
// the plugin's proxy mode for FW download and avoid
|
||||
@@ -141,20 +140,18 @@ void app_main() {
|
||||
TRACE_INIT;
|
||||
ESP_LOGI(TAG, "Starting app_main");
|
||||
init_spiffs();
|
||||
if (esp_log_level_get(TAG) >= ESP_LOG_DEBUG) {
|
||||
listFiles("/spiffs");
|
||||
}
|
||||
if(esp_log_level_get(TAG) >= ESP_LOG_DEBUG) { listFiles("/spiffs"); }
|
||||
|
||||
// now that the spiffs is initialized, we can load the
|
||||
// now that the spiffs is initialized, we can load the
|
||||
// core configuration system, which is needed by
|
||||
// most of the other system components
|
||||
config_load();
|
||||
if (!platform) {
|
||||
if(!platform) {
|
||||
ESP_LOGE(TAG, "Invalid configuration object. Cannot continue");
|
||||
config_erase_config();
|
||||
}
|
||||
|
||||
// initialize SPI/I2C and gpios/gpio expansion modules
|
||||
|
||||
// initialize SPI/I2C and gpios/gpio expansion modules
|
||||
// now as they may be required for hardware access by
|
||||
// ethernet, etc. later
|
||||
services_ports_init();
|
||||
@@ -164,7 +161,6 @@ void app_main() {
|
||||
// as various subsequent init steps will post events to the queue
|
||||
initialize_network();
|
||||
|
||||
|
||||
#if defined(CONFIG_WITH_METRICS)
|
||||
ESP_LOGI(TAG, "Setting up metrics.");
|
||||
metrics_init();
|
||||
@@ -173,30 +169,26 @@ void app_main() {
|
||||
services_init();
|
||||
display_init("SqueezeESP32");
|
||||
|
||||
if (platform->target && strlen(platform->target) > 0) {
|
||||
target_init(platform->target);
|
||||
}
|
||||
if(platform->target && strlen(platform->target) > 0) { target_init(platform->target); }
|
||||
led_vu_init();
|
||||
if (is_recovery_running) {
|
||||
if (display) {
|
||||
if(is_recovery_running) {
|
||||
if(display) {
|
||||
ESP_LOGD(TAG, "Writing to display");
|
||||
GDS_ClearExt(display, true);
|
||||
GDS_SetFont(display, Font_line_2);
|
||||
GDS_TextPos(display, GDS_FONT_DEFAULT, GDS_TEXT_CENTERED, GDS_TEXT_CLEAR | GDS_TEXT_UPDATE, "RECOVERY");
|
||||
}
|
||||
if (led_display) {
|
||||
led_vu_color_yellow(LED_VU_BRIGHT);
|
||||
}
|
||||
if(led_display) { led_vu_color_yellow(LED_VU_BRIGHT); }
|
||||
}
|
||||
#if defined(CONFIG_WITH_METRICS)
|
||||
metrics_event_boot(is_recovery_running ? "recovery" : "ota");
|
||||
#endif
|
||||
|
||||
if (!is_recovery_running) {
|
||||
if(!is_recovery_running) {
|
||||
ESP_LOGD(TAG, "Getting audio control mapping ");
|
||||
if (platform && platform->has_dev && platform->dev.root_button_profile && strlen(platform->dev.root_button_profile) > 0) {
|
||||
if(platform && platform->has_dev && platform->dev.root_button_profile && strlen(platform->dev.root_button_profile) > 0) {
|
||||
ESP_LOGD(TAG, "Initializing audio control buttons type %s", platform->dev.root_button_profile);
|
||||
if (actrls_init(platform->dev.root_button_profile) == ESP_OK) {
|
||||
if(actrls_init(platform->dev.root_button_profile) == ESP_OK) {
|
||||
ESP_LOGD(TAG, "Done Initializing audio control buttons type %s", platform->dev.root_button_profile);
|
||||
} else {
|
||||
ESP_LOGD(TAG, "No audio control buttons");
|
||||
@@ -205,9 +197,7 @@ void app_main() {
|
||||
}
|
||||
|
||||
led_blink_pushed(LED_GREEN, 250, 250);
|
||||
if (!is_recovery_running) {
|
||||
start_squeezelite();
|
||||
}
|
||||
if(!is_recovery_running) { start_squeezelite(); }
|
||||
console_start();
|
||||
services_sleep_init();
|
||||
messaging_post_message(MESSAGING_INFO, MESSAGING_CLASS_SYSTEM, "System started");
|
||||
|
||||
Reference in New Issue
Block a user