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: