Merge pull request #978 from martinbudden/bf_tidy

Whitespace and const correctness tidy
This commit is contained in:
borisbstyle 2016-08-11 19:44:59 +02:00 committed by GitHub
commit ee36e51b99
8 changed files with 12 additions and 12 deletions

View File

@ -18,4 +18,4 @@
#pragma once #pragma once
bool mpu6050AccDetect(acc_t *acc); bool mpu6050AccDetect(acc_t *acc);
bool mpu6050GyroDetect(gyro_t *gyro); bool mpu6050GyroDetect(gyro_t *gyro);

View File

@ -23,4 +23,4 @@ bool mpu6500SpiAccDetect(acc_t *acc);
bool mpu6500SpiGyroDetect(gyro_t *gyro); bool mpu6500SpiGyroDetect(gyro_t *gyro);
bool mpu6500WriteRegister(uint8_t reg, uint8_t data); bool mpu6500WriteRegister(uint8_t reg, uint8_t data);
bool mpu6500ReadRegister(uint8_t reg, uint8_t length, uint8_t *data); bool mpu6500ReadRegister(uint8_t reg, uint8_t length, uint8_t *data);

View File

@ -32,4 +32,4 @@ typedef struct baro_s {
#ifndef BARO_I2C_INSTANCE #ifndef BARO_I2C_INSTANCE
#define BARO_I2C_INSTANCE I2C_DEVICE #define BARO_I2C_INSTANCE I2C_DEVICE
#endif #endif

View File

@ -24,4 +24,4 @@ typedef struct mag_s {
#ifndef MAG_I2C_INSTANCE #ifndef MAG_I2C_INSTANCE
#define MAG_I2C_INSTANCE I2C_DEVICE #define MAG_I2C_INSTANCE I2C_DEVICE
#endif #endif

View File

@ -207,8 +207,8 @@ void IOInit(IO_t io, resourceOwner_t owner, resourceType_t resource, uint8_t ind
{ {
ioRec_t *ioRec = IO_Rec(io); ioRec_t *ioRec = IO_Rec(io);
ioRec->owner = owner; ioRec->owner = owner;
ioRec->resource = resource; ioRec->resource = resource;
ioRec->index = index; ioRec->index = index;
} }
void IORelease(IO_t io) void IORelease(IO_t io)

View File

@ -167,7 +167,7 @@ static void performInflightAccelerationCalibration(rollAndPitchTrims_t *rollAndP
} }
} }
static void applyAccelerationTrims(flightDynamicsTrims_t *accelerationTrims) static void applyAccelerationTrims(const flightDynamicsTrims_t *accelerationTrims)
{ {
accSmooth[X] -= accelerationTrims->raw[X]; accSmooth[X] -= accelerationTrims->raw[X];
accSmooth[Y] -= accelerationTrims->raw[Y]; accSmooth[Y] -= accelerationTrims->raw[Y];

View File

@ -30,12 +30,12 @@
static bool standardBoardAlignment = true; // board orientation correction static bool standardBoardAlignment = true; // board orientation correction
static float boardRotation[3][3]; // matrix static float boardRotation[3][3]; // matrix
static bool isBoardAlignmentStandard(boardAlignment_t *boardAlignment) static bool isBoardAlignmentStandard(const boardAlignment_t *boardAlignment)
{ {
return !boardAlignment->rollDegrees && !boardAlignment->pitchDegrees && !boardAlignment->yawDegrees; return !boardAlignment->rollDegrees && !boardAlignment->pitchDegrees && !boardAlignment->yawDegrees;
} }
void initBoardAlignment(boardAlignment_t *boardAlignment) void initBoardAlignment(const boardAlignment_t *boardAlignment)
{ {
if (isBoardAlignmentStandard(boardAlignment)) { if (isBoardAlignmentStandard(boardAlignment)) {
return; return;
@ -62,7 +62,7 @@ static void alignBoard(int32_t *vec)
vec[Z] = lrintf(boardRotation[0][Z] * x + boardRotation[1][Z] * y + boardRotation[2][Z] * z); vec[Z] = lrintf(boardRotation[0][Z] * x + boardRotation[1][Z] * y + boardRotation[2][Z] * z);
} }
void alignSensors(int32_t *src, int32_t *dest, uint8_t rotation) void alignSensors(const int32_t *src, int32_t *dest, uint8_t rotation)
{ {
static uint32_t swap[3]; static uint32_t swap[3];
memcpy(swap, src, sizeof(swap)); memcpy(swap, src, sizeof(swap));

View File

@ -23,5 +23,5 @@ typedef struct boardAlignment_s {
int32_t yawDegrees; int32_t yawDegrees;
} boardAlignment_t; } boardAlignment_t;
void alignSensors(int32_t *src, int32_t *dest, uint8_t rotation); void alignSensors(const int32_t *src, int32_t *dest, uint8_t rotation);
void initBoardAlignment(boardAlignment_t *boardAlignment); void initBoardAlignment(const boardAlignment_t *boardAlignment);