What Is the Legacy Code Tool?
The Legacy Code Tool (LCT) creates an S-Function wrapper that allows existing C functions (legacy MCAL drivers, hand-written algorithms, third-party libraries) to be called from a Simulink model as a block. The model calls the C function during simulation and the generated code calls it directly.
LCT generates: an S-Function block (.c + .tlc), a block mask, and documentation. The C function signature is described in a MATLAB structure.