mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Fix some compile warnings
This commit is contained in:
parent
054868e0a4
commit
e3b77b2ee5
2 changed files with 13 additions and 13 deletions
|
@ -215,7 +215,7 @@ static bool imuUseFastGains(void)
|
||||||
return !ARMING_FLAG(ARMED) && millis() < 20000;
|
return !ARMING_FLAG(ARMED) && millis() < 20000;
|
||||||
}
|
}
|
||||||
|
|
||||||
static float imuGetPGainScaleFactor(float spin_rate)
|
static float imuGetPGainScaleFactor(void)
|
||||||
{
|
{
|
||||||
if (imuUseFastGains()) {
|
if (imuUseFastGains()) {
|
||||||
return 10.0f;
|
return 10.0f;
|
||||||
|
@ -306,7 +306,7 @@ static void imuMahonyAHRSupdate(float dt, float gx, float gy, float gz,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Calculate kP gain. If we are acquiring initial attitude (not armed and within 20 sec from powerup) scale the kP to converge faster
|
// Calculate kP gain. If we are acquiring initial attitude (not armed and within 20 sec from powerup) scale the kP to converge faster
|
||||||
float dcmKpGain = imuRuntimeConfig->dcm_kp * imuGetPGainScaleFactor(spin_rate);
|
float dcmKpGain = imuRuntimeConfig->dcm_kp * imuGetPGainScaleFactor();
|
||||||
|
|
||||||
// Apply proportional and integral feedback
|
// Apply proportional and integral feedback
|
||||||
gx += dcmKpGain * ex + integralFBx;
|
gx += dcmKpGain * ex + integralFBx;
|
||||||
|
|
|
@ -302,17 +302,6 @@ static void sendLatLong(int32_t coord[2])
|
||||||
serialize16(coord[LON] < 0 ? 'W' : 'E');
|
serialize16(coord[LON] < 0 ? 'W' : 'E');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sendFakeLatLong(void)
|
|
||||||
{
|
|
||||||
// Heading is only displayed on OpenTX if non-zero lat/long is also sent
|
|
||||||
int32_t coord[2] = {0,0};
|
|
||||||
|
|
||||||
coord[LAT] = (telemetryConfig->gpsNoFixLatitude * GPS_DEGREES_DIVIDER);
|
|
||||||
coord[LON] = (telemetryConfig->gpsNoFixLongitude * GPS_DEGREES_DIVIDER);
|
|
||||||
|
|
||||||
sendLatLong(coord);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sendFakeLatLongThatAllowsHeadingDisplay(void)
|
static void sendFakeLatLongThatAllowsHeadingDisplay(void)
|
||||||
{
|
{
|
||||||
// Heading is only displayed on OpenTX if non-zero lat/long is also sent
|
// Heading is only displayed on OpenTX if non-zero lat/long is also sent
|
||||||
|
@ -325,6 +314,17 @@ static void sendFakeLatLongThatAllowsHeadingDisplay(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GPS
|
#ifdef GPS
|
||||||
|
static void sendFakeLatLong(void)
|
||||||
|
{
|
||||||
|
// Heading is only displayed on OpenTX if non-zero lat/long is also sent
|
||||||
|
int32_t coord[2] = {0,0};
|
||||||
|
|
||||||
|
coord[LAT] = (telemetryConfig->gpsNoFixLatitude * GPS_DEGREES_DIVIDER);
|
||||||
|
coord[LON] = (telemetryConfig->gpsNoFixLongitude * GPS_DEGREES_DIVIDER);
|
||||||
|
|
||||||
|
sendLatLong(coord);
|
||||||
|
}
|
||||||
|
|
||||||
static void sendGPSLatLong(void)
|
static void sendGPSLatLong(void)
|
||||||
{
|
{
|
||||||
static uint8_t gpsFixOccured = 0;
|
static uint8_t gpsFixOccured = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue