feat(driver): autodetect IMU, add support for SC7U22 (#7191)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
raphaelcoeffic
Claude Opus 4.6
parent
5ea531d391
commit
0ce5c8f3f2
@@ -48,11 +48,13 @@
|
||||
#include "sdcard.h"
|
||||
#include "debug.h"
|
||||
#include "keys.h"
|
||||
#include "gyro.h"
|
||||
|
||||
#include "flysky_gimbal_driver.h"
|
||||
#include "timers_driver.h"
|
||||
|
||||
#include "battery_driver.h"
|
||||
#include "drivers/lsm6ds.h"
|
||||
|
||||
#include "bitmapbuffer.h"
|
||||
#include "colors.h"
|
||||
@@ -173,6 +175,14 @@ void boardBLInit()
|
||||
flashRegisterDriver(QSPI_BASE, 8 * 1024 * 1024, &extflash_driver);
|
||||
}
|
||||
|
||||
static void gyroInit()
|
||||
{
|
||||
const etx_imu_t candidates[] = {
|
||||
{ &imu_lsm6ds_driver, IMU_I2C_BUS, IMU_I2C_ADDRESS },
|
||||
};
|
||||
gyroStart(imuDetect(candidates, DIM(candidates)));
|
||||
}
|
||||
|
||||
void boardInit()
|
||||
{
|
||||
// enable interrupts
|
||||
@@ -263,6 +273,8 @@ void boardInit()
|
||||
#if defined(RTCLOCK)
|
||||
rtcInit(); // RTC must be initialized before rambackupRestore() is called
|
||||
#endif
|
||||
|
||||
gyroInit();
|
||||
}
|
||||
|
||||
extern void rtcDisableBackupReg();
|
||||
|
||||
Reference in New Issue
Block a user