Issue 3473 port to next (#3587)

This commit is contained in:
Neil Horne
2016-06-12 10:49:59 +02:00
committed by Bertrand Songis
parent 13558214a8
commit dd12d09c92
4 changed files with 37 additions and 10 deletions
+14 -1
View File
@@ -1397,7 +1397,7 @@ void ModelData::clear()
moduleData[1].protocol = PULSES_OFF;
}
for (int i=0; i<C9X_MAX_FLIGHT_MODES; i++) {
flightModeData[i].clear();
flightModeData[i].clear(i);
}
clearInputs();
clearMixes();
@@ -1857,3 +1857,16 @@ unsigned int getNumSubtypes(MultiModuleRFProtocols type) {
}
}
void FlightModeData::clear(const int phase)
{
memset(this, 0, sizeof(FlightModeData));
if (phase != 0) {
for (int idx=0; idx<C9X_MAX_GVARS; idx++) {
gvars[idx] = 1025;
}
for (int idx=0; idx<C9X_MAX_ENCODERS; idx++) {
rotaryEncoders[idx] = 1025;
}
}
}