Don't write back uninitialized features on onGlobalExit

This commit is contained in:
jflyper 2017-01-25 11:49:32 +09:00
parent 109b9b2ca1
commit 753afe0562
3 changed files with 18 additions and 12 deletions

View File

@ -80,10 +80,12 @@ static long cmsx_Blackbox_FeatureRead(void)
static long cmsx_Blackbox_FeatureWriteback(void) static long cmsx_Blackbox_FeatureWriteback(void)
{ {
if (cmsx_FeatureBlackbox) if (featureRead) {
featureSet(FEATURE_BLACKBOX); if (cmsx_FeatureBlackbox)
else featureSet(FEATURE_BLACKBOX);
featureClear(FEATURE_BLACKBOX); else
featureClear(FEATURE_BLACKBOX);
}
return 0; return 0;
} }

View File

@ -53,10 +53,12 @@ static long cmsx_Ledstrip_FeatureRead(void)
static long cmsx_Ledstrip_FeatureWriteback(void) static long cmsx_Ledstrip_FeatureWriteback(void)
{ {
if (cmsx_FeatureLedstrip) if (featureRead) {
featureSet(FEATURE_LED_STRIP); if (cmsx_FeatureLedstrip)
else featureSet(FEATURE_LED_STRIP);
featureClear(FEATURE_LED_STRIP); else
featureClear(FEATURE_LED_STRIP);
}
return 0; return 0;
} }

View File

@ -52,10 +52,12 @@ static long cmsx_Vtx_FeatureRead(void)
static long cmsx_Vtx_FeatureWriteback(void) static long cmsx_Vtx_FeatureWriteback(void)
{ {
if (cmsx_featureVtx) if (featureRead) {
featureSet(FEATURE_VTX); if (cmsx_featureVtx)
else featureSet(FEATURE_VTX);
featureClear(FEATURE_VTX); else
featureClear(FEATURE_VTX);
}
return 0; return 0;
} }