-
Notifications
You must be signed in to change notification settings - Fork 376
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
Move "core_pins.h" include from source to header file #762
Conversation
Unlikely to merge this. |
Why? The |
Done to fix the following errors if attempting to compile usb_serial.h as C++ code: usb_serial.h:93:25: error: 'yield' was not declared in this scope usb_serial.h:177:45: error: 'millis' was not declared in this scope
02f2667
to
a371b3f
Compare
Done to fix the following errors if attempting to compile usb_seremu.h as C++ code: usb_seremu.h:68:41: error: 'systick_millis_count' was not declared in this scope usb_seremu.h:79:25: error: 'yield' was not declared in this scope usb_seremu.h:102:27: error: 'yield' was not declared in this scope
Changing which headers include others needs to be explained with very solid reasoning. Without very strong reason, I'm not going to merge this sort of change. |
Please do not send this sort of pull request without very clearly explained reason why. Extensive testing is needed to verify the change does not break programs and libraries. I've been burned before by this sort of change. The Arduino ecosystem is a mostly unplanned growth of many libraries where small changes in header includes can have unintended consequences. So to repeat again, very unlikely to accept this sort of change which alters which headers include other headers. |
Apologies if my PRs feels like a burden @PaulStoffregen. That was not my intent. My intent is only to be a good citizen by contributing small fixes and code improvements back to the project, so that others can also benefit from them. This sort of behavior is often appreciated by open-source project maintainers.
The PR already explains precisely which compiler errors are fixed by this PR. You can reproduce the errors by including either I'll be listening and do my best to accommodate your feedback if you give feedback on desired code modifications or want me to perform specific testing steps.
Again, I'm sorry if my PRs feel like a burden. My motivation has been to help the project by contributing changes back instead of just being a passive consumer. I'll of course stop submitting new PRs and instead put them in my own fork moving forward if you're not interested in my contributions. |
I am interested in most of your edits. But I want to urge you to NOT change which headers include other headers. Please, just resist the temptation, as that sort of editing absolutely will diverge your fork. |
Understood. I've now submitted #767 that attempts to solve the same C++ compatibility problem by instead reordering "core_pins.h" includes in two source files. This avoid changing which headers include other headers by instead changing the source files that include the headers. |
Fixes the following errors if attempting to compile
usb_serial.h
as C++ code:Fixes the following errors if attempting to compile
usb_seremu.h
as C++ code:I can also update the
teensy
andteensy3
implementation the same way if desired.Motivation
I want to improve compatibility with C++11 (and newer), so that I can eventually use
constexpr
in USB-related code.