-
Notifications
You must be signed in to change notification settings - Fork 1.7k
F4V3 with MPOSD on TX4 #11243
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
F4V3 with MPOSD on TX4 #11243
Conversation
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
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.
High-level Suggestion
To avoid increasing maintenance overhead from adding numerous specific targets, consider using custom defines for niche configurations. This allows users to enable features like the MPOSD pin remapping during their build process on an existing target, rather than creating a new official one. [High-level, importance: 8]
Solution Walkthrough:
Before:
// CMakeLists.txt
target_stm32f405xg(OMNIBUSF4PRO)
target_stm32f405xg(OMNIBUSF4PRO_MPOSD) // New target added
// target.h
#ifdef OMNIBUSF4PRO_MPOSD
#define OMNIBUSF4PRO_LEDSTRIPM5
#endif
#if defined(OMNIBUSF4PRO_MPOSD)
#define USE_UART4
#define UART4_TX_PIN PA0
#endif
#if !defined(OMNIBUSF4PRO_MPOSD)
#define ADC_CHANNEL_3_PIN PA0
#endifAfter:
// No new target in CMakeLists.txt
// User builds with e.g. `make OMNIBUSF4PRO CUSTOM_DEFINES=USE_MPOSD_ON_PA0`
// target.h
// No OMNIBUSF4PRO_MPOSD target definition
#if defined(USE_MPOSD_ON_PA0)
#define USE_UART4
#define UART4_TX_PIN PA0
#endif
#if !defined(USE_MPOSD_ON_PA0)
#define ADC_CHANNEL_3_PIN PA0
#endif|
|
||
| #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1 | ||
| #define VBAT_ADC_CHANNEL ADC_CHN_2 | ||
| #define RSSI_ADC_CHANNEL ADC_CHN_3 |
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.
Suggestion: Conditionally define RSSI_ADC_CHANNEL as ADC_CHN_NONE when OMNIBUSF4PRO_MPOSD is active to prevent using an ADC channel with an unassigned pin. [possible issue, importance: 8]
| #define RSSI_ADC_CHANNEL ADC_CHN_3 | |
| #if defined(OMNIBUSF4PRO_MPOSD) | |
| #define RSSI_ADC_CHANNEL ADC_CHN_NONE | |
| #else | |
| #define RSSI_ADC_CHANNEL ADC_CHN_3 | |
| #endif |
| //OMNIBUSF4PRO_MPOSD = OMNIBUSF4PRO_LEDSTRIPM5 and MPOSD on adc rssi pin for openipc camera | ||
| #ifdef OMNIBUSF4PRO_MPOSD | ||
| #define OMNIBUSF4PRO_LEDSTRIPM5 | ||
| #endif |
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.
Suggestion: Prefer defining the effective base target directly (and keep comments consistent) so the variant’s semantics are explicit and less likely to drift when other targets/macros change. [Learned best practice, importance: 5]
| //OMNIBUSF4PRO_MPOSD = OMNIBUSF4PRO_LEDSTRIPM5 and MPOSD on adc rssi pin for openipc camera | |
| #ifdef OMNIBUSF4PRO_MPOSD | |
| #define OMNIBUSF4PRO_LEDSTRIPM5 | |
| #endif | |
| // OMNIBUSF4PRO_MPOSD: OMNIBUSF4PRO with LED strip on M5 and MPOSD on PA0 (OpenIPC). | |
| #ifdef OMNIBUSF4PRO_MPOSD | |
| #define OMNIBUSF4PRO | |
| #define OMNIBUSF4PRO_LEDSTRIPM5 | |
| #endif |
User description
Hi,
Using an elrs RX and OpenIPC the ADC RSSI needs to be remapped to TX4 for being able to output OSD to the camera.
Remapping the pad and mposd worked on betaflight, now the target needs to be ported on Inav.
PR Type
Enhancement, New Target
Description
Add OMNIBUSF4PRO_MPOSD target variant for OpenIPC camera support
Configure UART4 with TX on PA0 for MPOSD output
Remap ADC channel 3 pin to avoid conflict with UART4_TX
Inherit OMNIBUSF4PRO_LEDSTRIPM5 configuration for new target
Diagram Walkthrough
File Walkthrough
target.h
Configure UART4 and remap ADC for MPOSDsrc/main/target/OMNIBUSF4/target.h
OMNIBUSF4PRO_LEDSTRIPM5 configuration
output
OMNIBUSF4PRO_MPOSD is defined, preventing pin conflict
OpenIPC camera integration
CMakeLists.txt
Register new OMNIBUSF4PRO_MPOSD build targetsrc/main/target/OMNIBUSF4/CMakeLists.txt