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. (#14528)

This commit is contained in:
mjs1441 2025-07-09 18:18:58 +01:00 committed by GitHub
parent 9458ac043a
commit 2ad78c5571
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);