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:
parent
9458ac043a
commit
2ad78c5571
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue