From 3b138e08a3343b0d535de2d10d8d8d827e099148 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:27:56 +0100 Subject: [PATCH 1/2] Custom Minimal esp32 --- lib/libesp32/berry_tasmota/src/be_port.cpp | 12 +++++++----- tasmota/my_user_config.h | 8 ++++---- tasmota/tasmota_configurations.h | 15 +++++++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/lib/libesp32/berry_tasmota/src/be_port.cpp b/lib/libesp32/berry_tasmota/src/be_port.cpp index 5da10f47e..4204c2171 100644 --- a/lib/libesp32/berry_tasmota/src/be_port.cpp +++ b/lib/libesp32/berry_tasmota/src/be_port.cpp @@ -101,6 +101,7 @@ BERRY_API void be_writebuffer(const char *buffer, size_t length) extern "C" { int m_path_listdir(bvm *vm) { +#ifdef USE_UFILESYS if (be_top(vm) >= 1 && be_isstring(vm, 1)) { const char *path = be_tostring(vm, 1); be_newobject(vm, "list"); @@ -126,6 +127,7 @@ extern "C" { be_return(vm); } +#endif // USE_UFILESYS be_return_nil(vm); } } @@ -136,10 +138,9 @@ BERRY_API char* be_readstring(char *buffer, size_t size) } /* use the standard library implementation file API. */ - +#ifdef USE_UFILESYS void* be_fopen(const char *filename, const char *modes) { -#ifdef USE_UFILESYS if (filename != nullptr && modes != nullptr) { char fname2[strlen(filename) + 2]; if (filename[0] == '/') { @@ -156,23 +157,24 @@ void* be_fopen(const char *filename, const char *modes) return f_ptr; } } -#endif // USE_UFILESYS return nullptr; // return fopen(filename, modes); } +#endif // USE_UFILESYS + +#ifdef USE_UFILESYS // Tasmota specific, get the underlying Arduino File File * be_get_arduino_file(void *hfile) { -#ifdef USE_UFILESYS if (hfile != nullptr) { File * f_ptr = (File*) hfile; return f_ptr; } -#endif // USE_UFILESYS return nullptr; // return fopen(filename, modes); } +#endif int be_fclose(void *hfile) { diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 55c20d72d..77cdacb54 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -1095,10 +1095,6 @@ * No user configurable items below \*********************************************************************************************/ -#ifdef USE_CONFIG_OVERRIDE - #include "user_config_override.h" // Configuration overrides for my_user_config.h -#endif - #if defined(USE_DISCOVERY) && (defined(USE_MQTT_AWS_IOT) || defined(USE_MQTT_AWS_IOT_LIGHT)) #error "Select either USE_DISCOVERY or USE_MQTT_AWS_IOT, mDNS takes too much code space and is not needed for AWS IoT" #endif @@ -1131,4 +1127,8 @@ #define USE_TLS // flag indicates we need to include TLS code #endif +#ifdef USE_CONFIG_OVERRIDE + #include "user_config_override.h" // Configuration overrides for my_user_config.h +#endif + #endif // _MY_USER_CONFIG_H_ diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index d60d1ca44..f3d951c5c 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -920,6 +920,21 @@ #undef FIRMWARE_KNX_NO_EMULATION // Disable tasmota-knx with KNX but without Emulation #undef FIRMWARE_DISPLAYS // Disable tasmota-display with display drivers enabled #undef FIRMWARE_IR // Disable tasmota-ir with IR full protocols activated +#undef FIRMWARE_WEBCAM +#undef FIRMWARE_ODROID_GO +#undef FIRMWARE_M5STACK_CORE2 +#undef FIRMWARE_BLUETOOTH +#undef FIRMWARE_LVGL +#undef FIRMWARE_TASMOTA32 +#undef USE_UFILESYS +#undef GUI_TRASH_FILE +#undef GUI_EDIT_FILE +#undef USE_PING +#undef USE_AUTOCONF +#undef USE_BERRY +#undef USE_WEBCLIENT +#undef USE_WEBCLIENT_HTTPS +#undef USE_TLS #endif // FIRMWARE_MINICUSTOM From d6e3747e4c521d4c62b4710518524399c884347e Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:02:55 +0100 Subject: [PATCH 2/2] Update tasmota_configurations.h --- tasmota/tasmota_configurations.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index f3d951c5c..18bbd4d18 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -934,7 +934,7 @@ #undef USE_BERRY #undef USE_WEBCLIENT #undef USE_WEBCLIENT_HTTPS -#undef USE_TLS +//#undef USE_TLS // needed for MQTT over TLS #endif // FIRMWARE_MINICUSTOM