Closed havardAasen closed 9 months ago
I think that your code continues an error in the existing code, that the limit may not be MAX_IO for all cases where the function is called. This isn't currrently a problem. https://github.com/LinuxCNC/linuxcnc/blob/2.9/src/emc/motion/emcmotcfg.h#L33 But it feels like the function should be passed the relevant parameter rather than the local MAX_IO.
I think that your code continues an error in the existing code, that the limit may not be MAX_IO for all cases where the function is called. This isn't currrently a problem. https://github.com/LinuxCNC/linuxcnc/blob/2.9/src/emc/motion/emcmotcfg.h#L33 https://github.com/LinuxCNC/linuxcnc/blob/2.9/src/emc/motion/emcmotcfg.h#L33 But it feels like the function should be passed the relevant parameter rather than the local MAX_IO.
Yes, I agree. Then we can remove MAX_IO
and rather use EMCMOT_MAX_*
when we define the arrays, and send the macro in as a max_len
parameter.
Simplified the logic by changing to a while loop and removing a variable.