Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add consistent button names across targets #4249
There's currently no standardization across device switch names (as we do with LED names). This change maps currently existing switch mappings to a 1-indexed BUTTON name.
Related to #4032
This change does not modify any existing applications, it only provides a new button name option.
Built without error and tested functionality on a K64F
The DELTA_DFCM_NNN40 uses BUTTON0 as its mapped name already so I did not modify that file.
I did not touch all targets, I started with targets that defined switches in some way in PinNames.h through an automated script and may have missed some. Pushing forward with the bulk of what I have.
Plenty targets define USER_BUTTON, or USER_BUTTONx. BUTTONx schema sounds fine to me. What is a requirement - a target might not have any button ? How this can be tested?
I caught a few missing definitions, but honestly other than that everything looks good to me!
May 3, 2017
referenced this pull request
May 3, 2017
How does @geky make the cool ascii shrug character?!?
I'd suggest getting with @AnotherButler to find a place or create one if it doesnt exist. Probably in the porting guide around a section that describes what should be in PinNames.h and if there should be an extension (macros say) where an alias is created. Eventually PinNames needs to be broken apart for MCU and board and I think this could be the tipping point to put together. @theotherjimmy should have thoughts on this with current work around targets and such.
Poring guide is a good start. https://docs.mbed.com/docs/mbed-os-handbook/en/latest/advanced/porting_guide/