1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Merge pull request #2209 from jflyper/bfdev-fix-cms-autonomous-feature-resets

CMS: Don't write back uninitialized features on writeback
This commit is contained in:
borisbstyle 2017-01-25 08:18:11 +01:00 committed by GitHub
commit cb03adf009
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)
{
if (cmsx_FeatureBlackbox)
featureSet(FEATURE_BLACKBOX);
else
featureClear(FEATURE_BLACKBOX);
if (featureRead) {
if (cmsx_FeatureBlackbox)
featureSet(FEATURE_BLACKBOX);
else
featureClear(FEATURE_BLACKBOX);
}
return 0;
}

View file

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

View file

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