Only read gyro temperature if it is actually used

This commit is contained in:
Martin Budden 2017-01-06 11:20:46 +00:00
parent d4d75f6da1
commit d18293de7f
1 changed files with 2 additions and 7 deletions

View File

@ -703,11 +703,10 @@ void subTaskPidController(void)
void subTaskMainSubprocesses(void)
{
const uint32_t startTime = micros();
// Read out gyro temperature. can use it for something somewhere. maybe get MCU temperature instead? lots of fun possibilities.
if (gyro.dev.temperature) {
// Read out gyro temperature if used for telemmetry
if (feature(FEATURE_TELEMETRY) && gyro.dev.temperature) {
gyro.dev.temperature(&gyro.dev, &telemTemperature1);
}
@ -717,10 +716,6 @@ void subTaskMainSubprocesses(void)
}
#endif
#ifdef GTUNE
updateGtuneState();
#endif
#if defined(BARO) || defined(SONAR)
// updateRcCommands sets rcCommand, which is needed by updateAltHoldState and updateSonarAltHoldState
updateRcCommands();