Use Pin Name instead of Pad number
PumaFPV opened this issue · 3 comments
It would be great to add the possibility of using Pin Name instead of Pad number (in some cases they do not match and the correct one is the Pin Name)
It might also need some kind of filtering as Pin Name could be "GPIO26" and we only want "26".
It could be implemented as a checkbox next to the dropdown menu.
I'm not quite sure how to do it, but I'd love to help.
You can contact me on Discord at PumaFPV#7895
Thank you for this issue!
By Pin Name, you mean the pin name in the schematic? Assuming my understanding is correct, I completely agree with the necessity. A quick research revealed that pad.GetPinFunction()
does exactly what we need for this.
The big question, however, is the UI. I agree with adding a checkbox "Use pin name instead of number". But the filtering part is a bit more annoying to implement in a way that keeps the UX simple. I will implement the first part ASAP, and will think about the rest later.
Note: don't worry about contributing to the code base yet, it is currently in active development. Opening an issue to request features is already a big contribution!
Yup, the one that is inside of the part schematic. Nice! I dont know where to find the availabe functions...
Maybe you could make a dropdown menu appear when the checkbox is checked, which would allow you to select what kind of filtering you want (none, only keep numbers, only keed what's in front of the "/", what's behind...)
Attached is a picture of the component I'm thinking about
In my case I would like to obtain: #define NET_NAME 14 instead of #define NET_NAME 17 nor #define NET_NAME MTMS/GPIO14
Btw it could also be great to be able to not write the power/unused pins instead of commenting them. (Maybe new issue?)
I finally got to implementing this feature as of 851d7c9. It was a bit tricky to make it not too confusing for the user, and there might be some rework in the future to make it more understandable...
There are now two additional controls in the interface:
- A checkbox, only active when C enum, C define or python format is selected to chose whether to use the pin name, or the pin number.
- A filter text box, only active when the checkbox is checked, that acts a filter. In your case, you would enter "GPIO". If left empty, the full pin name is used.