Add mpu6500 support for new board revision, cleanup code

This commit is contained in:
Evgeny Sychov 2016-03-20 20:04:11 -07:00
parent c1cac9fe56
commit 46e50fb9c2
4 changed files with 21 additions and 20 deletions

View File

@ -752,7 +752,9 @@ SPRACINGF3MINI_SRC = \
SIRINFPV_SRC = \
$(STM32F30x_COMMON_SRC) \
drivers/accgyro_mpu.c \
drivers/accgyro_mpu6500.c \
drivers/accgyro_spi_mpu6000.c \
drivers/accgyro_spi_mpu6500.c \
drivers/serial_usb_vcp.c \
drivers/sdcard.c \
drivers/sdcard_standard.c \

View File

@ -142,7 +142,7 @@ void rtc6705_set_channel(uint16_t channel_freq) {
uint32_t freq = (uint32_t)channel_freq * 1000;
uint32_t N, A;
freq /= 40; // TODO check all channels for the R value
freq /= 40;
N = freq / 64;
A = freq % 64;
rtc6705_write_register(0, 400);

View File

@ -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 } },
{ "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 } },
{ "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_offset", VAR_UINT8 | MASTER_VALUE, &masterConfig.rxConfig.acroPlusOffset, .config.minmax = {1, 90 } },
*/
@ -460,7 +458,7 @@ page_t menu_pages[] = {
{
.title = "PID SETTINGS",
.cols_number = 3,
.rows_number = 6,
.rows_number = 8,
.cols = {
{
.title = "P",

View File

@ -17,7 +17,11 @@
#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_PIN Pin_1
@ -25,18 +29,20 @@
#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 ENSURE_MPU_DATA_READY_IS_LOW
#define GYRO
#define USE_GYRO_SPI_MPU6000
//#define USE_GYRO_SPI_MPU6500
#define USE_GYRO_MPU6500
#define USE_GYRO_SPI_MPU6500
#define ACC
#define USE_ACC_SPI_MPU6000
//#define USE_ACC_SPI_MPU6500
#define USE_ACC_MPU6500
#define USE_ACC_SPI_MPU6500
// MPU6000
#define ACC_MPU6000_ALIGN CW180_DEG
@ -47,8 +53,8 @@
#define MPU6000_SPI_INSTANCE SPI1
// MPU6500
#define ACC_MPU6500_ALIGN CW180_DEG
#define GYRO_MPU6500_ALIGN CW180_DEG
#define ACC_MPU6500_ALIGN CW90_DEG
#define GYRO_MPU6500_ALIGN CW90_DEG
#define MPU6500_CS_GPIO GPIOA
#define MPU6500_CS_PIN GPIO_Pin_4
@ -59,11 +65,11 @@
#define BEEPER
#define USB_IO
#define USB_CABLE_DETECTION
#define USB_DETECT_PIN GPIO_Pin_2
#define USB_DETECT_GPIO_PORT GPIOB
#define USB_DETECT_GPIO_CLK RCC_AHBPeriph_GPIOB
//#define USB_CABLE_DETECTION
//#define USB_DETECT_PIN GPIO_Pin_2
//#define USB_DETECT_GPIO_PORT GPIOB
//#define USB_DETECT_GPIO_CLK RCC_AHBPeriph_GPIOB
#define USE_VCP
#define USE_USART1
@ -175,7 +181,6 @@
#define USE_ADC
#define BOARD_HAS_VOLTAGE_DIVIDER
#define ADC_INSTANCE ADC1
#define ADC_DMA_CHANNEL DMA1_Channel1
#define ADC_AHB_PERIPHERAL RCC_AHBPeriph_DMA1
@ -192,11 +197,7 @@
#define GTUNE
#define USE_CLI
#define OSD
//#define SPEKTRUM_BIND
// USART3,
//#define BIND_PORT GPIOB
//#define BIND_PIN Pin_11
#define LED0
#define USE_SERIAL_1WIRE