Add mpu6500 support for new board revision, cleanup code
This commit is contained in:
parent
c1cac9fe56
commit
46e50fb9c2
2
Makefile
2
Makefile
|
@ -752,7 +752,9 @@ SPRACINGF3MINI_SRC = \
|
||||||
SIRINFPV_SRC = \
|
SIRINFPV_SRC = \
|
||||||
$(STM32F30x_COMMON_SRC) \
|
$(STM32F30x_COMMON_SRC) \
|
||||||
drivers/accgyro_mpu.c \
|
drivers/accgyro_mpu.c \
|
||||||
|
drivers/accgyro_mpu6500.c \
|
||||||
drivers/accgyro_spi_mpu6000.c \
|
drivers/accgyro_spi_mpu6000.c \
|
||||||
|
drivers/accgyro_spi_mpu6500.c \
|
||||||
drivers/serial_usb_vcp.c \
|
drivers/serial_usb_vcp.c \
|
||||||
drivers/sdcard.c \
|
drivers/sdcard.c \
|
||||||
drivers/sdcard_standard.c \
|
drivers/sdcard_standard.c \
|
||||||
|
|
|
@ -142,7 +142,7 @@ void rtc6705_set_channel(uint16_t channel_freq) {
|
||||||
uint32_t freq = (uint32_t)channel_freq * 1000;
|
uint32_t freq = (uint32_t)channel_freq * 1000;
|
||||||
uint32_t N, A;
|
uint32_t N, A;
|
||||||
|
|
||||||
freq /= 40; // TODO check all channels for the R value
|
freq /= 40;
|
||||||
N = freq / 64;
|
N = freq / 64;
|
||||||
A = freq % 64;
|
A = freq % 64;
|
||||||
rtc6705_write_register(0, 400);
|
rtc6705_write_register(0, 400);
|
||||||
|
|
|
@ -397,8 +397,6 @@ void print_batt_voltage(uint16_t pos, uint8_t col) {
|
||||||
{ "rc_yaw_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawExpo8, .config.minmax = { 0, 100 } },
|
{ "rc_yaw_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].rcYawExpo8, .config.minmax = { 0, 100 } },
|
||||||
{ "thr_mid", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrMid8, .config.minmax = { 0, 100 } },
|
{ "thr_mid", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrMid8, .config.minmax = { 0, 100 } },
|
||||||
{ "thr_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrExpo8, .config.minmax = { 0, 100 } },
|
{ "thr_expo", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].thrExpo8, .config.minmax = { 0, 100 } },
|
||||||
{ "tpa_rate", VAR_UINT8 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].dynThrPID, .config.minmax = { 0, CONTROL_RATE_CONFIG_TPA_MAX} },
|
|
||||||
{ "tpa_breakpoint", VAR_UINT16 | PROFILE_RATE_VALUE, &masterConfig.profile[0].controlRateProfile[0].tpa_breakpoint, .config.minmax = { PWM_RANGE_MIN, PWM_RANGE_MAX} },
|
|
||||||
{ "acro_plus_factor", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.acroPlusFactor, .config.minmax = {1, 100 } },
|
{ "acro_plus_factor", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.acroPlusFactor, .config.minmax = {1, 100 } },
|
||||||
{ "acro_plus_offset", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.acroPlusOffset, .config.minmax = {1, 90 } },
|
{ "acro_plus_offset", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.acroPlusOffset, .config.minmax = {1, 90 } },
|
||||||
*/
|
*/
|
||||||
|
@ -460,7 +458,7 @@ page_t menu_pages[] = {
|
||||||
{
|
{
|
||||||
.title = "PID SETTINGS",
|
.title = "PID SETTINGS",
|
||||||
.cols_number = 3,
|
.cols_number = 3,
|
||||||
.rows_number = 6,
|
.rows_number = 8,
|
||||||
.cols = {
|
.cols = {
|
||||||
{
|
{
|
||||||
.title = "P",
|
.title = "P",
|
||||||
|
|
|
@ -17,7 +17,11 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TARGET_BOARD_IDENTIFIER "FPVR"
|
#define TARGET_BOARD_IDENTIFIER "SIRF"
|
||||||
|
|
||||||
|
#define LED0_GPIO GPIOB
|
||||||
|
#define LED0_PIN Pin_2
|
||||||
|
#define LED0_PERIPHERAL RCC_AHBPeriph_GPIOB
|
||||||
|
|
||||||
#define BEEP_GPIO GPIOA
|
#define BEEP_GPIO GPIOA
|
||||||
#define BEEP_PIN Pin_1
|
#define BEEP_PIN Pin_1
|
||||||
|
@ -25,18 +29,20 @@
|
||||||
|
|
||||||
#define USABLE_TIMER_CHANNEL_COUNT 6
|
#define USABLE_TIMER_CHANNEL_COUNT 6
|
||||||
|
|
||||||
#define EXTI15_10_CALLBACK_HANDLER_COUNT 2 // MPU_INT, SDCardDetect
|
#define EXTI15_10_CALLBACK_HANDLER_COUNT 1 // MPU_INT
|
||||||
|
|
||||||
#define USE_MPU_DATA_READY_SIGNAL
|
#define USE_MPU_DATA_READY_SIGNAL
|
||||||
#define ENSURE_MPU_DATA_READY_IS_LOW
|
#define ENSURE_MPU_DATA_READY_IS_LOW
|
||||||
|
|
||||||
#define GYRO
|
#define GYRO
|
||||||
#define USE_GYRO_SPI_MPU6000
|
#define USE_GYRO_SPI_MPU6000
|
||||||
//#define USE_GYRO_SPI_MPU6500
|
#define USE_GYRO_MPU6500
|
||||||
|
#define USE_GYRO_SPI_MPU6500
|
||||||
|
|
||||||
#define ACC
|
#define ACC
|
||||||
#define USE_ACC_SPI_MPU6000
|
#define USE_ACC_SPI_MPU6000
|
||||||
//#define USE_ACC_SPI_MPU6500
|
#define USE_ACC_MPU6500
|
||||||
|
#define USE_ACC_SPI_MPU6500
|
||||||
|
|
||||||
// MPU6000
|
// MPU6000
|
||||||
#define ACC_MPU6000_ALIGN CW180_DEG
|
#define ACC_MPU6000_ALIGN CW180_DEG
|
||||||
|
@ -47,8 +53,8 @@
|
||||||
#define MPU6000_SPI_INSTANCE SPI1
|
#define MPU6000_SPI_INSTANCE SPI1
|
||||||
|
|
||||||
// MPU6500
|
// MPU6500
|
||||||
#define ACC_MPU6500_ALIGN CW180_DEG
|
#define ACC_MPU6500_ALIGN CW90_DEG
|
||||||
#define GYRO_MPU6500_ALIGN CW180_DEG
|
#define GYRO_MPU6500_ALIGN CW90_DEG
|
||||||
|
|
||||||
#define MPU6500_CS_GPIO GPIOA
|
#define MPU6500_CS_GPIO GPIOA
|
||||||
#define MPU6500_CS_PIN GPIO_Pin_4
|
#define MPU6500_CS_PIN GPIO_Pin_4
|
||||||
|
@ -59,11 +65,11 @@
|
||||||
#define BEEPER
|
#define BEEPER
|
||||||
|
|
||||||
#define USB_IO
|
#define USB_IO
|
||||||
#define USB_CABLE_DETECTION
|
|
||||||
|
|
||||||
#define USB_DETECT_PIN GPIO_Pin_2
|
//#define USB_CABLE_DETECTION
|
||||||
#define USB_DETECT_GPIO_PORT GPIOB
|
//#define USB_DETECT_PIN GPIO_Pin_2
|
||||||
#define USB_DETECT_GPIO_CLK RCC_AHBPeriph_GPIOB
|
//#define USB_DETECT_GPIO_PORT GPIOB
|
||||||
|
//#define USB_DETECT_GPIO_CLK RCC_AHBPeriph_GPIOB
|
||||||
|
|
||||||
#define USE_VCP
|
#define USE_VCP
|
||||||
#define USE_USART1
|
#define USE_USART1
|
||||||
|
@ -175,7 +181,6 @@
|
||||||
#define USE_ADC
|
#define USE_ADC
|
||||||
#define BOARD_HAS_VOLTAGE_DIVIDER
|
#define BOARD_HAS_VOLTAGE_DIVIDER
|
||||||
|
|
||||||
|
|
||||||
#define ADC_INSTANCE ADC1
|
#define ADC_INSTANCE ADC1
|
||||||
#define ADC_DMA_CHANNEL DMA1_Channel1
|
#define ADC_DMA_CHANNEL DMA1_Channel1
|
||||||
#define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA1
|
#define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA1
|
||||||
|
@ -192,11 +197,7 @@
|
||||||
#define GTUNE
|
#define GTUNE
|
||||||
#define USE_CLI
|
#define USE_CLI
|
||||||
#define OSD
|
#define OSD
|
||||||
|
#define LED0
|
||||||
//#define SPEKTRUM_BIND
|
|
||||||
// USART3,
|
|
||||||
//#define BIND_PORT GPIOB
|
|
||||||
//#define BIND_PIN Pin_11
|
|
||||||
|
|
||||||
#define USE_SERIAL_1WIRE
|
#define USE_SERIAL_1WIRE
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue