-
-
Notifications
You must be signed in to change notification settings - Fork 39.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AVR GPIO macro defines more readable #5937
Conversation
…AVR. No change in build result.
No change in build result.
…rol macro. No change in build result.
This looks good to me. @pelrun ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The duplicated definitions in serial.c bug me a little bit, but not enough to change.
I deliberately avoided serial.c to depend on quantum.h. serial.c is a very timing-dependent module, so we want to avoid other impacts as much as possible. |
In that case, would it make sense to move both out of the respective files, and into a separate header file, where both That way, we're not maintaining multiple copies of the GPIO commands, and don't have to worry about keeping them in sync (for behavioral reasons)? |
I already thought about that method, but I did not adopt it. If serial.c imports gpio_control.h, you need to be careful modifying gpio_control.h as you would for serial.c. It's not desirable.
Do you need to sync? I do not think that it is necessary. It is dangerous to change the working serial.c just to synchronize. |
Not sure I understand. Of course you need to be careful modifying these GPIO macros, however they are fairly simple so I would be surprised if there were any major problems with them that haven't been discovered yet. If something does need to be changed, they must both be changed anyway, because otherwise you have two conflicting The thing is that serial.c shouldn't need to know nor define how eg. |
In general I like to be abstract. However, the abstraction is not necessary only for serial.c. What is important is that the generated binaries do not change. We have already experienced that when the GCC version changes the generation code will change and the timing changes. (#4269) We can't trust the simplicity of the source code's appearance. |
It looks like there is a merge conflict here, now. |
Thanks, I fixed. Then I checked again that there was no change in the binary generated by this PR.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
* A little easier to read the definition of the GPIO control macro for AVR. No change in build result. * Changed to not use GNU statement expression extension. No change in build result. * Modified split_common/serial.c to use qmk_firmware standard GPIO control macro. No change in build result. * fix PE6 -> E6 * remove some space * add some comment to config_common.h * Changed split_common/serial.c to use a newer version of qmk_firmware standard GPIO control macro.
Description
quantum/quantum.h, quantum/config_common.h
quantum/split_common/serial.c
There is no change in compilation results for this PR.
Types of Changes
Checklist