From 723d16b4cb7680685d9e79a35ed8a722dd1d2390 Mon Sep 17 00:00:00 2001 From: Kamikaze94 Date: Mon, 19 Oct 2026 18:32:37 +0200 Subject: [PATCH 1/6] WebUI: Fix port strip icon for sfp ports --- html/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/app.js b/html/app.js index 1599e3f0..f21aa7dc 100644 --- a/html/app.js +++ b/html/app.js @@ -936,6 +936,7 @@ function byPort(a){return a.sort(function(x,y){return x.portNum-y.portNum})} function pollStatus(){ return getJSON("/status.json").then(function(s){ byPort(s); + S.ports=s; var now=Date.now(); if(!S.n){ S.n=s.length; @@ -957,7 +958,7 @@ function pollStatus(){ }; }); } - S.prev=s;S.prevT=now;S.ports=s; + S.prev=s;S.prevT=now; updateStrip(); var hk=tabHooks[curTab]; if(hk&&hk.status)hk.status(); From 2a9f9b2508a59a86bb95fe2792468cd837d6c927 Mon Sep 17 00:00:00 2001 From: Kamikaze94 Date: Mon, 19 Oct 2026 23:58:57 +0200 Subject: [PATCH 2/6] WebUI: Change port strip rj45 icon, latch added --- html/index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/html/index.html b/html/index.html index f95c8219..16aecbe9 100644 --- a/html/index.html +++ b/html/index.html @@ -124,9 +124,15 @@ label.row span.lb{width:110px;flex:none;color:var(--fg2);font-size:13px} .port .ps{font-size:9px;color:var(--fg2);display:block;line-height:1.2} .port .jack{ display:block;width:16px;height:10px;margin:2px auto 1px;border-radius:2px; - border:2px solid var(--fg2);border-top-width:4px;opacity:.55; + border:2px solid var(--fg2);border-top-width:6px;opacity:.55;position:relative; } -.port.sfp .jack{width:24px;height:9px;border-top-width:3px} +.port .jack:before {content:""; + position:absolute;bottom:100%;left:50%;transform:translateX(-50%); + width:6px;height:3px;margin-bottom:6px;border-radius: 1px 1px 0 0; + background-color:var(--pc,var(--fg2)); +} +.port.sfp .jack{width:24px;height:9px;border-top-width:4px} +.port.sfp .jack:before {display:none;} .port.up{border-color:var(--pc);background:color-mix(in srgb,var(--pc) 10%,var(--panel2))} .port.up .jack{border-color:var(--pc);opacity:1} .port.up .ps{color:var(--pc);font-weight:600} From 6d539bfb1b79d880cae8ddc802937be990169485 Mon Sep 17 00:00:00 2001 From: Kamikaze94 Date: Tue, 20 Oct 2026 22:46:15 +0200 Subject: [PATCH 3/6] WebUI: Change port strip sfp icon --- html/index.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/html/index.html b/html/index.html index 16aecbe9..b1e025d0 100644 --- a/html/index.html +++ b/html/index.html @@ -123,16 +123,19 @@ label.row span.lb{width:110px;flex:none;color:var(--fg2);font-size:13px} .port .pn{font-weight:650;font-size:12px} .port .ps{font-size:9px;color:var(--fg2);display:block;line-height:1.2} .port .jack{ - display:block;width:16px;height:10px;margin:2px auto 1px;border-radius:2px; - border:2px solid var(--fg2);border-top-width:6px;opacity:.55;position:relative; + display:block;width:21px;height:12px;margin:4px auto 2px;border-radius:2px; + border:2px solid var(--fg2);border-top-width:8px;opacity:.55;position:relative; } -.port .jack:before {content:""; +.port .jack:before{content:""; position:absolute;bottom:100%;left:50%;transform:translateX(-50%); - width:6px;height:3px;margin-bottom:6px;border-radius: 1px 1px 0 0; + width:6px;height:5px;margin-bottom:7px;border-radius: 1px 1px 0 0; background-color:var(--pc,var(--fg2)); } -.port.sfp .jack{width:24px;height:9px;border-top-width:4px} -.port.sfp .jack:before {display:none;} +.port.sfp .jack{width:24px;height:16px;margin:0 auto 2px;border-top-width:5px} +.port.sfp .jack:before{ + width:10px;margin-bottom:2px;border-radius:0 0 1px 1px; + background-color:color-mix(in srgb,var(--pc, var(--panel2)) 10%,var(--panel2)); +} .port.up{border-color:var(--pc);background:color-mix(in srgb,var(--pc) 10%,var(--panel2))} .port.up .jack{border-color:var(--pc);opacity:1} .port.up .ps{color:var(--pc);font-weight:600} From 3c00ab0ae98b606300c440389bc8747724d31636 Mon Sep 17 00:00:00 2001 From: Kamikaze94 Date: Thu, 22 Oct 2026 00:40:46 +0200 Subject: [PATCH 4/6] WebUI: Cleanup color settings --- html/index.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/html/index.html b/html/index.html index b1e025d0..09627110 100644 --- a/html/index.html +++ b/html/index.html @@ -129,15 +129,14 @@ label.row span.lb{width:110px;flex:none;color:var(--fg2);font-size:13px} .port .jack:before{content:""; position:absolute;bottom:100%;left:50%;transform:translateX(-50%); width:6px;height:5px;margin-bottom:7px;border-radius: 1px 1px 0 0; - background-color:var(--pc,var(--fg2)); + background-color:var(--fg2); } .port.sfp .jack{width:24px;height:16px;margin:0 auto 2px;border-top-width:5px} -.port.sfp .jack:before{ - width:10px;margin-bottom:2px;border-radius:0 0 1px 1px; - background-color:color-mix(in srgb,var(--pc, var(--panel2)) 10%,var(--panel2)); -} +.port.sfp .jack:before{width:10px;margin-bottom:2px;border-radius:0 0 1px 1px;background-color:var(--panel2)} .port.up{border-color:var(--pc);background:color-mix(in srgb,var(--pc) 10%,var(--panel2))} .port.up .jack{border-color:var(--pc);opacity:1} +.port.up .jack:before{background-color:var(--pc)} +.port.up.sfp .jack:before{background-color:color-mix(in srgb,var(--pc) 10%,var(--panel2))} .port.up .ps{color:var(--pc);font-weight:600} .port.dis{opacity:.45;border-style:dashed} .badge{font-size:11px;font-weight:600;border-radius:10px;padding:1px 8px;background:var(--panel2);color:var(--fg2)} From a57319557deca8d22fbc438f1007a93ad47c5556 Mon Sep 17 00:00:00 2001 From: "Luca S." Date: Sun, 25 Oct 2026 22:07:43 +0100 Subject: [PATCH 5/6] Add CONFIG parameter on make --- Makefile | 36 +++++++++++++++++++++++++++++------- README.md | 7 +++++++ 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index e0e2aaa8..a989e034 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,14 @@ DEFAULT_CONFIG_LOCATION = 454656 CONFIG_LOCATION = 458752 HTML_LOCATION = 262144 +# Startup configuration embedded in the image. Override it to build a specific +# machine with its own configuration: make MACHINE= CONFIG= +CONFIG ?= config.txt + +# Startup configuration embedded in the image. Override it to build a specific +# machine with its own configuration: make MACHINE= CONFIG= +CONFIG ?= config.txt + SDCC_PREFIX = toolchain/sdcc-$(shell cat sdcc/* | cksum | cut -d' ' -f1) ifeq ($(origin CC),default) SDCC = $(SDCC_PREFIX)/bin/sdcc @@ -46,6 +54,7 @@ ifndef BUILDDIR BUILDDIR = output/$(MACHINE) endif +CONFIG_STAMP := $(BUILDDIR)/.config VERSION_HEADER := version.h GIT_VERSION := $(shell git rev-parse --short HEAD) @@ -68,9 +77,10 @@ BUILD_DATE := $(shell date -u -d @$(SOURCE_DATE_EPOCH) +"%Y-%m-%d %H:%M:%S" 2>/d || date -u -r $(SOURCE_DATE_EPOCH) +"%Y-%m-%d %H:%M:%S") endif -# $(MACHINE_SRC) is listed here so an unknown $MACHINE fails before anything else -# is built, including the tools/ subdirectory. -all: create_build_dir $(VERSION_HEADER) $(MACHINE_SRC) $(SUBDIRS) $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin +# $(MACHINE_SRC) and $(CONFIG) are listed here so an unknown $MACHINE or a +# missing config file fails before anything else is built, including the tools/ +# subdirectory. +all: create_build_dir $(VERSION_HEADER) $(MACHINE_SRC) $(CONFIG) $(SUBDIRS) $(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin bank_size: tools/bank_occupancy.sh "$(MACHINE)" @@ -91,6 +101,12 @@ $(MACHINE_SRC): @echo " Example: make MACHINE=KP_9000_6XHML_X2" >&2 @false +# Fail with a clear message when CONFIG names a file that does not exist. +$(CONFIG): + @echo "ERROR: CONFIG='$(CONFIG)' does not exist." >&2 + @echo " Point CONFIG at a configuration file, or omit it to use config.txt." >&2 + @false + # Keep the per-machine definition in first position to fail immediately on an # invalid $MACHINE value SRCS = \ @@ -209,6 +225,12 @@ FORCE: $(CCFLAGS_STAMP): FORCE | create_build_dir @echo '$(CC_FLAGS)' | cmp -s - $@ 2>/dev/null || echo '$(CC_FLAGS)' > $@ +# The same for $(CONFIG): its path is stamped so switching to a config file +# older than the image still rebuilds it, while $(CONFIG) itself as a normal +# prerequisite covers edits to the selected file. +$(CONFIG_STAMP): FORCE | create_build_dir + @echo '$(CONFIG)' | cmp -s - $@ 2>/dev/null || echo '$(CONFIG)' > $@ + $(BUILDDIR)/%.rel: %.c $(CCFLAGS_STAMP) | create_build_dir html_data.h $(CC) -MMD $(CC_FLAGS) -o $@ -c $< @@ -222,11 +244,11 @@ $(BUILDDIR)/rtlplayground.ihx: $(OBJS) $(BUILDDIR)/crtbank.rel $(BUILDDIR)/crc16 $(BUILDDIR)/rtlplayground.img: $(BUILDDIR)/rtlplayground.ihx objcopy --input-target=ihex -O binary $< $@ -$(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin: $(BUILDDIR)/rtlplayground.img | tools +$(BUILDDIR)/rtlplayground-$(FILENAME_EXTENSION).bin: $(BUILDDIR)/rtlplayground.img $(CONFIG) $(CONFIG_STAMP) | tools if [ -e $@ ]; then rm $@; fi - tools/$(BUILDDIR)/imagebuilder -i $^ $@ - tools/$(BUILDDIR)/fileadder -a $(DEFAULT_CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ - tools/$(BUILDDIR)/fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d config.txt $@ + tools/$(BUILDDIR)/imagebuilder -i $(BUILDDIR)/rtlplayground.img $@ + tools/$(BUILDDIR)/fileadder -a $(DEFAULT_CONFIG_LOCATION) -s $(IMAGESIZE) -d "$(CONFIG)" $@ + tools/$(BUILDDIR)/fileadder -a $(CONFIG_LOCATION) -s $(IMAGESIZE) -d "$(CONFIG)" $@ tools/$(BUILDDIR)/fileadder -a $(HTML_LOCATION) -s $(IMAGESIZE) -z -d $(HTML_MIN) -b BANK1 $@ tools/$(BUILDDIR)/crc_calculator -u $@ ln -sf $(MACHINE)/rtlplayground-$(FILENAME_EXTENSION).bin $(BUILDDIR)/../rtlplayground.bin diff --git a/README.md b/README.md index 25c0a02d..0deddc6f 100644 --- a/README.md +++ b/README.md @@ -127,6 +127,13 @@ The name selects the board definition `machine/.c`; `make` without a `MACHINE` value stops with an error listing what is expected. If your board is not in the list yet, see [Adding a new device](doc/adding-a-device.md). +To embed a machine-specific startup configuration, pass `CONFIG`: +``` +make MACHINE=DEFAULT_8C_1SFP CONFIG=configs/DEFAULT_8C_1SFP.txt +``` +`CONFIG` defaults to `config.txt`; the selected file is embedded in the image +and changing it triggers a rebuild. + > [!TIP] > You can write configuration parameters in config.txt (see below) in order your switch to get > straight at the first boot, a correct IP configuration. From e95e4508136f78142d71effffac55447b368eb32 Mon Sep 17 00:00:00 2001 From: "Luca S." Date: Mon, 26 Oct 2026 08:27:28 +0100 Subject: [PATCH 6/6] Add CONFIG parameter on make --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index a989e034..7d122b2d 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,6 @@ HTML_LOCATION = 262144 # machine with its own configuration: make MACHINE= CONFIG= CONFIG ?= config.txt -# Startup configuration embedded in the image. Override it to build a specific -# machine with its own configuration: make MACHINE= CONFIG= -CONFIG ?= config.txt - SDCC_PREFIX = toolchain/sdcc-$(shell cat sdcc/* | cksum | cut -d' ' -f1) ifeq ($(origin CC),default) SDCC = $(SDCC_PREFIX)/bin/sdcc