motion: keep the kinematics type declaration optional for old modules - #4545
Conversation
A kinematics module built before the type declarations exports no kinematicsTypeFlags, and motmod's hard reference kept it from loading: dlopen fails on the undefined symbol. Mark the reference weak and report -1, no information, when the module does not answer.
|
What happens in |
|
On master the outcome is the intended one: -1 matches every flag, so the loop stops at type 0, and the no-information fallback below would give the same 0; for a module that declares nothing, type 0 is the only answer G13.1 can give. The exclusion becomes load-bearing only once a second flag is tested: #4374's G43.4 tests KINSTYPE_PRIMARY, where an undeclared module would otherwise silently pass as primary instead of erroring, and there the test already excludes -1 ( I considered a docs note for old out-of-tree modules, but a module built before G13.1 existed cannot have G13.1 in its programs, so there is nothing to warn about. |
|
Alright, then its settled. |
#4414 made motmod resolve
kinematicsTypeFlagsfrom the loaded kinematics module at dlopen time. Out-of-tree modules built before it export no such symbol, so the dlopen fails and the machine does not start.Mark the reference weak; when the module does not answer, report -1 ("no information") for every type. The interpreter already treats that as the no-declarations state: numeric G12.1 switching is unchanged and G13.1 falls back to type 0.
Tested with a pre-#4414 out-of-tree binary switchkins module: failed to load before (
motmod.so: undefined symbol: kinematicsTypeFlags), now loads, homes, runs and switches types numerically. The kins-switch test (a declaring module) still passes.