From 1ed8b131bc4a6f1949f93d83fead9925cfe49e9f Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Sun, 16 Aug 2026 01:23:56 +0200 Subject: [PATCH] httpd: keep the send_l2 flags in bit memory The two flags added with the JSON fix sit in data, where internal RAM is full enough that this branch stopped linking for some toolchains. __bit puts them in the bit area instead and hands three bytes back to the stack: SSEG goes from 131 to 134 on SWTGW218AS. Patch by vDorst on the pull request. --- httpd/page_impl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httpd/page_impl.c b/httpd/page_impl.c index 7b12927..bf3e268 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -356,7 +356,7 @@ void send_l2(uint16_t idx) */ __xdata uint16_t entry = idx & 0xfff; __xdata uint16_t first_entry = 0xffff; // An illegal entry index - bool first = true; + __bit first = true; char_to_html('['); while (1) { entries_left--; @@ -370,7 +370,7 @@ void send_l2(uint16_t idx) } while (sfr_data[3] & TBL_EXECUTE); reg_read_m(RTL837x_L2_DATA_OUT_B); - bool valid = (sfr_data[0] & 0x20) != 0; + __bit valid = (sfr_data[0] & 0x20) != 0; if (valid) { /* separator + 74-byte worst-case entry + closing "]" */ if (slen + 76 > TCP_OUTBUF_SIZE)