...
An example controller for deadlock prevention is located in rail-repo: docs/deadlocks/resolve_deadlock.sct
Sidings should only be used in one direction.
Trains trying to leave a station in order to use KIO_LN_0 or KIO_LN_1 should, if they do not receive the locks for all segments, release them for two ticks.
C Controller
The C controller wraps the basic railway interface and creates an correct environment to run the generated controller.
...