- Posts: 40
- Thank you received: 0
Typo in source code file, motion.c
- TurboStreetCar
- Topic Author
- Offline
- Senior Member
-
Less
More
2 years 10 months ago #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:
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
Line# 348-350:
Code:
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 to join the conversation.
- TurboStreetCar
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 0
2 years 10 months ago #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.
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 to join the conversation.
2 years 10 months ago #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.
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 to join the conversation.
2 years 10 months ago #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.
Attachment not found
Please Log in to join the conversation.
- TurboStreetCar
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 0
2 years 10 months ago #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?
@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 to join the conversation.
- TurboStreetCar
- Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 40
- Thank you received: 0
2 years 10 months ago #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 to join the conversation.
Time to create page: 0.277 seconds
