mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Adding both AirbotF4 and Revolt targets
This commit is contained in:
parent
3b506415c9
commit
8304becff7
7 changed files with 43 additions and 10 deletions
|
@ -15,9 +15,12 @@
|
|||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MPU6500_WHO_AM_I_CONST (0x70)
|
||||
#define MPU9250_WHO_AM_I_CONST (0x71)
|
||||
#define ICM20608G_WHO_AM_I_CONST (0xAF)
|
||||
#define ICM20602_WHO_AM_I_CONST (0x12)
|
||||
|
||||
#define MPU6500_BIT_RESET (0x80)
|
||||
#define MPU6500_BIT_INT_ANYRD_2CLEAR (1 << 4)
|
||||
|
@ -25,8 +28,6 @@
|
|||
#define MPU6500_BIT_I2C_IF_DIS (1 << 4)
|
||||
#define MPU6500_BIT_RAW_RDY_EN (0x01)
|
||||
|
||||
#pragma once
|
||||
|
||||
bool mpu6500AccDetect(acc_t *acc);
|
||||
bool mpu6500GyroDetect(gyro_t *gyro);
|
||||
|
||||
|
|
|
@ -84,7 +84,10 @@ bool mpu6500SpiDetect(void)
|
|||
|
||||
mpu6500ReadRegister(MPU_RA_WHO_AM_I, 1, &tmp);
|
||||
|
||||
if (tmp == MPU6500_WHO_AM_I_CONST || tmp == MPU9250_WHO_AM_I_CONST || tmp == ICM20608G_WHO_AM_I_CONST) {
|
||||
if (tmp == MPU6500_WHO_AM_I_CONST ||
|
||||
tmp == MPU9250_WHO_AM_I_CONST ||
|
||||
tmp == ICM20608G_WHO_AM_I_CONST ||
|
||||
tmp == ICM20602_WHO_AM_I_CONST) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
struct dmaChannelDescriptor_s;
|
||||
typedef void (*dmaCallbackHandlerFuncPtr)(struct dmaChannelDescriptor_s *channelDescriptor);
|
||||
|
|
0
src/main/target/REVO/AIRBOTF4.mk
Normal file
0
src/main/target/REVO/AIRBOTF4.mk
Normal file
0
src/main/target/REVO/REVOLT.mk
Normal file
0
src/main/target/REVO/REVOLT.mk
Normal file
|
@ -17,20 +17,33 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define TARGET_BOARD_IDENTIFIER "REVO"
|
||||
|
||||
#define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
|
||||
|
||||
#if defined(AIRBOTF4)
|
||||
#define TARGET_BOARD_IDENTIFIER "AIR4"
|
||||
#define USBD_PRODUCT_STRING "AirbotF4"
|
||||
|
||||
#elif defined(REVOLT)
|
||||
#define TARGET_BOARD_IDENTIFIER "RVLT"
|
||||
#define USBD_PRODUCT_STRING "Revolt"
|
||||
|
||||
#else
|
||||
#define TARGET_BOARD_IDENTIFIER "REVO"
|
||||
#define USBD_PRODUCT_STRING "Revolution"
|
||||
|
||||
#ifdef OPBL
|
||||
#define USBD_SERIALNUMBER_STRING "0x8020000"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define USE_DSHOT
|
||||
|
||||
#define LED0 PB5
|
||||
// Disable LED1, conflicts with AirbotF4/Flip32F4 beeper
|
||||
//#define LED1 PB4
|
||||
#if !defined(AIRBOTF4)
|
||||
#define LED1 PB4
|
||||
#endif
|
||||
|
||||
#define BEEPER PB4
|
||||
#define BEEPER_INVERTED
|
||||
|
@ -41,19 +54,31 @@
|
|||
#define MPU6000_CS_PIN PA4
|
||||
#define MPU6000_SPI_INSTANCE SPI1
|
||||
|
||||
#define MPU6500_CS_PIN PA4
|
||||
#define MPU6500_SPI_INSTANCE SPI1
|
||||
|
||||
#define ACC
|
||||
#define USE_ACC_SPI_MPU6000
|
||||
#define GYRO_MPU6000_ALIGN CW270_DEG
|
||||
|
||||
#define USE_ACC_MPU6500
|
||||
#define USE_ACC_SPI_MPU6500
|
||||
#define ACC_MPU6500_ALIGN CW270_DEG
|
||||
|
||||
#define GYRO
|
||||
#define USE_GYRO_SPI_MPU6000
|
||||
#define ACC_MPU6000_ALIGN CW270_DEG
|
||||
|
||||
#define USE_GYRO_MPU6500
|
||||
#define USE_GYRO_SPI_MPU6500
|
||||
#define GYRO_MPU9250_ALIGN CW270_DEG
|
||||
|
||||
// MPU6000 interrupts
|
||||
#define USE_EXTI
|
||||
#define MPU_INT_EXTI PC4
|
||||
#define USE_MPU_DATA_READY_SIGNAL
|
||||
|
||||
#if !defined(AIRBOTF4) && !defined(REVOLT)
|
||||
#define MAG
|
||||
#define USE_MAG_HMC5883
|
||||
#define MAG_HMC5883_ALIGN CW90_DEG
|
||||
|
@ -67,6 +92,7 @@
|
|||
//#define PITOT
|
||||
//#define USE_PITOT_MS4525
|
||||
//#define MS4525_BUS I2C_DEVICE_EXT
|
||||
#endif
|
||||
|
||||
#define M25P16_CS_PIN PB3
|
||||
#define M25P16_SPI_INSTANCE SPI3
|
||||
|
|
|
@ -3,5 +3,7 @@ FEATURES += VCP ONBOARDFLASH
|
|||
|
||||
TARGET_SRC = \
|
||||
drivers/accgyro_spi_mpu6000.c \
|
||||
drivers/accgyro_mpu6500.c \
|
||||
drivers/accgyro_spi_mpu6500.c \
|
||||
drivers/barometer_ms5611.c \
|
||||
drivers/compass_hmc5883l.c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue