Fixes
This commit is contained in:
+1
-1
@@ -107,7 +107,7 @@ TASK_FUNCTION(mixerTask)
|
||||
static uint32_t lastRunTime;
|
||||
s_pulses_paused = true;
|
||||
|
||||
while (1) {
|
||||
while (true) {
|
||||
#if defined(PCBTARANIS) && defined(SBUS)
|
||||
// SBUS trainer
|
||||
processSbusInput();
|
||||
|
||||
@@ -34,7 +34,6 @@ bool isFaiForbidden(source_t idx)
|
||||
TelemetrySensor * sensor = &g_model.telemetrySensors[(idx-MIXSRC_FIRST_TELEM)/3];
|
||||
|
||||
switch (telemetryProtocol) {
|
||||
|
||||
case PROTOCOL_TELEMETRY_FRSKY_SPORT:
|
||||
if (sensor->id == RSSI_ID) {
|
||||
return false;
|
||||
@@ -355,11 +354,20 @@ void TelemetryItem::eval(const TelemetrySensor & sensor)
|
||||
}
|
||||
}
|
||||
uint32_t angle = abs(gpsItem.gps.latitude - gpsItem.pilotLatitude);
|
||||
#if defined(STM32)
|
||||
uint32_t dist = uint64_t(EARTH_RADIUS * M_PI / 180) * angle / 1000000;
|
||||
#else
|
||||
// TODO search later why it breaks Sky9x
|
||||
uint32_t dist = EARTH_RADIUS * angle / 1000000;
|
||||
#endif
|
||||
uint32_t result = dist * dist;
|
||||
|
||||
angle = abs(gpsItem.gps.longitude - gpsItem.pilotLongitude);
|
||||
#if defined(STM32)
|
||||
dist = uint64_t(gpsItem.distFromEarthAxis) * angle / 1000000;
|
||||
#else
|
||||
dist = gpsItem.distFromEarthAxis * angle / 1000000;
|
||||
#endif
|
||||
result += dist * dist;
|
||||
|
||||
// Length on ground (ignoring curvature of the earth)
|
||||
|
||||
Reference in New Issue
Block a user