From 1e64eaddf3941643378d978676ed0488d0fecbda Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:50:43 +0200 Subject: [PATCH] Berry `webserver.content_close()` (#21276) --- CHANGELOG.md | 1 + lib/libesp32/berry_tasmota/src/be_webserver_lib.c | 2 ++ tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e74ad417f..8a7d49481 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - esp32_partition_app3904k_fs3392k partition scheme for 8MB ESP32S3 - TCP Tx En GPIO type +- Berry `webserver.content_close()` ### Breaking Changed - ESP32-C3 OTA binary name from `tasmota32c3cdc.bin` to `tasmota32c3.bin` with USB HWCDC and fallback to serial (#21212) diff --git a/lib/libesp32/berry_tasmota/src/be_webserver_lib.c b/lib/libesp32/berry_tasmota/src/be_webserver_lib.c index 279b1fb05..49aa105ff 100644 --- a/lib/libesp32/berry_tasmota/src/be_webserver_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_webserver_lib.c @@ -25,6 +25,7 @@ extern int w_webserver_content_response(bvm *vm); extern int w_webserver_content_send_style(bvm *vm); extern int w_webserver_content_flush(bvm *vm); extern int w_webserver_content_stop(bvm *vm); +extern int w_webserver_content_close(bvm *vm); extern int w_webserver_content_button(bvm *vm); extern int w_webserver_html_escape(bvm *vm); @@ -153,6 +154,7 @@ module webserver (scope: global) { content_open, func(w_webserver_content_open) content_start, func(w_webserver_content_start) content_stop, func(w_webserver_content_stop) + content_close, func(w_webserver_content_close) content_button, func(w_webserver_content_button) html_escape, func(w_webserver_html_escape) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino index ca05a02de..970e262fc 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webserver.ino @@ -249,6 +249,14 @@ extern "C" { be_return_nil(vm); } + // Berry: `webserver.content_close() -> nil` + // + int32_t w_webserver_content_close(struct bvm *vm); + int32_t w_webserver_content_close(struct bvm *vm) { + WSContentEnd(); + be_return_nil(vm); + } + // Berry: `webserver.content_button([button:int]) -> nil` // Default button is BUTTON_MAIN //