diff --git a/src/common.h b/src/common.h index 5a21a3a9..1a01d376 100644 --- a/src/common.h +++ b/src/common.h @@ -1,5 +1,5 @@ // created: 10.Feb.2022 -// updated: 10.Jun 2024 +// updated: 11.Jun 2024 #pragma once #pragma GCC optimize("Os") // optimize for code size @@ -21,13 +21,13 @@ #define SDMMC_FREQUENCY 80000000 // 80000000 or 40000000 MHz #define FTP_USERNAME "esp32" // user and pw in FTP Client #define FTP_PASSWORD "esp32" -#define CONN_TIMEOUT 1000 // unencrypted connection timeout in ms (http://...) +#define CONN_TIMEOUT 1000 // unencrypted connection timeout in ms (http://...) #define CONN_TIMEOUT_SSL 2500 // encrypted connection timeout in ms (https://...) //———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— #include -#include +// #include #include #include #include @@ -1772,7 +1772,10 @@ class dlnaList{ bool maybe_a_folder = false; m_clicked = false; // ignore tp released event, wait of next clicked m_itemListPos = (y / (m_h / 10)); - if(m_itemListPos < 2 || m_itemListPos > 11) goto exit; // oor, is header, footer or return item + if(m_itemListPos == 0) goto exit; // is header + if(m_itemListPos == 1) {log_i("long pressed at return item %s", m_dlnaHistory[*m_dlnaLevel].name); goto exit;} + if(m_itemListPos >= 11) goto exit; // is footer + m_itemListPos -= 2; if(*m_dlnaLevel == 0){ @@ -1789,7 +1792,7 @@ class dlnaList{ } if(maybe_a_file){ - if(startsWith(m_srvContent.itemURL[m_itemListPos - 1], "http")){ + if(startsWith(m_srvContent.itemURL[m_itemListPos], "http")){ log_i("long pressed at file %s", m_srvContent.itemURL[m_itemListPos]); goto exit; } diff --git a/src/main.cpp b/src/main.cpp index c6f6e721..c280e2a1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1554,8 +1554,8 @@ void setup() { strcpy(_myIP, WiFi.localIP().toString().c_str()); SerialPrintfln("setup: .... connected to " ANSI_ESC_CYAN "%s" ANSI_ESC_WHITE ", IP address is " ANSI_ESC_CYAN "%s", WiFi.SSID().c_str(), _myIP); - ArduinoOTA.setHostname("MiniWebRadio"); - ArduinoOTA.begin(); + // ArduinoOTA.setHostname("MiniWebRadio"); + // ArduinoOTA.begin(); ftpSrv.begin(SD_MMC, FTP_USERNAME, FTP_PASSWORD); // username, password for ftp. @@ -2404,7 +2404,7 @@ void loop() { ir.loop(); tp.loop(); ftpSrv.handleFTP(); - ArduinoOTA.handle(); +// ArduinoOTA.handle(); dlna.loop(); bt_emitter.loop(); @@ -2704,6 +2704,7 @@ void audio_info(const char* info) { log_w("disconnected, wait 35s"); vTaskDelay(35000 / portTICK_PERIOD_MS); log_w("try reconnection"); + _reconnectCnt = 0; _f_reconnect = true; }return;} if(startsWith(info, "FLAC")) {SerialPrintflnCut("AUDIO_info: ", ANSI_ESC_GREEN, info); return;}