diff --git a/.cproject b/.cproject
index f2ba4b3b..c6ef1f9b 100644
--- a/.cproject
+++ b/.cproject
@@ -239,7 +239,7 @@
-
+
@@ -386,6 +386,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -407,6 +503,8 @@
+
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index f2d1fea7..219e5f2d 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -59,7 +59,7 @@
-
+
@@ -96,5 +96,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.settings/org.eclipse.cdt.core.prefs b/.settings/org.eclipse.cdt.core.prefs
index 2dd6626d..ed04c167 100644
--- a/.settings/org.eclipse.cdt.core.prefs
+++ b/.settings/org.eclipse.cdt.core.prefs
@@ -24,6 +24,23 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/op
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/PATH/value=C\:/msys2/opt/xtensa-esp32-elf/bin;C\:/jdk-12.0.2/bin/server;C\:/jdk-12.0.2/bin;C\:\\Windows\\system32;C\:\\Windows;C\:\\Windows\\System32\\Wbem;C\:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C\:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C\:\\jdk-12.0.2\\bin;C\:\\Program Files\\PuTTY\\;C\:\\Program Files (x86)\\HP\\IdrsOCR_15.2.10.1114\\;C\:\\eclipse
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/append=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.1476804786/appendContributed=true
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/BATCH_BUILD/delimiter=\:
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/BATCH_BUILD/operation=append
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/BATCH_BUILD/value=1
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/IDF_PATH/delimiter=\:
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/IDF_PATH/operation=replace
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/IDF_PATH/value=C\:/msys32/opt/esp-idf
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PATH/delimiter=\:
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PATH/operation=replace
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PATH/value=C\:\\msys32\\opt\\openocd-esp32\\bin;c\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_NAME/delimiter=\:
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_NAME/operation=replace
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_NAME/value=recovery
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_VER/delimiter=\:
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_VER/operation=append
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/PROJECT_VER/value=custom
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/append=true
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.198620654/appendContributed=true
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/operation=append
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291.395881736/BATCH_BUILD/value=1
@@ -46,10 +63,10 @@ environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.16039962
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/BATCH_BUILD/value=1
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/operation=replace
-environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/value=C\:/msys32/opt/esp-idf
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/IDF_PATH/value=C\:/msys32/opt/esp-idf-v4.0
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/operation=replace
-environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/value=C\:\\msys32\\opt\\openocd-esp32\\bin;c\:\\msys32\\opt\\xtensa-esp32-elf\\bin\\;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl
+environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PATH/value=C\:\\Program Files\\CMake\\bin;C\:\\msys32\\opt\\openocd-esp32\\bin;C\:\\msys32\\opt\\xtensa-esp32-elf-gcc8_2_0\\xtensa-esp32-elf\\bin;c\:\\msys32\\mingw32\\bin;C\:\\msys32\\usr\\bin;c\:\\Python27;C\:\\msys32\\usr\\bin\\vendor_perl;C\:\\msys32\\usr\\bin\\core_perl
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/delimiter=\:
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/operation=replace
environment/project/cdt.managedbuild.toolchain.gnu.cross.base.293933348.1603996291/PROJECT_NAME/value=recovery
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 529885da..71cf367e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,13 @@
cmake_minimum_required(VERSION 3.5)
+set(COMPONENT_ADD_INCLUDEDIRS main components/tools)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
-project(squeezelite-esp32)
\ No newline at end of file
+
+
+
+if(NOT $ENV{PROJECT_NAME} or $ENV{PROJECT_NAME} = "recovery")
+ add_definitions(-DRECOVERY_APPLICATION=1)
+ project(recovery)
+else()
+ add_definitions(-DRECOVERY_APPLICATION=0)
+ project(squeezelite)
+endif()
diff --git a/build-scripts/ESP32-A1S-sdkconfig.defaults b/build-scripts/ESP32-A1S-sdkconfig.defaults
index 026a5c55..700873f0 100644
--- a/build-scripts/ESP32-A1S-sdkconfig.defaults
+++ b/build-scripts/ESP32-A1S-sdkconfig.defaults
@@ -773,13 +773,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/build-scripts/I2S-4MFlash-sdkconfig.defaults b/build-scripts/I2S-4MFlash-sdkconfig.defaults
index 0a855ad3..73f5ec2e 100644
--- a/build-scripts/I2S-4MFlash-sdkconfig.defaults
+++ b/build-scripts/I2S-4MFlash-sdkconfig.defaults
@@ -773,13 +773,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults b/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults
index 11775205..1bf9ba85 100644
--- a/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults
+++ b/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults
@@ -774,13 +774,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults b/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults
index 99e253ff..d5a059b1 100644
--- a/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults
+++ b/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults
@@ -773,13 +773,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults b/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults
index cedc9674..6ec437e1 100644
--- a/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults
+++ b/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults
@@ -773,13 +773,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults b/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults
index 2b21f9f0..2d22287e 100644
--- a/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults
+++ b/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults
@@ -767,13 +767,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
diff --git a/components/cmd_i2c/CMakeLists.txt b/components/cmd_i2c/CMakeLists.txt
deleted file mode 100644
index 14069736..00000000
--- a/components/cmd_i2c/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(COMPONENT_SRCS "cmd_i2ctools.c")
-set(COMPONENT_ADD_INCLUDEDIRS ".")
-set(COMPONENT_REQUIRES console spi_flash)
-
-register_component()
diff --git a/components/cmd_i2c/component.mk b/components/cmd_i2c/component.mk
deleted file mode 100644
index 59d5335c..00000000
--- a/components/cmd_i2c/component.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-#
-# Main Makefile. This is basically the same as a component makefile.
-#
-COMPONENT_ADD_INCLUDEDIRS := .
\ No newline at end of file
diff --git a/components/cmd_nvs/CMakeLists.txt b/components/cmd_nvs/CMakeLists.txt
deleted file mode 100644
index 7c2d3c7d..00000000
--- a/components/cmd_nvs/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-set(COMPONENT_ADD_INCLUDEDIRS .)
-
-set(COMPONENT_SRCS "cmd_nvs.c")
-
-set(COMPONENT_REQUIRES console nvs_flash)
-
-register_component()
diff --git a/components/cmd_nvs/component.mk b/components/cmd_nvs/component.mk
deleted file mode 100644
index a71c86c5..00000000
--- a/components/cmd_nvs/component.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# Component Makefile
-#
-# This Makefile should, at the very least, just include $(SDK_PATH)/Makefile. By default,
-# this will take the sources in the src/ directory, compile them and link them into
-# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
-# please read the SDK documents if you need to do this.
-#
-
-COMPONENT_ADD_INCLUDEDIRS := .
-CFLAGS += -I$(COMPONENT_PATH)/../squeezelite-ota
-COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
-COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main
diff --git a/components/cmd_system/CMakeLists.txt b/components/cmd_system/CMakeLists.txt
deleted file mode 100644
index b45a40c3..00000000
--- a/components/cmd_system/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-set(COMPONENT_ADD_INCLUDEDIRS .)
-
-set(COMPONENT_SRCS "cmd_system.c")
-
-set(COMPONENT_REQUIRES console spi_flash)
-
-register_component()
diff --git a/components/cmd_system/component.mk b/components/cmd_system/component.mk
deleted file mode 100644
index 93ab014b..00000000
--- a/components/cmd_system/component.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Component Makefile
-#
-# This Makefile should, at the very least, just include $(SDK_PATH)/Makefile. By default,
-# this will take the sources in the src/ directory, compile them and link them into
-# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable,
-# please read the SDK documents if you need to do this.
-#
-
-COMPONENT_ADD_INCLUDEDIRS := .
-COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/main/
-COMPONENT_EXTRA_INCLUDES += $(PROJECT_PATH)/components/tools/
\ No newline at end of file
diff --git a/components/display/CMakeLists.txt b/components/display/CMakeLists.txt
index 4672e0c6..df10a103 100644
--- a/components/display/CMakeLists.txt
+++ b/components/display/CMakeLists.txt
@@ -1,5 +1,5 @@
-idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS
- INCLUDE_DIRS . ../tools/
+idf_component_register(SRCS "display.c" "SH1106.c" "SSD1306.c" "SSD132x.c" "core/ifaces/default_if_i2c.c" "core/ifaces/default_if_spi.c" "core/gds_draw.c" "core/gds_font.c" "core/gds_image.c" "core/gds_text.c" "core/gds.c" "fonts/font_droid_sans_fallback_11x13.c" "fonts/font_droid_sans_fallback_15x17.c" "fonts/font_droid_sans_fallback_24x28.c" "fonts/font_droid_sans_mono_13x24.c" "fonts/font_droid_sans_mono_16x31.c" "fonts/font_droid_sans_mono_7x13.c"
+ INCLUDE_DIRS . fonts core
)
diff --git a/components/display/display.c b/components/display/display.c
index a1cb0e4d..98a95b5e 100644
--- a/components/display/display.c
+++ b/components/display/display.c
@@ -23,7 +23,7 @@
#include
#include "esp_log.h"
#include "globdefs.h"
-#include "config.h"
+#include "platform_config.h"
#include "tools.h"
#include "display.h"
#include "gds.h"
@@ -371,4 +371,4 @@ void displayer_control(enum displayer_cmd_e cmd, ...) {
xSemaphoreGive(displayer.mutex);
va_end(args);
-}
\ No newline at end of file
+}
diff --git a/components/driver_bt/CMakeLists.txt b/components/driver_bt/CMakeLists.txt
index 7c31465a..32f96ab5 100644
--- a/components/driver_bt/CMakeLists.txt
+++ b/components/driver_bt/CMakeLists.txt
@@ -1,6 +1,6 @@
idf_component_register(SRCS "bt_app_core.c" "bt_app_sink.c" "bt_app_source.c"
INCLUDE_DIRS "." "../tools/"
REQUIRES esp_common
- PRIV_REQUIRES freertos bt io nvs_flash esp32 spi_flash newlib log console pthread
+ PRIV_REQUIRES freertos bt nvs_flash esp32 spi_flash newlib log console pthread
)
diff --git a/components/driver_bt/bt_app_sink.c b/components/driver_bt/bt_app_sink.c
index 7159e6ff..5e2cc5c2 100644
--- a/components/driver_bt/bt_app_sink.c
+++ b/components/driver_bt/bt_app_sink.c
@@ -22,7 +22,7 @@
#include "esp_a2dp_api.h"
#include "esp_avrc_api.h"
#include "nvs.h"
-#include "config.h"
+#include "platform_config.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "trace.h"
diff --git a/components/driver_bt/bt_app_source.c b/components/driver_bt/bt_app_source.c
index dd4254da..7d00c113 100644
--- a/components/driver_bt/bt_app_source.c
+++ b/components/driver_bt/bt_app_source.c
@@ -15,7 +15,7 @@
#include "esp_wifi.h"
#include "freertos/timers.h"
#include "argtable3/argtable3.h"
-#include "config.h"
+#include "platform_config.h"
#include "bt_app_core.h"
#include "trace.h"
diff --git a/components/config/component.mk b/components/platform_config/component.mk
similarity index 100%
rename from components/config/component.mk
rename to components/platform_config/component.mk
diff --git a/components/config/nvs_utilities.c b/components/platform_config/nvs_utilities.c
similarity index 99%
rename from components/config/nvs_utilities.c
rename to components/platform_config/nvs_utilities.c
index 8627ed75..90152069 100644
--- a/components/config/nvs_utilities.c
+++ b/components/platform_config/nvs_utilities.c
@@ -10,11 +10,11 @@
#include "driver/uart.h"
#include "linenoise/linenoise.h"
#include "argtable3/argtable3.h"
-#include "esp_vfs_fat.h"
+
#include "nvs.h"
#include "nvs_flash.h"
#include "nvs_utilities.h"
-#include "config.h"
+#include "platform_config.h"
const char current_namespace[] = "config";
const char settings_partition[] = "settings";
diff --git a/components/config/nvs_utilities.h b/components/platform_config/nvs_utilities.h
similarity index 100%
rename from components/config/nvs_utilities.h
rename to components/platform_config/nvs_utilities.h
diff --git a/components/config/config.c b/components/platform_config/platform_config.c
similarity index 99%
rename from components/config/config.c
rename to components/platform_config/platform_config.c
index 74c22f0f..1302f228 100644
--- a/components/config/config.c
+++ b/components/platform_config/platform_config.c
@@ -19,7 +19,7 @@
*
*/
//#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
-#include "config.h"
+#include "platform_config.h"
#include "nvs_utilities.h"
#include
@@ -31,7 +31,7 @@
#include "driver/uart.h"
#include "linenoise/linenoise.h"
#include "argtable3/argtable3.h"
-#include "esp_vfs_fat.h"
+
#include "nvs.h"
#include "nvs_flash.h"
#include "nvs_utilities.h"
diff --git a/components/config/config.h b/components/platform_config/platform_config.h
similarity index 100%
rename from components/config/config.h
rename to components/platform_config/platform_config.h
diff --git a/main/cmd_decl.h b/components/platform_console/cmd_decl.h
similarity index 100%
rename from main/cmd_decl.h
rename to components/platform_console/cmd_decl.h
diff --git a/components/cmd_i2c/cmd_i2ctools.c b/components/platform_console/cmd_i2ctools.c
similarity index 99%
rename from components/cmd_i2c/cmd_i2ctools.c
rename to components/platform_console/cmd_i2ctools.c
index 5ec0a53d..45ffeaa6 100644
--- a/components/cmd_i2c/cmd_i2ctools.c
+++ b/components/platform_console/cmd_i2ctools.c
@@ -15,7 +15,7 @@
#include "esp_log.h"
#include "string.h"
#include "stdio.h"
-#include "config.h"
+#include "platform_config.h"
#include "accessors.h"
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
diff --git a/components/cmd_i2c/cmd_i2ctools.h b/components/platform_console/cmd_i2ctools.h
similarity index 100%
rename from components/cmd_i2c/cmd_i2ctools.h
rename to components/platform_console/cmd_i2ctools.h
diff --git a/components/cmd_nvs/cmd_nvs.c b/components/platform_console/cmd_nvs.c
similarity index 100%
rename from components/cmd_nvs/cmd_nvs.c
rename to components/platform_console/cmd_nvs.c
diff --git a/components/cmd_nvs/cmd_nvs.h b/components/platform_console/cmd_nvs.h
similarity index 100%
rename from components/cmd_nvs/cmd_nvs.h
rename to components/platform_console/cmd_nvs.h
diff --git a/components/squeezelite-ota/cmd_ota.c b/components/platform_console/cmd_ota.c
similarity index 100%
rename from components/squeezelite-ota/cmd_ota.c
rename to components/platform_console/cmd_ota.c
diff --git a/components/squeezelite-ota/cmd_ota.h b/components/platform_console/cmd_ota.h
similarity index 100%
rename from components/squeezelite-ota/cmd_ota.h
rename to components/platform_console/cmd_ota.h
diff --git a/main/cmd_squeezelite.c b/components/platform_console/cmd_squeezelite.c
similarity index 100%
rename from main/cmd_squeezelite.c
rename to components/platform_console/cmd_squeezelite.c
diff --git a/main/cmd_squeezelite.h b/components/platform_console/cmd_squeezelite.h
similarity index 100%
rename from main/cmd_squeezelite.h
rename to components/platform_console/cmd_squeezelite.h
diff --git a/components/cmd_system/cmd_system.c b/components/platform_console/cmd_system.c
similarity index 99%
rename from components/cmd_system/cmd_system.c
rename to components/platform_console/cmd_system.c
index 4b8b7b82..1921cb4a 100644
--- a/components/cmd_system/cmd_system.c
+++ b/components/platform_console/cmd_system.c
@@ -26,7 +26,7 @@
#include "esp_partition.h"
#include "esp_ota_ops.h"
#include "platform_esp32.h"
-#include "config.h"
+#include "platform_config.h"
#include "esp_sleep.h"
#include "driver/uart.h" // for the uart driver access
diff --git a/components/cmd_system/cmd_system.h b/components/platform_console/cmd_system.h
similarity index 100%
rename from components/cmd_system/cmd_system.h
rename to components/platform_console/cmd_system.h
diff --git a/main/cmd_wifi.c b/components/platform_console/cmd_wifi.c
similarity index 100%
rename from main/cmd_wifi.c
rename to components/platform_console/cmd_wifi.c
diff --git a/main/cmd_wifi.h b/components/platform_console/cmd_wifi.h
similarity index 100%
rename from main/cmd_wifi.h
rename to components/platform_console/cmd_wifi.h
diff --git a/main/console.c b/components/platform_console/platform_console.c
similarity index 99%
rename from main/console.c
rename to components/platform_console/platform_console.c
index 2b83d68d..0c84fc55 100644
--- a/main/console.c
+++ b/components/platform_console/platform_console.c
@@ -7,6 +7,8 @@
CONDITIONS OF ANY KIND, either express or implied.
*/
+#include "platform_console.h"
+
#include
#include
#include
@@ -23,11 +25,10 @@
#include "platform_esp32.h"
#include "esp_pthread.h"
#include "cmd_decl.h"
-#include "console.h"
#include "wifi_manager.h"
#include "cmd_squeezelite.h"
-#include "config.h"
+#include "platform_config.h"
pthread_t thread_console;
static void * console_thread();
void console_start();
diff --git a/main/console.h b/components/platform_console/platform_console.h
similarity index 100%
rename from main/console.h
rename to components/platform_console/platform_console.h
diff --git a/components/raop/raop_sink.c b/components/raop/raop_sink.c
index 1424e94f..3556f9a5 100644
--- a/components/raop/raop_sink.c
+++ b/components/raop/raop_sink.c
@@ -11,7 +11,7 @@
#include "esp_pthread.h"
#include "esp_system.h"
#include "freertos/timers.h"
-#include "config.h"
+#include "platform_config.h"
#include "raop.h"
#include "audio_controls.h"
#include "display.h"
diff --git a/components/services/CMakeLists.txt b/components/services/CMakeLists.txt
index 4672e0c6..db23404d 100644
--- a/components/services/CMakeLists.txt
+++ b/components/services/CMakeLists.txt
@@ -1,6 +1,7 @@
-idf_component_register(SRCS "led.c" "audio_controls.c" "buttons.c" "services.c" "monitor.c"INCLUDE_DIRS
+idf_component_register(SRCS "accessors.c" "led.c" "audio_controls.c" "battery.c" "buttons.c" "services.c" "monitor.c" "rotary_encoder.c"
INCLUDE_DIRS . ../tools/
-
+ REQUIRES json platform_config
+
)
diff --git a/components/services/accessors.c b/components/services/accessors.c
index cd274476..7d57f479 100644
--- a/components/services/accessors.c
+++ b/components/services/accessors.c
@@ -11,7 +11,7 @@
#include "driver/gpio.h"
#include "driver/i2c.h"
#include "driver/spi_master.h"
-#include "config.h"
+#include "platform_config.h"
#include "accessors.h"
#include "globdefs.h"
@@ -104,4 +104,4 @@ void parse_set_GPIO(void (*cb)(int gpio, char *value)) {
} while (p++);
free(nvs_item);
-}
\ No newline at end of file
+}
diff --git a/components/services/audio_controls.c b/components/services/audio_controls.c
index 8bcd9887..a525eee6 100644
--- a/components/services/audio_controls.c
+++ b/components/services/audio_controls.c
@@ -26,7 +26,7 @@
#include "esp_log.h"
#include "cJSON.h"
#include "buttons.h"
-#include "config.h"
+#include "platform_config.h"
#include "audio_controls.h"
typedef esp_err_t (actrls_config_map_handler) (const cJSON * member, actrls_config_t *cur_config,uint32_t offset);
diff --git a/components/services/battery.c b/components/services/battery.c
index 1af4a69a..45c99b20 100644
--- a/components/services/battery.c
+++ b/components/services/battery.c
@@ -16,7 +16,7 @@
#include "esp_log.h"
#include "driver/adc.h"
#include "battery.h"
-#include "config.h"
+#include "platform_config.h"
/*
There is a bug in esp32 which causes a spurious interrupt on gpio 36/39 when
diff --git a/components/services/monitor.c b/components/services/monitor.c
index 4b56dbe5..a0ab4c4a 100644
--- a/components/services/monitor.c
+++ b/components/services/monitor.c
@@ -19,7 +19,7 @@
#include "buttons.h"
#include "led.h"
#include "globdefs.h"
-#include "config.h"
+#include "platform_config.h"
#include "accessors.h"
#define MONITOR_TIMER (10*1000)
diff --git a/components/services/services.c b/components/services/services.c
index 6538f128..fa88d4d8 100644
--- a/components/services/services.c
+++ b/components/services/services.c
@@ -10,7 +10,7 @@
#include "esp_log.h"
#include "driver/gpio.h"
#include
-#include "config.h"
+#include "platform_config.h"
#include "battery.h"
#include "led.h"
#include "monitor.h"
@@ -95,4 +95,4 @@ void services_init(void) {
led_svc_init();
battery_svc_init();
monitor_svc_init();
-}
\ No newline at end of file
+}
diff --git a/components/squeezelite-ota/squeezelite-ota.c b/components/squeezelite-ota/squeezelite-ota.c
index ef840ab5..0527cdf4 100644
--- a/components/squeezelite-ota/squeezelite-ota.c
+++ b/components/squeezelite-ota/squeezelite-ota.c
@@ -23,7 +23,7 @@
#include "esp_err.h"
#include "tcpip_adapter.h"
#include "squeezelite-ota.h"
-#include "config.h"
+#include "platform_config.h"
#include
#include
#include
diff --git a/components/squeezelite/decode_external.c b/components/squeezelite/decode_external.c
index 23c0fc08..6caed665 100644
--- a/components/squeezelite/decode_external.c
+++ b/components/squeezelite/decode_external.c
@@ -19,7 +19,7 @@
*
*/
-#include "config.h"
+#include "platform_config.h"
#include "squeezelite.h"
#include "bt_app_sink.h"
#include "raop_sink.h"
diff --git a/components/squeezelite/external/dac_external.c b/components/squeezelite/external/dac_external.c
index 49c5bf69..90c2b3b9 100644
--- a/components/squeezelite/external/dac_external.c
+++ b/components/squeezelite/external/dac_external.c
@@ -23,7 +23,7 @@
#include
#include
#include "esp_log.h"
-#include "config.h"
+#include "platform_config.h"
#include "adac.h"
static bool init(int i2c_port_num, int i2s_num, i2s_config_t *config);
diff --git a/components/squeezelite/output_bt.c b/components/squeezelite/output_bt.c
index e4c5ba1a..3295baa7 100644
--- a/components/squeezelite/output_bt.c
+++ b/components/squeezelite/output_bt.c
@@ -22,7 +22,7 @@
#include "driver/gpio.h"
#include "squeezelite.h"
#include "perf_trace.h"
-#include "config.h"
+#include "platform_config.h"
extern struct outputstate output;
extern struct buffer *outputbuf;
@@ -195,4 +195,4 @@ void output_bt_tick(void) {
LOG_INFO(" ==========+==========+===========+===========+");
RESET_ALL_MIN_MAX;
}
-}
\ No newline at end of file
+}
diff --git a/components/squeezelite/output_i2s.c b/components/squeezelite/output_i2s.c
index 1a05a498..dd2ccda0 100644
--- a/components/squeezelite/output_i2s.c
+++ b/components/squeezelite/output_i2s.c
@@ -51,7 +51,7 @@ sure that using rate_delay would fix that
#include "time.h"
#include "led.h"
#include "monitor.h"
-#include "config.h"
+#include "platform_config.h"
#include "accessors.h"
#include "globdefs.h"
diff --git a/components/telnet/telnet.c b/components/telnet/telnet.c
index 552c678e..23d846a0 100644
--- a/components/telnet/telnet.c
+++ b/components/telnet/telnet.c
@@ -18,9 +18,9 @@
* https://github.com/PocketSprite/8bkc-sdk/blob/master/8bkc-components/8bkc-hal/vfs-stdout.c
*
*/
-#include // Required for libtelnet.h
+#include // Required for CONFIG_PTHREAD_TASK_PRIO_DEFAULT.h
#include
-#include "libtelnet.h"
+#include "CONFIG_PTHREAD_TASK_PRIO_DEFAULT.h"
#include "stdbool.h"
#include
#include
@@ -35,7 +35,7 @@
#include "esp_attr.h"
#include "soc/uart_struct.h"
#include "driver/uart.h"
-#include "config.h"
+#include "platform_config.h"
#include "nvs_utilities.h"
#include "platform_esp32.h"
diff --git a/main/platform_esp32.h b/components/tools/platform_esp32.h
similarity index 100%
rename from main/platform_esp32.h
rename to components/tools/platform_esp32.h
diff --git a/components/wifi-manager/CMakeLists.txt b/components/wifi-manager/CMakeLists.txt
index 4fc70049..cad513cb 100644
--- a/components/wifi-manager/CMakeLists.txt
+++ b/components/wifi-manager/CMakeLists.txt
@@ -1,7 +1,7 @@
idf_component_register(SRCS "dns_server.c" "http_server.c" "wifi_manager.c"
INCLUDE_DIRS .
- REQUIRES esp_common
- PRIV_REQUIRES newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant cmd_system
+ REQUIRES esp_common newlib freertos spi_flash nvs_flash mdns pthread wpa_supplicant platform_console squeezelite-ota
+
EMBED_FILES style.css code.js index.html bootstrap.min.css.gz jquery.min.js.gz popper.min.js.gz bootstrap.min.js.gz
diff --git a/components/wifi-manager/http_server.c b/components/wifi-manager/http_server.c
index a5f8df2a..0cce4f10 100644
--- a/components/wifi-manager/http_server.c
+++ b/components/wifi-manager/http_server.c
@@ -42,7 +42,7 @@ function to process requests, decode URLs, serve files, etc. etc.
#include "esp_system.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
-#include "config.h"
+#include "platform_config.h"
#define HTTP_STACK_SIZE (5*1024)
diff --git a/components/wifi-manager/wifi_manager.c b/components/wifi-manager/wifi_manager.c
index 4acbda23..5ea12881 100644
--- a/components/wifi-manager/wifi_manager.c
+++ b/components/wifi-manager/wifi_manager.c
@@ -58,7 +58,7 @@ Contains the freeRTOS task and all necessary support
#include "esp_ota_ops.h"
#include "esp_app_format.h"
#include "cJSON.h"
-#include "config.h"
+#include "platform_config.h"
#include "trace.h"
#include "cmd_system.h"
#include "monitor.h"
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 71b1bcdd..495ff884 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -1,8 +1,4 @@
-set(COMPONENT_ADD_INCLUDEDIRS . )
-
-set(COMPONENT_SRCS "esp_app_main.c" "platform_esp32.c" "cmd_wifi.c" "console.c" "nvs_utilities.c" "cmd_squeezelite.c" "config.c")
-set(REQUIRES esp_common)
-set(REQUIRES_COMPONENTS freertos squeezelite nvs_flash esp32 spi_flash newlib log console ota tools )
-
-
-register_component()
+idf_component_register(SRCS "esp_app_main.c"
+ REQUIRES esp_common pthread squeezelite-ota platform_console
+ INCLUDE_DIRS .
+ )
\ No newline at end of file
diff --git a/main/esp_app_main.c b/main/esp_app_main.c
index f361874b..b343a41c 100644
--- a/main/esp_app_main.c
+++ b/main/esp_app_main.c
@@ -45,7 +45,7 @@
#include "wifi_manager.h"
#include "squeezelite-ota.h"
#include
-#include "config.h"
+#include "platform_config.h"
#include "audio_controls.h"
#include "telnet.h"
diff --git a/sdkconfig.defaults b/sdkconfig.defaults
index ba1d6f53..cf9257aa 100644
--- a/sdkconfig.defaults
+++ b/sdkconfig.defaults
@@ -741,13 +741,13 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
-CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
-CONFIG_ESP32_PTHREAD_STACK_MIN=768
+CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
+CONFIG_PTHREAD_STACK_MIN=768
-CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1=y
-CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=1
-CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"
+CONFIG_PTHREAD_DEFAULT_CORE_1=y
+CONFIG_PTHREAD_TASK_CORE_DEFAULT=1
+CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread"
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y