Skip to content

Commit fcbe8e3

Browse files
Merge pull request #11591 from iNavFlight/maintenance-9.x
Maintenance 9.x into maintenance-10.x
2 parents 41da490 + f13316a commit fcbe8e3

9 files changed

Lines changed: 573 additions & 2 deletions

File tree

docs/Mixer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Each servo mixing rule has the following parameters:
8282
| 26 | Stabilized PITCH- | Clipped between -1000 and 0 |
8383
| 27 | Stabilized YAW+ | Clipped between 0 and 1000 |
8484
| 28 | Stabilized YAW- | Clipped between -1000 and 0 |
85-
| 29 | MAX | Constant value of 500 |
85+
| 29 | FIXED-VALUE (MAX) | Fixed percentage of total range |
8686

8787
The `smix reset` command removes all the existing motor mixing rules.
8888

@@ -103,4 +103,4 @@ Other usages can be:
103103
* automatic parachute deployment
104104
* VTOL and especially tail-sitters that require change in mixings during flight mode transition
105105
* crowbar airbrakes
106-
* any kind of servo mixings that should be changed during flight
106+
* any kind of servo mixings that should be changed during flight
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32f405xg(BLADE_F4)

src/main/target/BLADE_F4/config.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
#include <platform.h>
20+
21+
#include "fc/fc_msp_box.h"
22+
#include "io/piniobox.h"
23+
24+
void targetConfiguration(void)
25+
{
26+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
27+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
28+
}

src/main/target/BLADE_F4/target.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
#include <platform.h>
20+
21+
#include "drivers/io.h"
22+
#include "drivers/timer.h"
23+
24+
timerHardware_t timerHardware[] = {
25+
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 1), // S1_OUT D2_ST4
26+
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // S2_OUT D2_ST7
27+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 1), // S3_OUT D2_ST1
28+
DEF_TIM(TIM1, CH2, PA9, TIM_USE_OUTPUT_AUTO, 0, 1), // S4_OUT D2_ST2
29+
DEF_TIM(TIM1, CH3, PA10, TIM_USE_OUTPUT_AUTO, 0, 0), // S5_OUT D2_ST6
30+
DEF_TIM(TIM3, CH1, PB4, TIM_USE_OUTPUT_AUTO, 0, 0), // S6_OUT D1_ST4
31+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S7_OUT D1_ST7
32+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // S8_OUT D1_ST2
33+
34+
DEF_TIM(TIM2, CH2, PB3, TIM_USE_LED, 0, 0), // D1_ST6
35+
};
36+
37+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

src/main/target/BLADE_F4/target.h

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
20+
#define TARGET_BOARD_IDENTIFIER "BLF4"
21+
#define USBD_PRODUCT_STRING "BLADE_F4"
22+
23+
#define USE_TARGET_CONFIG
24+
25+
/*** Indicators ***/
26+
#define LED0 PC15
27+
#define LED1 PC14
28+
#define BEEPER PC13
29+
#define BEEPER_INVERTED
30+
31+
/*** SPI/I2C bus ***/
32+
#define USE_SPI
33+
#define USE_SPI_DEVICE_1
34+
#define SPI1_NSS_PIN PA4
35+
#define SPI1_SCK_PIN PA5
36+
#define SPI1_MISO_PIN PA6
37+
#define SPI1_MOSI_PIN PA7
38+
39+
#define USE_SPI_DEVICE_2
40+
#define SPI2_NSS_PIN PB12
41+
#define SPI2_SCK_PIN PB13
42+
#define SPI2_MISO_PIN PB14
43+
#define SPI2_MOSI_PIN PB15
44+
#define SPI2_FLASH_PIN PA15
45+
46+
47+
#define USE_SPI_DEVICE_3
48+
#define SPI3_SCK_PIN PC10
49+
#define SPI3_MISO_PIN PC11
50+
#define SPI3_MOSI_PIN PB5
51+
52+
#define USE_I2C
53+
#define USE_I2C_DEVICE_1
54+
#define I2C1_SCL PB8
55+
#define I2C1_SDA PB9
56+
57+
58+
/*** IMU sensors ***/
59+
60+
// MPU6000
61+
#define USE_IMU_MPU6000
62+
#define IMU_MPU6000_ALIGN CW270_DEG
63+
#define MPU6000_SPI_BUS BUS_SPI1
64+
#define MPU6000_CS_PIN SPI1_NSS_PIN
65+
66+
67+
// ICM42605/ICM42688P
68+
#define USE_IMU_ICM42605
69+
#define IMU_ICM42605_ALIGN CW270_DEG
70+
#define ICM42605_SPI_BUS BUS_SPI1
71+
#define ICM42605_CS_PIN SPI1_NSS_PIN
72+
73+
//BMI270
74+
#define USE_IMU_BMI270
75+
#define IMU_BMI270_ALIGN CW270_DEG
76+
#define BMI270_SPI_BUS BUS_SPI1
77+
#define BMI270_CS_PIN SPI1_NSS_PIN
78+
79+
80+
/*** OSD ***/
81+
#define USE_MAX7456
82+
#define MAX7456_SPI_BUS BUS_SPI2
83+
#define MAX7456_CS_PIN SPI2_NSS_PIN
84+
85+
/*** Onboard flash ***/
86+
#define USE_FLASHFS
87+
#define USE_FLASH_M25P16
88+
#define M25P16_CS_PIN SPI2_FLASH_PIN
89+
#define M25P16_SPI_BUS BUS_SPI2
90+
91+
// *** PINIO ***
92+
93+
#define USE_PINIO
94+
#define USE_PINIOBOX
95+
#define PINIO1_PIN PC2
96+
#define PINIO2_PIN PC5
97+
98+
/*** Serial ports ***/
99+
#define USE_VCP
100+
#define USE_UART_INVERTER
101+
102+
#define USE_UART1
103+
#define UART1_RX_PIN PB7
104+
#define UART1_TX_PIN PB6
105+
106+
#define USE_UART2
107+
#define UART2_RX_PIN PA3
108+
#define UART2_TX_PIN PA2
109+
#define INVERTER_PIN_UART2_RX PC0
110+
111+
#define USE_UART3
112+
#define UART3_RX_PIN PB11
113+
#define UART3_TX_PIN PB10
114+
115+
#define USE_UART4
116+
#define UART4_RX_PIN PA1
117+
#define UART4_TX_PIN PA0
118+
119+
#define USE_UART5
120+
#define UART5_RX_PIN PD2
121+
#define UART5_TX_PIN PC12
122+
123+
#define USE_UART6
124+
#define UART6_RX_PIN PC7
125+
#define UART6_TX_PIN PC6
126+
127+
#define SERIAL_PORT_COUNT 7
128+
129+
/*** BARO & MAG ***/
130+
#define USE_BARO
131+
#define BARO_I2C_BUS BUS_I2C1
132+
#define USE_BARO_BMP280
133+
#define USE_BARO_SPL06
134+
#define USE_BARO_DPS310
135+
136+
#define USE_MAG
137+
#define MAG_I2C_BUS BUS_I2C1
138+
#define USE_MAG_ALL
139+
140+
/*** ADC ***/
141+
#define USE_ADC
142+
#define ADC_CHANNEL_1_PIN PC1
143+
#define ADC_CHANNEL_2_PIN PC3
144+
145+
146+
#define VBAT_ADC_CHANNEL ADC_CHN_1
147+
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
148+
149+
150+
/*** LED STRIP ***/
151+
#define USE_LED_STRIP
152+
#define WS2811_PIN PB3
153+
154+
/*** Default settings ***/
155+
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
156+
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
157+
#define SERIALRX_PROVIDER SERIALRX_SBUS
158+
#define CURRENT_METER_SCALE 250
159+
160+
161+
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY )
162+
163+
/*** Timer/PWM output ***/
164+
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
165+
#define MAX_PWM_OUTPUT_PORTS 8
166+
#define USE_DSHOT
167+
#define USE_ESC_SENSOR
168+
169+
// ********** Optical Flow and Lidar **************
170+
#define USE_RANGEFINDER
171+
#define USE_RANGEFINDER_MSP
172+
#define USE_OPFLOW
173+
#define USE_OPFLOW_MSP
174+
175+
/*** Used pins ***/
176+
#define TARGET_IO_PORTA 0xffff
177+
#define TARGET_IO_PORTB 0xffff
178+
#define TARGET_IO_PORTC 0xffff
179+
#define TARGET_IO_PORTD (BIT(2))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target_stm32h743xi(BLADE_PRO_H7)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file is part of Cleanflight.
3+
*
4+
* Cleanflight is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Cleanflight is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
20+
#include "platform.h"
21+
22+
#include "fc/fc_msp_box.h"
23+
#include "fc/config.h"
24+
25+
#include "io/piniobox.h"
26+
27+
void targetConfiguration(void)
28+
{
29+
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
30+
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
31+
beeperConfigMutable()->pwmMode = true;
32+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* This file is part of INAV.
3+
*
4+
* INAV is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* INAV is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#include <stdint.h>
19+
20+
#include "platform.h"
21+
22+
#include "drivers/bus.h"
23+
#include "drivers/io.h"
24+
#include "drivers/pwm_mapping.h"
25+
#include "drivers/timer.h"
26+
#include "drivers/pinio.h"
27+
#include "drivers/sensor.h"
28+
29+
BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000_1, DEVHW_MPU6000, MPU6000_SPI_BUS_1, MPU6000_CS_PIN_1, MPU6000_EXTI_PIN_1, DEVFLAGS_NONE, 0, IMU_MPU6000_ALIGN_1);
30+
BUSDEV_REGISTER_SPI_TAG(busdev_mpu6000_2, DEVHW_MPU6000, MPU6000_SPI_BUS_2, MPU6000_CS_PIN_2, MPU6000_EXTI_PIN_2, DEVFLAGS_NONE, 1, IMU_MPU6000_ALIGN_2);
31+
32+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42688_1, DEVHW_ICM42605, ICM42605_SPI_BUS_1, ICM42605_CS_PIN_1, ICM42605_EXTI_PIN_1, DEVFLAGS_NONE, 0, IMU_ICM42605_ALIGN_1);
33+
BUSDEV_REGISTER_SPI_TAG(busdev_icm42688_2, DEVHW_ICM42605, ICM42605_SPI_BUS_2, ICM42605_CS_PIN_2, ICM42605_EXTI_PIN_2, DEVFLAGS_NONE, 1, IMU_ICM42605_ALIGN_2);
34+
35+
BUSDEV_REGISTER_SPI_TAG(busdev_bmi270_1, DEVHW_BMI270, BMI270_SPI_BUS_1, BMI270_CS_PIN_1, BMI270_EXTI_PIN_1, DEVFLAGS_NONE, 0, IMU_BMI270_ALIGN_1);
36+
BUSDEV_REGISTER_SPI_TAG(busdev_bmi270_2, DEVHW_BMI270, BMI270_SPI_BUS_2, BMI270_CS_PIN_2, BMI270_EXTI_PIN_2, DEVFLAGS_NONE, 1, IMU_BMI270_ALIGN_2);
37+
38+
timerHardware_t timerHardware[] = {
39+
40+
DEF_TIM(TIM3, CH4, PB1, TIM_USE_OUTPUT_AUTO, 0, 0), // S2
41+
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 1), // S1
42+
DEF_TIM(TIM5, CH2, PA1, TIM_USE_OUTPUT_AUTO, 0, 2), // S4
43+
DEF_TIM(TIM5, CH1, PA0, TIM_USE_OUTPUT_AUTO, 0, 3), // S3
44+
45+
DEF_TIM(TIM5, CH3, PA2, TIM_USE_OUTPUT_AUTO, 0, 4), // S5
46+
DEF_TIM(TIM5, CH4, PA3, TIM_USE_OUTPUT_AUTO, 0, 5), // S6
47+
DEF_TIM(TIM4, CH1, PD12, TIM_USE_OUTPUT_AUTO, 0, 6), // S7
48+
DEF_TIM(TIM4, CH2, PD13, TIM_USE_OUTPUT_AUTO, 0, 7), // S8
49+
50+
DEF_TIM(TIM15, CH1, PE5, TIM_USE_OUTPUT_AUTO, 0, 0), // S11
51+
DEF_TIM(TIM15, CH2, PE6, TIM_USE_OUTPUT_AUTO, 0, 0), // S12 DMA_NONE
52+
DEF_TIM(TIM4, CH4, PD15, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA_NONE
53+
DEF_TIM(TIM4, CH3, PD14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9
54+
55+
DEF_TIM(TIM1, CH1, PA8, TIM_USE_LED, 0, 9), // LED_2812
56+
DEF_TIM(TIM2, CH1, PA15, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
57+
58+
};
59+
60+
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);

0 commit comments

Comments
 (0)