mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +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:
commit
cb03adf009
3 changed files with 18 additions and 12 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue