mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Merge pull request #5868 from jflyper/bfdev-poc-migrate-to-dual-gyro
Configurable ACC/GYRO
This commit is contained in:
commit
8207dab3e5
136 changed files with 1112 additions and 1135 deletions
|
@ -70,6 +70,7 @@
|
|||
#include "pg/beeper_dev.h"
|
||||
#include "pg/dashboard.h"
|
||||
#include "pg/flash.h"
|
||||
#include "pg/gyrodev.h"
|
||||
#include "pg/max7456.h"
|
||||
#include "pg/pg.h"
|
||||
#include "pg/pg_ids.h"
|
||||
|
@ -158,7 +159,7 @@ static const char * const lookupTableAlignment[] = {
|
|||
"CW270FLIP"
|
||||
};
|
||||
|
||||
#ifdef USE_DUAL_GYRO
|
||||
#ifdef USE_MULTI_GYRO
|
||||
static const char * const lookupTableGyro[] = {
|
||||
"FIRST", "SECOND", "BOTH"
|
||||
};
|
||||
|
@ -289,7 +290,10 @@ static const char * const lookupTableFailsafeSwitchMode[] = {
|
|||
};
|
||||
|
||||
static const char * const lookupTableBusType[] = {
|
||||
"NONE", "I2C", "SPI", "SLAVE"
|
||||
"NONE", "I2C", "SPI", "SLAVE",
|
||||
#if defined(USE_SPI_GYRO) && defined(USE_I2C_GYRO)
|
||||
"GYROAUTO"
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef USE_MAX7456
|
||||
|
@ -458,7 +462,7 @@ const lookupTableEntry_t lookupTables[] = {
|
|||
#ifdef USE_LED_STRIP
|
||||
LOOKUP_TABLE_ENTRY(lookupLedStripFormatRGB),
|
||||
#endif
|
||||
#ifdef USE_DUAL_GYRO
|
||||
#ifdef USE_MULTI_GYRO
|
||||
LOOKUP_TABLE_ENTRY(lookupTableGyro),
|
||||
#endif
|
||||
LOOKUP_TABLE_ENTRY(lookupTableThrottleLimitType),
|
||||
|
@ -485,6 +489,7 @@ const lookupTableEntry_t lookupTables[] = {
|
|||
#ifdef USE_VTX_COMMON
|
||||
LOOKUP_TABLE_ENTRY(lookupTableVtxLowPowerDisarm),
|
||||
#endif
|
||||
LOOKUP_TABLE_ENTRY(lookupTableGyroHardware),
|
||||
};
|
||||
|
||||
#undef LOOKUP_TABLE_ENTRY
|
||||
|
@ -526,7 +531,7 @@ const clivalue_t valueTable[] = {
|
|||
#if defined(GYRO_USES_SPI) && defined(USE_32K_CAPABLE_GYRO)
|
||||
{ "gyro_use_32khz", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_GYRO_CONFIG, offsetof(gyroConfig_t, gyro_use_32khz) },
|
||||
#endif
|
||||
#ifdef USE_DUAL_GYRO
|
||||
#ifdef USE_MULTI_GYRO
|
||||
{ "gyro_to_use", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_GYRO }, PG_GYRO_CONFIG, offsetof(gyroConfig_t, gyro_to_use) },
|
||||
#endif
|
||||
#if defined(USE_GYRO_DATA_ANALYSE)
|
||||
|
@ -1151,7 +1156,19 @@ const clivalue_t valueTable[] = {
|
|||
// RCDEVICE
|
||||
#ifdef USE_RCDEVICE
|
||||
{ "rcdevice_init_dev_attempts", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, 10 }, PG_RCDEVICE_CONFIG, offsetof(rcdeviceConfig_t, initDeviceAttempts) },
|
||||
{ "rcdevice_init_dev_attempt_interval", VAR_UINT32 | MASTER_VALUE, .config.minmax = { 500, 5000 }, PG_RCDEVICE_CONFIG, offsetof(rcdeviceConfig_t, initDeviceAttemptInterval) }
|
||||
{ "rcdevice_init_dev_attempt_interval", VAR_UINT32 | MASTER_VALUE, .config.minmax = { 500, 5000 }, PG_RCDEVICE_CONFIG, offsetof(rcdeviceConfig_t, initDeviceAttemptInterval) },
|
||||
#endif
|
||||
|
||||
// PG_GYRO_DEVICE_CONFIG
|
||||
{ "gyro_1_bustype", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_BUS_TYPE }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, bustype) },
|
||||
{ "gyro_1_spibus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, SPIDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, spiBus) },
|
||||
{ "gyro_1_i2cBus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2CDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, i2cBus) },
|
||||
{ "gyro_1_i2c_address", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2C_ADDR7_MAX }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, i2cAddress) },
|
||||
#ifdef USE_MULTI_GYRO
|
||||
{ "gyro_2_bustype", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_BUS_TYPE }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, bustype) },
|
||||
{ "gyro_2_spibus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, SPIDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, spiBus) },
|
||||
{ "gyro_2_i2cBus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2CDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, i2cBus) },
|
||||
{ "gyro_2_i2c_address", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2C_ADDR7_MAX }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, i2cAddress) },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue