Calculate Nav rate less frequently to reduce CPU usage.

pull/598/head
Datong Sun 2017-05-14 01:02:58 -07:00
rodzic 1326450eb3
commit 30d08af300
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CF7004EE981151C8
1 zmienionych plików z 2 dodań i 12 usunięć

Wyświetl plik

@ -1054,10 +1054,6 @@ func processNMEALine(l string) (sentenceUsed bool) {
mySituation.muGPSPerformance.Unlock()
}
if globalSettings.IMU_Sensor_Enabled && globalStatus.IMUConnected {
calculateNavRate()
}
return true
} else if x[1] == "03" { // satellite status message. Only the first 20 satellites will be reported in this message for UBX firmware older than v3.0. Order seems to be GPS, then SBAS, then GLONASS.
@ -1392,10 +1388,6 @@ func processNMEALine(l string) (sentenceUsed bool) {
mySituation.muGPSPerformance.Unlock()
}
if globalSettings.IMU_Sensor_Enabled && globalStatus.IMUConnected {
calculateNavRate()
}
return true
} else if (x[0] == "GNRMC") || (x[0] == "GPRMC") { // Recommended Minimum data.
@ -1544,10 +1536,6 @@ func processNMEALine(l string) (sentenceUsed bool) {
mySituation.muGPSPerformance.Unlock()
}
if globalSettings.IMU_Sensor_Enabled && globalStatus.IMUConnected {
calculateNavRate()
}
setDataLogTimeWithGPS(mySituation)
return true
@ -1930,6 +1918,8 @@ func gpsAttitudeSender() {
<-timer.C
if !(globalStatus.GPS_connected || globalStatus.IMUConnected) {
myGPSPerfStats = make([]gpsPerfStats, 0) // reinitialize statistics on disconnect / reconnect
} else {
calculateNavRate()
}
for !(globalSettings.IMU_Sensor_Enabled && globalStatus.IMUConnected) && (globalSettings.GPS_Enabled && globalStatus.GPS_connected) {