Skip to content

Commit 33c90a1

Browse files
authored
4.3.4 alpha new target (#23)
* sync ledstip configs * fix led strip * add new target * make flash as default blackbox
1 parent 20d4b6c commit 33c90a1

File tree

10 files changed

+296
-10
lines changed

10 files changed

+296
-10
lines changed

src/main/drivers/timer_def.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,5 +425,9 @@
425425
#define DEF_TIM_AF__PE5__TCH_TMR9_CH1 D(2, 9)
426426
#define DEF_TIM_AF__PE6__TCH_TMR9_CH2 D(2, 9)
427427

428+
//PORT H MUX 2
429+
#define DEF_TIM_AF__PH2__TCH_TMR5_CH1 D(1, 5)
430+
#define DEF_TIM_AF__PH3__TCH_TMR5_CH2 D(2, 5)
431+
428432
#endif
429433

src/main/target/BETAFPVF435/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#define SPI2_MISO_PIN PB14
7777
#define SPI2_MOSI_PIN PB15
7878

79-
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
79+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
8080
#define USE_FLASHFS
8181
#define USE_FLASH_M25P16
8282
#define USE_FLASH_W25N01G // 1Gb NAND flash support

src/main/target/CCRCF435AIO/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
105105

106106
/********************BLACKBOX***********************/
107-
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
107+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
108108
#define USE_FLASHFS
109109
#define USE_FLASH_M25P16
110110
#define USE_FLASH_W25N01G // 1Gb NAND flash support
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* This file is part of Cleanflight and Betaflight.
3+
*
4+
* Cleanflight and Betaflight are free software. You can redistribute
5+
* this software and/or modify this software under the terms of the
6+
* GNU General Public License as published by the Free Software
7+
* Foundation, either version 3 of the License, or (at your option)
8+
* any later version.
9+
*
10+
* Cleanflight and Betaflight are distributed in the hope that they
11+
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
12+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
* See the GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software.
17+
*
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#include <stdint.h>
22+
23+
#include "platform.h"
24+
#include "drivers/io.h"
25+
26+
#include "drivers/dma.h"
27+
#include "drivers/timer.h"
28+
#include "drivers/timer_def.h"
29+
30+
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
31+
DEF_TIM(TMR5, CH1, PA0, TIM_USE_ANY | TIM_USE_SERVO, 0, 11, 0), // servo 1
32+
DEF_TIM(TMR2, CH2, PA1, TIM_USE_ANY | TIM_USE_LED, 0, 7, 0), // PWM1 - OUT1 MCO1 DMA1 CH2
33+
// DEF_TIM(TMR5, CH2, PH3, TIM_USE_ANY | TIM_USE_SERVO, 0, 6, 0), // servo 2
34+
35+
DEF_TIM(TMR8, CH4, PC9, TIM_USE_MOTOR, 0, 0, 1), // motor1 DMA1 CH1
36+
DEF_TIM(TMR8, CH3, PC8, TIM_USE_MOTOR, 0, 2, 1), // motor2 DMA1 CH3
37+
DEF_TIM(TMR8, CH2, PC7, TIM_USE_MOTOR, 0, 1, 0), // motor3 DMA1 CH1
38+
DEF_TIM(TMR8, CH1, PC6, TIM_USE_MOTOR, 0, 3, 0), // motor4 DMA1 CH4
39+
DEF_TIM(TMR4, CH1, PB6, TIM_USE_ANY | TIM_USE_SERVO, 0, 11, 10), // servo 3
40+
DEF_TIM(TMR4, CH2, PB7, TIM_USE_ANY | TIM_USE_SERVO, 0, 10, 10), // servo 4
41+
DEF_TIM(TMR3, CH4, PB1, TIM_USE_ANY | TIM_USE_SERVO, 0, 8, 10), // servo 5
42+
DEF_TIM(TMR3, CH3, PB0, TIM_USE_ANY | TIM_USE_SERVO, 0, 9, 10), // servo 6
43+
DEF_TIM(TMR4, CH3, PB8, TIM_USE_ANY | TIM_USE_SERVO, 0, 11, 10), // servo 7
44+
45+
};
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
/*
2+
* This file is part of Cleanflight and Betaflight.
3+
*
4+
* Cleanflight and Betaflight are free software. You can redistribute
5+
* this software and/or modify this software under the terms of the
6+
* GNU General Public License as published by the Free Software
7+
* Foundation, either version 3 of the License, or (at your option)
8+
* any later version.
9+
*
10+
* Cleanflight and Betaflight are distributed in the hope that they
11+
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
12+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
* See the GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this software.
17+
*
18+
* If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
#pragma once
22+
23+
#define TARGET_BOARD_IDENTIFIER "GMRC"
24+
#define USBD_PRODUCT_STRING "GREAT-MOUNTAIN-F4"
25+
/**********swd debuger reserved *****************
26+
*
27+
* pa13 swdio
28+
* pa14 swclk
29+
* PA15 JTDI
30+
* PB4 JREST
31+
* pb3 swo /DTO
32+
*
33+
* other pin
34+
*
35+
* BOOT0 button
36+
* PA8 MCO1
37+
* PA12 OTG1 D+ DP
38+
* PA11 OTG1 D- DM
39+
* PH0 HEXT IN
40+
* PH1 HEXT OUT
41+
*/
42+
#define SYSTEM_HSE_MHZ 8
43+
//No Buttons
44+
45+
//LEDS
46+
#define LED0_PIN PC4 //confirm on LQFP64
47+
48+
#define USE_BEEPER
49+
#define BEEPER_PIN PC15
50+
#define BEEPER_INVERTED //低电平触发
51+
52+
//ESC Protocol
53+
54+
#define ENABLE_DSHOT_DMAR DSHOT_DMAR_AUTO
55+
#define DSHOT_BITBANG_DEFAULT DSHOT_BITBANG_AUTO
56+
57+
// *************** SPI **********************
58+
#define USE_SPI
59+
#define USE_SPI_DEVICE_1
60+
61+
#define SPI1_SCK_PIN PA5
62+
#define SPI1_MISO_PIN PA6
63+
#define SPI1_MOSI_PIN PA7
64+
#define SPI1_NSS_PIN PA15
65+
66+
#define USE_SPI_DEVICE_2
67+
#define SPI2_SCK_PIN PB13
68+
#define SPI2_MISO_PIN PB14
69+
#define SPI2_MOSI_PIN PB15
70+
#define SPI2_NSS_PIN PB12
71+
72+
#define USE_SPI_DEVICE_3
73+
#define SPI3_SCK_PIN PB3
74+
#define SPI3_MISO_PIN PB4
75+
#define SPI3_MOSI_PIN PB5
76+
#define SPI3_NSS_PIN PB9
77+
78+
// *************** Gyro & ACC **********************
79+
80+
#define USE_EXTI
81+
#define USE_GYRO_EXTI
82+
#define GYRO_1_EXTI_PIN PA8
83+
#define USE_MPU_DATA_READY_SIGNAL
84+
#define ENSURE_MPU_DATA_READY_IS_LOW
85+
86+
#define GYRO_1_CS_PIN SPI1_NSS_PIN
87+
#define GYRO_1_SPI_INSTANCE SPI1
88+
#define GYRO_1_ALIGN CW180_DEG
89+
90+
91+
#define USE_GYRO
92+
// #define USE_GYRO_SPI_MPU6500 //debug only
93+
// #define USE_ACC_SPI_MPU6500 //debug only
94+
#define USE_GYRO_SPI_ICM42688P
95+
#define USE_ACCGYRO_BMI270
96+
#define USE_ACCGYRO_ASM330LHH
97+
#define USE_ACCGYRO_BMI323
98+
#define USE_GYRO_SPI_ICM20689
99+
#define USE_ACC_SPI_ICM20689
100+
101+
#define USE_ACC
102+
#define USE_ACC_SPI_ICM42688P
103+
104+
105+
// *************** OSD *****************************
106+
//USE SPI3 ON AT-START BOARD ,USE SPI2 ON LQFP64
107+
#define USE_MAX7456
108+
#define MAX7456_SPI_INSTANCE SPI2
109+
#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
110+
111+
/********************BLACKBOX***********************/
112+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
113+
#define USE_FLASHFS
114+
#define USE_FLASH_M25P16
115+
#define USE_FLASH_W25N01G // 1Gb NAND flash support
116+
#define USE_FLASH_W25M // Stacked die support
117+
#define USE_FLASH_W25M512 // 512Kb (256Kb x 2 stacked) NOR flash support
118+
#define USE_FLASH_W25M02G // 2Gb (1Gb x 2 stacked) NAND flash support
119+
#define FLASH_SPI_INSTANCE SPI3
120+
#define FLASH_CS_PIN SPI3_NSS_PIN
121+
122+
123+
124+
// *************** Baro **************************
125+
#define USE_I2C
126+
#define USE_I2C_DEVICE_2
127+
#define I2C_DEVICE (I2CDEV_2)
128+
#define I2C2_SCL PB10 // SCL pad
129+
#define I2C2_SDA PB11 // SDA pad
130+
#define USE_I2C_PULLUP
131+
132+
#define USE_BARO
133+
#define USE_BARO_BMP280
134+
#define USE_BARO_DPS310
135+
#define BARO_I2C_INSTANCE (I2CDEV_2)
136+
137+
#define USE_MAG
138+
#define USE_MAG_HMC5883
139+
#define USE_MAG_QMC5883
140+
#define MAG_I2C_INSTANCE (I2CDEV_2)
141+
142+
143+
// *************** UART & Serial ******************
144+
#define USE_VCP
145+
146+
#define USE_UART1
147+
#define UART1_RX_PIN PA10
148+
#define UART1_TX_PIN PA9
149+
150+
#define USE_UART2
151+
#define UART2_RX_PIN PA3
152+
#define UART2_TX_PIN PA2
153+
154+
//uart3 与i2c 复用,如果启用uart3 需要关闭i2c 的所有设备
155+
#define USE_UART3
156+
#define UART3_RX_PIN PB11
157+
#define UART3_TX_PIN PB10
158+
159+
#define USE_UART4
160+
#define UART4_RX_PIN PC11
161+
#define UART4_TX_PIN PC10
162+
163+
#define USE_UART5
164+
#define UART5_RX_PIN PD2
165+
#define UART5_TX_PIN PC12
166+
167+
//#define USE_SOFTSERIAL1
168+
//#define USE_SOFTSERIAL2
169+
170+
#define SERIAL_PORT_COUNT 6 // VCP UART1 UART2 UART3 UART4 UART5
171+
172+
#define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
173+
#define SERIALRX_PROVIDER SERIALRX_CRSF
174+
#define SERIALRX_UART SERIAL_PORT_USART2
175+
176+
177+
178+
// *************** ADC *****************************
179+
#define USE_ADC
180+
#define ADC_INSTANCE ADC1 // Default added
181+
#define ADC1_DMA_OPT 11 //DMA 2 CH 5
182+
183+
#define VBAT_ADC_PIN PC2
184+
#define CURRENT_METER_ADC_PIN PC1
185+
//#define RSSI_ADC_PIN 0
186+
187+
#define USE_ESCSERIAL
188+
189+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL | FEATURE_LED_STRIP | FEATURE_SERVO_TILT | FEATURE_CHANNEL_FORWARDING )
190+
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
191+
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
192+
193+
#define TARGET_IO_PORTA 0xffff
194+
#define TARGET_IO_PORTB 0xffff
195+
#define TARGET_IO_PORTC 0xffff
196+
#define TARGET_IO_PORTD 0xffff
197+
#define TARGET_IO_PORTE BIT(2)
198+
#define TARGET_IO_PORTH BIT(1)|BIT(2)|BIT(3)
199+
200+
#define USABLE_TIMER_CHANNEL_COUNT 28
201+
#define USED_TIMERS ( TIM_N(1) | TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8) | TIM_N(20) )
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#AT32F43xxMT7_TARGETS += $(TARGET) #FOR 4032KB
2+
AT32F43xxGT7_TARGETS += $(TARGET) #FOR 1024KB
3+
4+
CUSTOM_DEFAULTS_EXTENDED = yes
5+
FEATURES += VCP ONBOARDFLASH
6+
7+
TARGET_SRC = \
8+
drivers/accgyro/accgyro_spi_mpu6000.c \
9+
drivers/accgyro/accgyro_spi_icm426xx.c\
10+
drivers/barometer/barometer_bmp280.c \
11+
drivers/barometer/barometer_dps310.c\
12+
drivers/compass/compass_hmc5883l.c\
13+
drivers/compass/compass_qmc5883l.c\
14+
$(ROOT)/lib/main/BoschSensortec/BMI270-Sensor-API/bmi270.c \
15+
drivers/accgyro/accgyro_spi_bmi270_init.c \
16+
drivers/accgyro/accgyro_spi_bmi270.c\
17+
drivers/accgyro/accgyro_spi_asm330lhh_init.c \
18+
drivers/accgyro/accgyro_spi_asm330lhh.c \
19+
drivers/accgyro/accgyro_spi_lsm6dsl_init.c \
20+
drivers/accgyro/accgyro_spi_lsm6dsl.c \
21+
drivers/accgyro/accgyro_spi_lsm6dso_init.c \
22+
drivers/accgyro/accgyro_spi_lsm6dso.c \
23+
drivers/accgyro/accgyro_spi_qmi8658_init.c \
24+
drivers/accgyro/accgyro_spi_qmi8658.c \
25+
drivers/accgyro/accgyro_spi_icm20689.c\
26+
drivers/accgyro/accgyro_spi_bmi323_init.c\
27+
drivers/accgyro/accgyro_spi_bmi323.c\
28+
drivers/max7456.c \
29+
drivers/vtx_rtc6705.c \
30+
drivers/vtx_rtc6705_soft_spi.c \
31+
drivers/rx/expresslrs_driver_atbsp.c \
32+
drivers/rx/rx_sx127x.c \
33+
drivers/rx/rx_sx1280.c \
34+
rx/expresslrs_telemetry.c \
35+
rx/expresslrs_common.c \
36+
rx/expresslrs.c

src/main/target/GREATMOUNTAINRCF435/target.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
3535
DEF_TIM(TMR4, CH2, PB7, TIM_USE_MOTOR, 0, 2, 1), // motor 2 DMA1 CH3
3636
DEF_TIM(TMR4, CH3, PB8, TIM_USE_MOTOR, 0, 1, 0), // motor 3 DMA1 CH2
3737
DEF_TIM(TMR4, CH4, PB9, TIM_USE_MOTOR, 0, 3, 0), // motor 4 DMA1 CH4
38-
DEF_TIM(TMR3, CH1, PC6, TIM_USE_ANY | TIM_USE_MOTOR, 0, 11, 10), // motor 5
39-
DEF_TIM(TMR3, CH2, PC7, TIM_USE_ANY | TIM_USE_MOTOR, 0, 10, 10), // motor 6
40-
DEF_TIM(TMR3, CH3, PC8, TIM_USE_ANY | TIM_USE_MOTOR, 0, 9, 10), // motor 7
41-
DEF_TIM(TMR3, CH4, PC9, TIM_USE_ANY | TIM_USE_MOTOR, 0, 8, 10), // motor 8
38+
DEF_TIM(TMR3, CH1, PC6, TIM_USE_ANY | TIM_USE_SERVO, 0, 11, 10), // motor 5
39+
DEF_TIM(TMR3, CH2, PC7, TIM_USE_ANY | TIM_USE_SERVO, 0, 10, 10), // motor 6
40+
DEF_TIM(TMR3, CH3, PC8, TIM_USE_ANY | TIM_USE_SERVO, 0, 9, 10), // motor 7
41+
DEF_TIM(TMR3, CH4, PC9, TIM_USE_ANY | TIM_USE_SERVO, 0, 8, 10), // motor 8
4242

4343
};

src/main/target/GREATMOUNTAINRCF435/target.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
123123

124124
/********************BLACKBOX***********************/
125-
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
125+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
126126
#define USE_FLASHFS
127127
#define USE_FLASH_M25P16
128128
#define USE_FLASH_W25N01G // 1Gb NAND flash support
@@ -201,7 +201,7 @@
201201

202202
#define USE_ESCSERIAL
203203

204-
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL |FEATURE_LED_STRIP )
204+
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY |FEATURE_LED_STRIP| FEATURE_SERVO_TILT | FEATURE_CHANNEL_FORWARDING )
205205
#define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
206206
#define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
207207

src/main/target/NEUTRONRCF435MINI/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
110110

111111
/********************BLACKBOX***********************/
112-
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
112+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
113113
#define USE_FLASHFS
114114
#define USE_FLASH_M25P16
115115
#define USE_FLASH_W25N01G // 1Gb NAND flash support

src/main/target/NEUTRONRCF435SE/target.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
#define MAX7456_SPI_CS_PIN SPI2_NSS_PIN
110110

111111
/********************BLACKBOX***********************/
112-
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
112+
#define DEFAULT_BLACKBOX_DEVICE BLACKBOX_DEVICE_FLASH
113113
#define USE_FLASHFS
114114
#define USE_FLASH_M25P16
115115
#define USE_FLASH_W25N01G // 1Gb NAND flash support

0 commit comments

Comments
 (0)