Skip to content
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

Use enum for C++ to avoid macro pitfalls in esp32_hal_uart.h #7926

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

dok-net
Copy link
Contributor

@dok-net dok-net commented Mar 4, 2023

C prepropressor macros are generally considered deprecated in C++, in this particular case, their use for the serial configuration breaks the enum from the EspSoftwareSerial library, release 8.0.0 onward.

This merge request provides the previous macro defines for C language builds, but replaces them functionally identical with a C++ enumeration for C++ builds, which is the default Arduino language anyway.

The ESP8266 Arduino Core uses a C++ enum already.

Copy link
Collaborator

@SuGlider SuGlider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dok-net for the PR!

@SuGlider SuGlider self-assigned this Mar 31, 2023
@SuGlider SuGlider added this to the 2.0.8 milestone Mar 31, 2023
@me-no-dev me-no-dev merged commit f275ce5 into espressif:master Mar 31, 2023
@dok-net dok-net deleted the serialconfig_enum branch April 21, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Peripheral: UART Status: Review needed Issue or PR is awaiting review
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants