Skip to content

fix: extend SBUS2 and UART inversion guards to include RP2350#11592

Draft
sensei-hacker wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
sensei-hacker:fix-common-h-platform-guards
Draft

fix: extend SBUS2 and UART inversion guards to include RP2350#11592
sensei-hacker wants to merge 1 commit into
iNavFlight:maintenance-10.xfrom
sensei-hacker:fix-common-h-platform-guards

Conversation

@sensei-hacker
Copy link
Copy Markdown
Member

Summary

  • USE_TELEMETRY_SBUS2 was gated to STM32F7/H7 only. RP2350 also has bi-directional UART inversion capability and is now included.
  • AT32F43x was investigated: the USART CTRL2/CTRL3 register map has no RXINV/TXINV bits, so it cannot do hardware pin inversion and is intentionally excluded.
  • Removes dead !defined(STM32F7) from serial_uart.c. That file is compiled only for STM32F4 via stm32-stdperiph.cmake (included exclusively by stm32f4.cmake), so STM32F7 can never be defined in that translation unit. Confirmed by inspecting the MATEKF722 build directory — no serial_uart.c.obj present.

Changes

  • src/main/target/common.h — add || defined(RP2350) to USE_TELEMETRY_SBUS2 guard; improve comment to name both excluded platforms
  • src/main/drivers/serial_uart.c — remove tautological && !defined(STM32F7) from usartConfigurePinInversion

Testing

  • Built MATEKF405 (STM32F4), MATEKF722 (STM32F7), MATEKH743 (STM32H7) — all compile clean with no errors or warnings
  • Hardware runtime testing of SBUS2 on RP2350 not yet performed (RP2350 UART driver still in development)

Code Review

Reviewed with inav-code-review — no critical or important issues found.

Documentation not needed (preprocessor guard fix, no user-visible behaviour change on existing targets).

USE_TELEMETRY_SBUS2 was gated to F7/H7 only; RP2350 also has
bi-directional UART inversion. AT32F43x lacks hardware RXINV/TXINV
(confirmed via register map) and is excluded.

Also removes dead !defined(STM32F7) from serial_uart.c, which is
compiled only for F4 via stm32-stdperiph.cmake — STM32F7 could
never be defined in that translation unit.
@github-actions
Copy link
Copy Markdown

Test firmware build ready — commit 62c2272

Download firmware for PR #11592

237 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant