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

hal/uart_ll.h: Fix compile with C++ (ESP32-S3/H2) (IDFGH-9255) #10640

Closed
wants to merge 1 commit into from

Conversation

nomis
Copy link
Contributor

@nomis nomis commented Jan 29, 2023

I'm including <hal/uart_ll.h> in my C++ application because I need to bypass the uart driver. The inline functions in the header file fail to compile as C++.

With xtensa-esp32s2-elf-g++ (crosstool-NG esp-2021r2-patch3) 8.4.0 it doesn't allow copying the union like this:

hal/uart_ll.h: In function 'uint32_t uart_ll_get_baudrate(uart_dev_t*)':
hal/uart_ll.h:181:37: error: no matching function for call to 'uart_clkdiv_reg_t(volatile uart_clkdiv_reg_t&)'
     uart_clkdiv_reg_t div_reg = hw->clkdiv;
                                     ^~~~~~
hal/uart_ll.h: In function 'void uart_ll_inverse_signal(uart_dev_t*, uint32_t)':
hal/uart_ll.h:822:38: error: no matching function for call to 'uart_conf0_reg_t(volatile uart_conf0_reg_t&)'
     uart_conf0_reg_t conf0_reg = hw->conf0;
                                      ^~~~~

There are some instances of incompatibility specific to the ESP32-S3/H2 header files that the previous commit didn't resolve.

I'm including <hal/uart_ll.h> in my C++ application because I need to
bypass the uart driver. The inline functions in the header file fail to
compile as C++.

With xtensa-esp32s2-elf-g++ (crosstool-NG esp-2021r2-patch3) 8.4.0 it
doesn't allow copying the union like this:

hal/uart_ll.h: In function 'uint32_t uart_ll_get_baudrate(uart_dev_t*)':
hal/uart_ll.h:181:37: error: no matching function for call to 'uart_clkdiv_reg_t(volatile uart_clkdiv_reg_t&)'
     uart_clkdiv_reg_t div_reg = hw->clkdiv;
                                     ^~~~~~
hal/uart_ll.h: In function 'void uart_ll_inverse_signal(uart_dev_t*, uint32_t)':
hal/uart_ll.h:822:38: error: no matching function for call to 'uart_conf0_reg_t(volatile uart_conf0_reg_t&)'
     uart_conf0_reg_t conf0_reg = hw->conf0;
                                      ^~~~~

There are some instances of incompatibility specific to the ESP32-S3/H2
header files that the previous commit didn't resolve.
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 29, 2023
@github-actions github-actions bot changed the title hal/uart_ll.h: Fix compile with C++ (ESP32-S3/H2) hal/uart_ll.h: Fix compile with C++ (ESP32-S3/H2) (IDFGH-9255) Jan 29, 2023
@suda-morris
Copy link
Collaborator

sha=f9dc6ca1f58a5eff799b0d7a09cc51fd66475e11

@suda-morris suda-morris added PR-Sync-Merge Pull request sync as merge commit and removed PR-Sync-Merge Pull request sync as merge commit labels Jan 31, 2023
@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Resolution: NA Issue resolution is unavailable labels Feb 10, 2023
espressif-bot pushed a commit to espressif/esp-hal-components that referenced this pull request Feb 10, 2023
espressif-bot pushed a commit that referenced this pull request Feb 11, 2023
@igrr
Copy link
Member

igrr commented Feb 24, 2023

Thanks for the contribution, this fix was cherry-picked in d78d1a2

@igrr igrr closed this Feb 24, 2023
espressif-bot pushed a commit that referenced this pull request Mar 9, 2023
espressif-bot pushed a commit that referenced this pull request Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Sync-Merge Pull request sync as merge commit Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants