Typo in source code file, motion.c

More
08 Dec 2023 19:07 #287578 by TurboStreetCar
Typo in source code file, motion.c was created by TurboStreetCar
Hello, i believe I’ve discovered a typo within motion.c of the source code.

Line# 348-350:
else if(names_misc_errors[0]){
num_misc_error = count_names(names_dout);
num_misc_error = (num_misc_error > count_names(names_din)) ? num_misc_error : count_names(names_din);
}


Motion has the ability to define miscellaneous error pins. You can define a number of pins to be created, or you can define them by name. When defining them by name, the source code attempts to determine the number of inputs you’ve created by looking at the number of "names" in the array, but instead of checking the correct array "names_misc_error", it checks another array "names_dout".

It seems like a copy/paste typo where the variables, in this case the arrays, were not updated.

Link to motion.c: github.com/LinuxCNC/linuxcnc/blob/master.../emc/motion/motion.c

Please Log in or Create an account to join the conversation.

More
11 Dec 2023 02:43 #287808 by TurboStreetCar
Replied by TurboStreetCar on topic Typo in source code file, motion.c
Bump, any input on this?

I posted it as an issue on GitHub, I could fix it, I think, but I don’t know how to GitHub works, with pulls and commits and such.

Seems like a fairly straight forward fix.

Please Log in or Create an account to join the conversation.

More
11 Dec 2023 03:14 #287810 by spumco
Replied by spumco on topic Typo in source code file, motion.c
Sorry, I don't really speak GitHub either, but one of the devs will probably pick up on it.  Maybe if you link to the original commit in your issue report that'd help.

I think the misc_errors is a fairly recent addition to LCNC and not many people are using it - so nobody is familiar or experienceing issues.

I spotted it earlier this year and was planning to use it for some inputs.

Please Log in or Create an account to join the conversation.

More
11 Dec 2023 04:16 #287813 by phillc54
Replied by phillc54 on topic Typo in source code file, motion.c
If you have a GitHub account it is possible edit the file directly in a browser and create a pull request. 

 
Attachments:
The following user(s) said Thank You: spumco

Please Log in or Create an account to join the conversation.

More
11 Dec 2023 12:53 #287850 by TurboStreetCar
Replied by TurboStreetCar on topic Typo in source code file, motion.c
@spumco yea i was going to try to use it for some other fault conditions and realized if i used num_misc_error, it would create the pins, but if i used names_misc_errors, it wouldnt create any pins.

@phillc54 When i click that button on github, it says i need to create a fork in order to propose changes. Is that correct?

Please Log in or Create an account to join the conversation.

More
15 Dec 2023 18:43 #288256 by TurboStreetCar
Replied by TurboStreetCar on topic Typo in source code file, motion.c
This issue was addressed by Andy Pugh and should be fixed. 

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum