mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
machine: host the per-machine custom init hooks in BANK2
machine_custom_init() runs once at boot, but its code and any tables it uses were compiled into machine.c and so into the common bank. On the SWTG018AS-V2.1.0 variant, whose init carries a 21-entry LED register table, that overflows bank 0 by 0x66 bytes and main no longer links for MACHINE_PCB_SWTG018AS_V2_1_0; any machine whose init grows can hit the same wall. SDCC segment pragmas apply file-wide, so the hooks move to a new machine_init.c compiled into BANK2, and the prototype becomes banked. machine_check also compiles the new file per machine so the hooks keep CI syntax coverage.
This commit is contained in:
@@ -53,6 +53,7 @@ create_build_dir:
|
||||
# Keep machine.c in first position to fail immediately on invalid $MACHINE value
|
||||
SRCS = \
|
||||
machine.c \
|
||||
machine_init.c \
|
||||
cmd_editor.c \
|
||||
cmd_parser.c \
|
||||
dhcp.c \
|
||||
@@ -142,6 +143,7 @@ machine_check:
|
||||
do \
|
||||
echo "Checking $${MACHINE}"; \
|
||||
$(CC) $(CC_FLAGS) -DMACHINE_$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine.c; \
|
||||
$(CC) $(CC_FLAGS) -DMACHINE_$${MACHINE} -MMD -o $(BUILDDIR)/tmp/machine_check -c machine_init.c; \
|
||||
done
|
||||
@rm -rf $(BUILDDIR)/tmp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user