1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

force unit tests sto work

This commit is contained in:
ctzsnooze 2024-10-17 10:11:13 +11:00
parent 2fc85cdf85
commit ce72f16a62
3 changed files with 65 additions and 9 deletions

View file

@ -37,14 +37,19 @@ extern "C" {
#include "flight/pid.h" #include "flight/pid.h"
#include "flight/position.h" #include "flight/position.h"
#include "io/gps.h"
#include "rx/rx.h" #include "rx/rx.h"
#include "sensors/acceleration.h" #include "sensors/acceleration.h"
#include "sensors/gyro.h"
PG_REGISTER(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 0); PG_REGISTER(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 0);
PG_REGISTER(positionConfig_t, positionConfig, PG_POSITION, 0);
PG_REGISTER(autopilotConfig_t, autopilotConfig, PG_AUTOPILOT, 0);
PG_REGISTER(altHoldConfig_t, altHoldConfig, PG_ALTHOLD_CONFIG, 0); PG_REGISTER(altHoldConfig_t, altHoldConfig, PG_ALTHOLD_CONFIG, 0);
PG_REGISTER(autopilotConfig_t, autopilotConfig, PG_AUTOPILOT, 0);
PG_REGISTER(gyroConfig_t, gyroConfig, PG_GYRO_CONFIG, 0);
PG_REGISTER(positionConfig_t, positionConfig, PG_POSITION, 0);
PG_REGISTER(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 0);
extern altHoldState_t altHoldState; extern altHoldState_t altHoldState;
void altHoldInit(void); void altHoldInit(void);
@ -103,16 +108,21 @@ extern "C" {
float getCosTiltAngle(void) { return 0.0f; } float getCosTiltAngle(void) { return 0.0f; }
float rcCommand[4]; float rcCommand[4];
void GPS_distance_cm_bearing(&gpsSol.llh, &targetLocation, false, &distanceCm, &bearing) void GPS_distance_cm_bearing(const gpsLocation_t *from, const gpsLocation_t *to, bool dist3d, uint32_t *dist, int32_t *bearing)
{ {
UNUSED(gpsSol.llh); UNUSED(from);
UNUSED(targetLocation); UNUSED(to);
UNUSED(false); UNUSED(dist3d);
UNUSED(distanceCm); UNUSED(dist);
UNUSED(bearing); UNUSED(bearing);
} }
gpsSolutionData_t gpsSol;
bool canUseGPSHeading;
bool compassIsHealthy;
float getGpsDataIntervalSeconds(void) { return 0.01f; }
float getRcDeflectionAbs(void) { return 0.0f; }
attitudeEulerAngles_t attitude;
void parseRcChannels(const char *input, rxConfig_t *rxConfig) void parseRcChannels(const char *input, rxConfig_t *rxConfig)
{ {
@ -120,6 +130,33 @@ extern "C" {
UNUSED(rxConfig); UNUSED(rxConfig);
} }
float pt1FilterGain(float f_cut, float dT)
{
UNUSED(f_cut);
UNUSED(dT);
return 0.0;
}
void pt1FilterInit(pt1Filter_t *filter, float k)
{
UNUSED(filter);
UNUSED(k);
}
void pt1FilterUpdateCutoff(pt1Filter_t *filter, float k)
{
UNUSED(filter);
UNUSED(k);
}
float pt1FilterApply(pt1Filter_t *filter, float input)
{
UNUSED(filter);
UNUSED(input);
return 0.0;
}
int16_t debug[DEBUG16_VALUE_COUNT]; int16_t debug[DEBUG16_VALUE_COUNT];
uint8_t debugMode; uint8_t debugMode;

View file

@ -1157,7 +1157,26 @@ extern "C" {
UNUSED(velocityUpsampleLpf); UNUSED(velocityUpsampleLpf);
return 0.0f; return 0.0f;
} }
float sin_approx(float) {
return 0.0f;
}
float cos_approx(float) {
return 1.0f;
}
void getRcDeflectionAbs(void) {} void getRcDeflectionAbs(void) {}
uint32_t getCpuPercentageLate(void) { return 0; } uint32_t getCpuPercentageLate(void) { return 0; }
bool crashFlipSuccessful(void) { return false; } bool crashFlipSuccessful(void) { return false; }
void GPS_distance_cm_bearing(const gpsLocation_t *from, const gpsLocation_t *to, bool dist3d, uint32_t *dist, int32_t *bearing)
{
UNUSED(from);
UNUSED(to);
UNUSED(dist3d);
UNUSED(dist);
UNUSED(bearing);
}
bool canUseGPSHeading;
bool compassIsHealthy;
} }

View file

@ -212,5 +212,5 @@ extern "C" {
void sbufWriteU32(sbuf_t *, uint32_t) {} void sbufWriteU32(sbuf_t *, uint32_t) {}
void schedulerSetNextStateTime(timeDelta_t) {} void schedulerSetNextStateTime(timeDelta_t) {}
bool crashFlipSuccessful(void) {return false; } bool crashFlipSuccessful(void) {return false; }
bool canUseGPSHeading;
} }