-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Refactor: Split OMNIBUSF4 family into 4 target directories #11196
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
Open
sensei-hacker
wants to merge
8
commits into
iNavFlight:maintenance-9.x
Choose a base branch
from
sensei-hacker:refactor/split-omnibusf4-targets
base: maintenance-9.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+724
−188
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cebc906
Refactor OMNIBUSF4 targets into separate directories
sensei-hacker 476a0cb
Clean up dead code and obsolete comments from OMNIBUS split
sensei-hacker c79e53a
Remove all dead code from OMNIBUSF4 directory
sensei-hacker e3d0bda
Fix critical OMNIBUSF4V3_ICM configuration bug and remove dead code
sensei-hacker dce7687
Remove outdated and misleading comments from OMNIBUS split
sensei-hacker 2331e01
Remove dead code from OMNIBUSF4PRO/target.c
sensei-hacker 0fead0f
Remove outdated comments and redundant conditional from OMNIBUS split
sensei-hacker e6dc927
Fix inconsistent indentation remnants in OMNIBUS split
sensei-hacker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| target_stm32f405xg(DYSF4PRO) | ||
| target_stm32f405xg(DYSF4PROV2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * This file is part of Cleanflight. | ||
| * | ||
| * Cleanflight is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * Cleanflight is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #include <stdint.h> | ||
|
|
||
| #include <platform.h> | ||
| #include "drivers/io.h" | ||
| #include "drivers/pwm_mapping.h" | ||
| #include "drivers/timer.h" | ||
| #include "drivers/bus.h" | ||
|
|
||
| timerHardware_t timerHardware[] = { | ||
|
|
||
| DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1_OUT D1_ST7 | ||
| DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // S2_OUT D1_ST2 | ||
| DEF_TIM(TIM2, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 1), // S3_OUT D1_ST6 | ||
| DEF_TIM(TIM2, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 0), // S4_OUT D1_ST1 | ||
|
|
||
| // { TIM9, IO_TAG(PA3), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM9, TIM_USE_OUTPUT_AUTO }, // MOTOR_3 | ||
| DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 0), // S5_OUT MOTOR, SERVO or LED | ||
| DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 0), // S6_OUT | ||
|
|
||
|
|
||
| // DEF_TIM(TIM12, CH1, PB14, TIM_USE_PPM, 0, 0), // PPM | ||
| DEF_TIM(TIM12, CH2, PB15, TIM_USE_ANY, 0, 0), // S2_IN | ||
| DEF_TIM(TIM8, CH1, PC6, TIM_USE_ANY, 0, 0), // S3_IN, UART6_TX | ||
| DEF_TIM(TIM8, CH2, PC7, TIM_USE_ANY, 0, 0), // S4_IN, UART6_RX | ||
| DEF_TIM(TIM8, CH3, PC8, TIM_USE_ANY, 0, 0), // S5_IN | ||
| DEF_TIM(TIM8, CH4, PC9, TIM_USE_ANY, 0, 0), // S6_IN | ||
|
|
||
| }; | ||
|
|
||
| const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,159 @@ | ||
| /* | ||
| * This file is part of Cleanflight. | ||
| * | ||
| * Cleanflight is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * Cleanflight is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| // This directory contains: DYSF4PRO, DYSF4PROV2 | ||
|
|
||
| #if defined(DYSF4PRO) | ||
| #define TARGET_BOARD_IDENTIFIER "DYS4" | ||
| #elif defined(DYSF4PROV2) | ||
| #define TARGET_BOARD_IDENTIFIER "DY42" | ||
| #endif | ||
|
|
||
| #define USBD_PRODUCT_STRING "DysF4Pro" | ||
|
|
||
| #define LED0 PB5 | ||
|
|
||
| #define BEEPER PB4 | ||
| #define BEEPER_INVERTED | ||
|
|
||
| #if defined(DYSF4PROV2) | ||
| #define USE_I2C | ||
| #define USE_I2C_DEVICE_1 | ||
| #define I2C1_SCL PB8 | ||
| #define I2C1_SDA PB9 | ||
| #define I2C_EXT_BUS BUS_I2C1 | ||
| #else | ||
| #define USE_I2C | ||
| #define USE_I2C_DEVICE_2 | ||
| #define I2C_DEVICE_2_SHARES_UART3 | ||
| #define I2C_EXT_BUS BUS_I2C2 | ||
| #endif | ||
|
|
||
| #define UG2864_I2C_BUS I2C_EXT_BUS | ||
|
|
||
| #define MPU6000_CS_PIN PA4 | ||
| #define MPU6000_SPI_BUS BUS_SPI1 | ||
|
|
||
| #define USE_IMU_MPU6000 | ||
| #define IMU_MPU6000_ALIGN CW180_DEG | ||
|
|
||
| #define USE_MAG | ||
| #define MAG_I2C_BUS I2C_EXT_BUS | ||
| #define USE_MAG_ALL | ||
|
|
||
| #define TEMPERATURE_I2C_BUS I2C_EXT_BUS | ||
|
|
||
| #define USE_BARO | ||
| #define BARO_I2C_BUS I2C_EXT_BUS | ||
| #define USE_BARO_BMP085 | ||
| #define USE_BARO_BMP280 | ||
| #define USE_BARO_MS5611 | ||
|
|
||
| #define PITOT_I2C_BUS I2C_EXT_BUS | ||
|
|
||
| #define USE_RANGEFINDER | ||
| #define RANGEFINDER_I2C_BUS I2C_EXT_BUS | ||
|
|
||
| #define USE_VCP | ||
| #define VBUS_SENSING_PIN PC5 | ||
| #define VBUS_SENSING_ENABLED | ||
|
|
||
|
|
||
| #define USE_UART1 | ||
| #define UART1_RX_PIN PA10 | ||
| #define UART1_TX_PIN PA9 | ||
| #define UART1_AHB1_PERIPHERALS RCC_AHB1Periph_DMA2 | ||
|
|
||
| #define USE_UART3 | ||
| #define UART3_RX_PIN PB11 | ||
| #define UART3_TX_PIN PB10 | ||
|
|
||
| #define USE_UART6 | ||
| #define UART6_RX_PIN PC7 | ||
| #define UART6_TX_PIN PC6 | ||
|
|
||
| #define USE_SOFTSERIAL1 | ||
| #define SOFTSERIAL_1_RX_PIN PC8 | ||
| #define SOFTSERIAL_1_TX_PIN PC9 | ||
|
|
||
| #define SERIAL_PORT_COUNT 5 // VCP, USART1, USART3, USART6, SOFTSERIAL1 | ||
|
|
||
| #define DEFAULT_RX_TYPE RX_TYPE_SERIAL | ||
| #define SERIALRX_PROVIDER SERIALRX_SBUS | ||
| #define SERIALRX_UART SERIAL_PORT_USART1 | ||
|
|
||
| #define USE_SPI | ||
|
|
||
| #define USE_SPI_DEVICE_1 | ||
|
|
||
|
|
||
| #define USE_SPI_DEVICE_3 | ||
| #define SPI3_NSS_PIN PB3 | ||
| #define SPI3_SCK_PIN PC10 | ||
| #define SPI3_MISO_PIN PC11 | ||
| #define SPI3_MOSI_PIN PC12 | ||
|
|
||
| #define USE_MAX7456 | ||
| #define MAX7456_SPI_BUS BUS_SPI3 | ||
| #define MAX7456_CS_PIN PA15 | ||
|
|
||
| #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT | ||
| #define M25P16_CS_PIN SPI3_NSS_PIN | ||
| #define M25P16_SPI_BUS BUS_SPI3 | ||
| #define USE_FLASHFS | ||
| #define USE_FLASH_M25P16 | ||
|
|
||
| #define USE_ADC | ||
| #define ADC_CHANNEL_1_PIN PC1 | ||
| #define ADC_CHANNEL_2_PIN PC2 | ||
|
|
||
| #ifdef DYSF4PRO | ||
| #define ADC_CHANNEL_3_PIN PC3 | ||
| #else | ||
| #define ADC_CHANNEL_3_PIN PA0 | ||
| #endif | ||
sensei-hacker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #define CURRENT_METER_ADC_CHANNEL ADC_CHN_1 | ||
| #define VBAT_ADC_CHANNEL ADC_CHN_2 | ||
| #define RSSI_ADC_CHANNEL ADC_CHN_3 | ||
|
|
||
| #define SENSORS_SET (SENSOR_ACC|SENSOR_MAG|SENSOR_BARO) | ||
|
|
||
| #define USE_LED_STRIP | ||
| #define WS2811_PIN PA1 | ||
|
|
||
| #define DISABLE_RX_PWM_FEATURE | ||
| #define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX | FEATURE_VBAT | FEATURE_OSD) | ||
|
|
||
| #define USE_SPEKTRUM_BIND | ||
| #define BIND_PIN PB11 // USART3 RX | ||
|
|
||
| #define USE_SERIAL_4WAY_BLHELI_INTERFACE | ||
|
|
||
| // Number of available PWM outputs | ||
| #define MAX_PWM_OUTPUT_PORTS 6 | ||
| #define TARGET_MOTOR_COUNT 6 | ||
| #define USE_DSHOT | ||
| #define USE_ESC_SENSOR | ||
|
|
||
| #define TARGET_IO_PORTA 0xffff | ||
| #define TARGET_IO_PORTB 0xffff | ||
| #define TARGET_IO_PORTC 0xffff | ||
| #define TARGET_IO_PORTD 0xffff | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1 @@ | ||
| target_stm32f405xg(DYSF4PRO) | ||
| target_stm32f405xg(DYSF4PROV2) | ||
| target_stm32f405xg(OMNIBUSF4) | ||
| # the OMNIBUSF4SD has an SDCARD instead of flash, a BMP280 baro and therefore a slightly different ppm/pwm and SPI mapping | ||
| target_stm32f405xg(OMNIBUSF4PRO) | ||
| target_stm32f405xg(OMNIBUSF4V3_S5_S6_2SS) | ||
| target_stm32f405xg(OMNIBUSF4V3_S5S6_SS) | ||
| target_stm32f405xg(OMNIBUSF4V3_S6_SS) | ||
| # OMNIBUSF4V3 is a (almost identical) variant of OMNIBUSF4PRO target, | ||
| # except for an inverter on UART6. | ||
| target_stm32f405xg(OMNIBUSF4V3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.