From 8bc48d37b2c2cb6dc6cd3ffb30799ab11c36b6f7 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 21 Mar 2021 14:33:12 +0100 Subject: [PATCH 1/2] No Discovery --- BUILDS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BUILDS.md b/BUILDS.md index f510ee046..7c8618e39 100644 --- a/BUILDS.md +++ b/BUILDS.md @@ -18,9 +18,9 @@ | USE_WEBSEND_RESPONSE | - | - | - | - | - | - | - | | USE_EMULATION_HUE | - | x | x | - | x | - | - | | USE_EMULATION_WEMO | - | x | x | - | x | - | - | -| USE_DISCOVERY | - | - | x | x | - | - | x | +| USE_DISCOVERY | - | - | - | - | - | - | - | | WEBSERVER_ADVERTISE | - | - | x | x | - | - | x | -| MQTT_HOST_DISCOVERY | - | - | x | x | - | - | x | +| MQTT_HOST_DISCOVERY | - | - | - | - | - | - | - | | USE_TIMERS | - | x | x | x | x | x | x | | USE_TIMERS_WEB | - | x | x | x | x | x | x | | USE_SUNRISE | - | x | x | x | x | x | x | From 8155d2c66a709386599d79a9090f78e634a247fa Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 21 Mar 2021 17:12:10 +0100 Subject: [PATCH 2/2] Minor fixes --- .../Berry-0.1.10/src/port/berry_conf.h | 10 +++++-- tasmota/xdrv_52_3_berry_tasmota.ino | 2 +- tasmota/xdrv_52_9_berry.ino | 28 ++++++++++++++++++- 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lib/libesp32/Berry-0.1.10/src/port/berry_conf.h b/lib/libesp32/Berry-0.1.10/src/port/berry_conf.h index 57fbe6208..74fc7f505 100644 --- a/lib/libesp32/Berry-0.1.10/src/port/berry_conf.h +++ b/lib/libesp32/Berry-0.1.10/src/port/berry_conf.h @@ -163,8 +163,14 @@ * The default is to use the functions in the standard library. **/ #ifdef USE_BERRY_PSRAM - extern void *special_malloc(uint32_t size); - extern void *special_realloc(void *ptr, size_t size); +#ifdef __cplusplus +extern "C" { +#endif + extern void *berry_malloc(uint32_t size); + extern void *berry_realloc(void *ptr, size_t size); +#ifdef __cplusplus +} +#endif #define BE_EXPLICIT_MALLOC special_malloc #define BE_EXPLICIT_REALLOC special_realloc #else diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index bd9e1a8cc..e29382d18 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -317,7 +317,7 @@ extern "C" { int32_t top = be_top(vm); // Get the number of arguments if (top == 1 || (top == 2 && be_isint(vm, 2))) { int32_t light_num = 0; - if (top > 0) { + if (top > 1) { light_num = be_toint(vm, 2); } push_getlight(vm, light_num); diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index dcdeb25b5..df2ba5b6b 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -47,6 +47,32 @@ void checkBeTop(void) { } } +/*********************************************************************************************\ + * Memory handler + * Use PSRAM if available +\*********************************************************************************************/ +extern "C" { + void *berry_malloc(uint32_t size); + void *berry_realloc(void *ptr, size_t size); +#ifdef USE_BERRY_PSRAM + void *berry_malloc(uint32_t size) { + return special_malloc(size); + } + void *berry_realloc(void *ptr, size_t size) { + return special_realloc(ptr, size); + } +#else + void *berry_malloc(uint32_t size) { + return malloc(size); + } + void *berry_realloc(void *ptr, size_t size) { + return realloc(ptr, size); + } +#endif // USE_BERRY_PSRAM + +} + + /*********************************************************************************************\ * Handlers for Berry calls and async * @@ -564,7 +590,7 @@ void HandleBerryConsoleRefresh(void) if (svalue.length()) { berry.log.reset(); // clear all previous logs berry.repl_active = true; // start recording - AddLog_P(LOG_LEVEL_INFO, PSTR("BRY: received command %s"), svalue.c_str()); + // AddLog_P(LOG_LEVEL_INFO, PSTR("BRY: received command %s"), svalue.c_str()); berry.log.addString(svalue.c_str(), nullptr, BERRY_CONSOLE_CMD_DELIMITER); // Call berry