-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add target CoreWingF405WingV2 #11291
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
base: maintenance-9.x
Are you sure you want to change the base?
Add target CoreWingF405WingV2 #11291
Conversation
Merge 9.x to master
Merge Maintenance 9.x to master, mostly for the github workflow
…check-action Fix YAML syntax error in workflow file
Branch Targeting SuggestionYou've targeted the
If This is an automated suggestion to help route contributions to the appropriate branch. |
ⓘ Your approaching your monthly quota for Qodo. Upgrade your plan PR Compliance Guide 🔍All compliance sections have been disabled in the configurations. |
| void targetConfiguration(void) | ||
| { | ||
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL; | ||
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS; | ||
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP; | ||
|
|
||
| pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1; | ||
| } |
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: Store the result of findSerialPortIndexByIdentifier() and guard against -1 before indexing portConfigs to avoid out-of-bounds writes when a port identifier is unavailable/misconfigured. [Learned best practice, importance: 6]
| void targetConfiguration(void) | |
| { | |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART6)].functionMask = FUNCTION_RX_SERIAL; | |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_GPS; | |
| serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_MSP; | |
| pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1; | |
| } | |
| void targetConfiguration(void) | |
| { | |
| const int usart6Index = findSerialPortIndexByIdentifier(SERIAL_PORT_USART6); | |
| const int usart5Index = findSerialPortIndexByIdentifier(SERIAL_PORT_USART5); | |
| const int usart1Index = findSerialPortIndexByIdentifier(SERIAL_PORT_USART1); | |
| if (usart6Index >= 0) { | |
| serialConfigMutable()->portConfigs[usart6Index].functionMask = FUNCTION_RX_SERIAL; | |
| } | |
| if (usart5Index >= 0) { | |
| serialConfigMutable()->portConfigs[usart5Index].functionMask = FUNCTION_GPS; | |
| } | |
| if (usart1Index >= 0) { | |
| serialConfigMutable()->portConfigs[usart1Index].functionMask = FUNCTION_MSP; | |
| } | |
| pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1; | |
| } |
User description
CoreWing F405 Wing V2
Summary
Adds support for the CoreWing F405 Wing V2 flight controller board.
Hardware Specifications
Default Port Configuration
Pin Mapping
Motor/Servo Outputs
SPI Bus Assignment
I2C Bus Assignment
UART Pin Mapping
Notes
PR Type
Enhancement
Description
Block Diagram
PR Type
Enhancement
Description
Adds support for CoreWing F405 Wing V2 flight controller board
Configures ICM42688P gyro with CW270 alignment on SPI1
Enables 11 motor/servo outputs with full DMA/DSHOT support
Includes 6 UARTs, OSD, SD card blackbox, barometer, magnetometer
Supports rangefinder, pitot tube, LED strip, and PINIO features
Diagram Walkthrough
File Walkthrough
target.h
Complete hardware configuration and pin definitionssrc/main/target/COREWINGF405WINGV2/target.h
target.c
Timer and sensor hardware initializationsrc/main/target/COREWINGF405WINGV2/target.c
config.c
Default port and feature configurationsrc/main/target/COREWINGF405WINGV2/config.c
CMakeLists.txt
Build system configurationsrc/main/target/COREWINGF405WINGV2/CMakeLists.txt