1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00

accgyro_mpu initialise gyro->segments.

This commit is contained in:
Matthew Selby 2025-07-08 16:36:32 +01:00
parent 6c9e77d5b7
commit 085b7de5f1

View file

@ -491,6 +491,12 @@ bool mpuDetect(gyroDev_t *gyro, const gyroDeviceConfig_t *config)
void mpuGyroInit(gyroDev_t *gyro)
{
// Initialise both segments of gyro->segments.
// Gyro code only sets the first segment. The second segment stays as
// an end segment with negateCS false, which enforces DMA whenever possible.
busSegment_t nullSegment = {.u.link = {NULL, NULL}, 0, false, NULL};
gyro->segments[0] = nullSegment;
gyro->segments[1] = nullSegment;
gyro->accDataReg = MPU_RA_ACCEL_XOUT_H;
gyro->gyroDataReg = MPU_RA_GYRO_XOUT_H;
mpuIntExtiInit(gyro);