Minor build optimisations
This commit is contained in:
parent
84cf4eb2e1
commit
c076bc3e2d
|
@ -17,10 +17,12 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdarg.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef DISPLAY
|
||||||
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -38,16 +40,12 @@
|
||||||
#include "common/axis.h"
|
#include "common/axis.h"
|
||||||
#include "common/typeconversion.h"
|
#include "common/typeconversion.h"
|
||||||
|
|
||||||
#ifdef DISPLAY
|
|
||||||
|
|
||||||
#include "sensors/battery.h"
|
#include "sensors/battery.h"
|
||||||
#include "sensors/sensors.h"
|
#include "sensors/sensors.h"
|
||||||
#include "sensors/compass.h"
|
#include "sensors/compass.h"
|
||||||
#include "sensors/acceleration.h"
|
#include "sensors/acceleration.h"
|
||||||
#include "sensors/gyro.h"
|
#include "sensors/gyro.h"
|
||||||
|
|
||||||
#include "rx/rx.h"
|
|
||||||
|
|
||||||
#include "io/rc_controls.h"
|
#include "io/rc_controls.h"
|
||||||
|
|
||||||
#include "flight/pid.h"
|
#include "flight/pid.h"
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
#ifdef GPS
|
||||||
|
|
||||||
#include "build_config.h"
|
#include "build_config.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
|
@ -50,8 +53,6 @@
|
||||||
#include "config/runtime_config.h"
|
#include "config/runtime_config.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef GPS
|
|
||||||
|
|
||||||
#define LOG_ERROR '?'
|
#define LOG_ERROR '?'
|
||||||
#define LOG_IGNORED '!'
|
#define LOG_IGNORED '!'
|
||||||
#define LOG_SKIPPED '>'
|
#define LOG_SKIPPED '>'
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "rx/rx.h"
|
|
||||||
#include "io/rc_controls.h"
|
#include "io/rc_controls.h"
|
||||||
#include "io/escservo.h"
|
#include "io/escservo.h"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
@ -36,7 +35,6 @@
|
||||||
#include "drivers/serial_uart.h"
|
#include "drivers/serial_uart.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "drivers/gpio.h"
|
|
||||||
#include "drivers/light_led.h"
|
#include "drivers/light_led.h"
|
||||||
|
|
||||||
#if defined(USE_VCP)
|
#if defined(USE_VCP)
|
||||||
|
@ -47,7 +45,6 @@
|
||||||
#include "serial_cli.h"
|
#include "serial_cli.h"
|
||||||
#include "serial_msp.h"
|
#include "serial_msp.h"
|
||||||
|
|
||||||
#include "config/config.h"
|
|
||||||
|
|
||||||
#ifdef TELEMETRY
|
#ifdef TELEMETRY
|
||||||
#include "telemetry/telemetry.h"
|
#include "telemetry/telemetry.h"
|
||||||
|
|
|
@ -29,11 +29,9 @@
|
||||||
#include "drivers/accgyro.h"
|
#include "drivers/accgyro.h"
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
|
|
||||||
#include "sensors/battery.h"
|
|
||||||
#include "sensors/sensors.h"
|
#include "sensors/sensors.h"
|
||||||
#include "io/beeper.h"
|
#include "io/beeper.h"
|
||||||
#include "sensors/boardalignment.h"
|
#include "sensors/boardalignment.h"
|
||||||
#include "config/runtime_config.h"
|
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
|
|
||||||
#include "sensors/acceleration.h"
|
#include "sensors/acceleration.h"
|
||||||
|
@ -67,12 +65,12 @@ bool isAccelerationCalibrationComplete(void)
|
||||||
return calibratingA == 0;
|
return calibratingA == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isOnFinalAccelerationCalibrationCycle(void)
|
static bool isOnFinalAccelerationCalibrationCycle(void)
|
||||||
{
|
{
|
||||||
return calibratingA == 1;
|
return calibratingA == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isOnFirstAccelerationCalibrationCycle(void)
|
static bool isOnFirstAccelerationCalibrationCycle(void)
|
||||||
{
|
{
|
||||||
return calibratingA == CALIBRATING_ACC_CYCLES;
|
return calibratingA == CALIBRATING_ACC_CYCLES;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +81,7 @@ void resetRollAndPitchTrims(rollAndPitchTrims_t *rollAndPitchTrims)
|
||||||
rollAndPitchTrims->values.pitch = 0;
|
rollAndPitchTrims->values.pitch = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void performAcclerationCalibration(rollAndPitchTrims_t *rollAndPitchTrims)
|
static void performAcclerationCalibration(rollAndPitchTrims_t *rollAndPitchTrims)
|
||||||
{
|
{
|
||||||
static int32_t a[3];
|
static int32_t a[3];
|
||||||
|
|
||||||
|
@ -115,7 +113,7 @@ void performAcclerationCalibration(rollAndPitchTrims_t *rollAndPitchTrims)
|
||||||
calibratingA--;
|
calibratingA--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void performInflightAccelerationCalibration(rollAndPitchTrims_t *rollAndPitchTrims)
|
static void performInflightAccelerationCalibration(rollAndPitchTrims_t *rollAndPitchTrims)
|
||||||
{
|
{
|
||||||
uint8_t axis;
|
uint8_t axis;
|
||||||
static int32_t b[3];
|
static int32_t b[3];
|
||||||
|
@ -168,7 +166,7 @@ void performInflightAccelerationCalibration(rollAndPitchTrims_t *rollAndPitchTri
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyAccelerationTrims(flightDynamicsTrims_t *accelerationTrims)
|
static void applyAccelerationTrims(flightDynamicsTrims_t *accelerationTrims)
|
||||||
{
|
{
|
||||||
accSmooth[X] -= accelerationTrims->raw[X];
|
accSmooth[X] -= accelerationTrims->raw[X];
|
||||||
accSmooth[Y] -= accelerationTrims->raw[Y];
|
accSmooth[Y] -= accelerationTrims->raw[Y];
|
||||||
|
|
|
@ -28,7 +28,6 @@ int32_t BaroAlt = 0;
|
||||||
|
|
||||||
#include "drivers/barometer.h"
|
#include "drivers/barometer.h"
|
||||||
#include "drivers/system.h"
|
#include "drivers/system.h"
|
||||||
#include "config/config.h"
|
|
||||||
|
|
||||||
#include "sensors/barometer.h"
|
#include "sensors/barometer.h"
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
|
|
||||||
#include "sensors/battery.h"
|
#include "sensors/battery.h"
|
||||||
|
|
||||||
#include "rx/rx.h"
|
|
||||||
|
|
||||||
#include "io/rc_controls.h"
|
#include "io/rc_controls.h"
|
||||||
#include "io/beeper.h"
|
#include "io/beeper.h"
|
||||||
|
|
||||||
|
@ -170,7 +168,7 @@ void batteryInit(batteryConfig_t *initialBatteryConfig)
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADCVREF 3300 // in mV
|
#define ADCVREF 3300 // in mV
|
||||||
int32_t currentSensorToCentiamps(uint16_t src)
|
static int32_t currentSensorToCentiamps(uint16_t src)
|
||||||
{
|
{
|
||||||
int32_t millivolts;
|
int32_t millivolts;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "drivers/sensor.h"
|
#include "drivers/sensor.h"
|
||||||
#include "drivers/compass.h"
|
#include "drivers/compass.h"
|
||||||
#include "drivers/compass_hmc5883l.h"
|
#include "drivers/compass_hmc5883l.h"
|
||||||
#include "drivers/gpio.h"
|
|
||||||
#include "drivers/light_led.h"
|
#include "drivers/light_led.h"
|
||||||
|
|
||||||
#include "sensors/boardalignment.h"
|
#include "sensors/boardalignment.h"
|
||||||
|
|
Loading…
Reference in New Issue