Skip to content

Commit

Permalink
Encapsulate LSM6DSV16X driver specific macros (#13196)
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
KarateBrot committed Dec 6, 2023
1 parent 3cfad86 commit 71199b1
Show file tree
Hide file tree
Showing 5 changed files with 822 additions and 820 deletions.
5 changes: 3 additions & 2 deletions src/main/drivers/accgyro/accgyro.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
#include "common/maths.h"
#include "common/sensor_alignment.h"
#include "common/time.h"
#include "drivers/exti.h"

#include "drivers/accgyro/accgyro_mpu.h"
#include "drivers/bus.h"
#include "drivers/exti.h"
#include "drivers/sensor.h"
#include "drivers/accgyro/accgyro_mpu.h"

#pragma GCC diagnostic push
#if defined(SIMULATOR_BUILD) && defined(SIMULATOR_MULTITHREAD)
Expand Down
4 changes: 2 additions & 2 deletions src/main/drivers/accgyro/accgyro_mpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void mpu6050FindRevision(gyroDev_t *gyro)
#ifdef USE_SPI_GYRO
// Called in ISR context
// Gyro read has just completed
busStatus_e mpuIntcallback(uint32_t arg)
busStatus_e mpuIntCallback(uint32_t arg)
{
gyroDev_t *gyro = (gyroDev_t *)arg;
int32_t gyroDmaDuration = cmpTimeCycles(getCycleCounter(), gyro->gyroLastEXTI);
Expand Down Expand Up @@ -279,7 +279,7 @@ bool mpuGyroReadSPI(gyroDev_t *gyro)
gyro->dev.callbackArg = (uint32_t)gyro;
gyro->dev.txBuf[0] = gyro->accDataReg | 0x80;
gyro->segments[0].len = gyro->gyroDataReg - gyro->accDataReg + sizeof(uint8_t) + 3 * sizeof(int16_t);
gyro->segments[0].callback = mpuIntcallback;
gyro->segments[0].callback = mpuIntCallback;
gyro->segments[0].u.buffers.txData = gyro->dev.txBuf;
gyro->segments[0].u.buffers.rxData = &gyro->dev.rxBuf[1];
gyro->segments[0].negateCS = true;
Expand Down
2 changes: 1 addition & 1 deletion src/main/drivers/accgyro/accgyro_mpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,5 @@ struct accDev_s;
bool mpuAccRead(struct accDev_s *acc);
bool mpuAccReadSPI(struct accDev_s *acc);

busStatus_e mpuIntcallback(uint32_t arg);
busStatus_e mpuIntCallback(uint32_t arg);
void mpuIntExtiHandler(extiCallbackRec_t *cb);

0 comments on commit 71199b1

Please sign in to comment.