Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unnecessary features automatically enabled by default. #13602

Closed
hydra opened this issue Apr 29, 2024 · 4 comments · Fixed by #13608
Closed

Unnecessary features automatically enabled by default. #13602

hydra opened this issue Apr 29, 2024 · 4 comments · Fixed by #13608
Labels
Template: Bug Set by auto_close_issue.

Comments

@hydra
Copy link
Contributor

hydra commented Apr 29, 2024

Describe the bug

After issuing 'defaults' in the cli, and then 'diff' I get this:

feature SERVO_TILT
feature RANGEFINDER
feature DISPLAY
feature CHANNEL_FORWARDING
feature TRANSPONDER

The target has various, 'USE_...' defined, e.g. 'USE_SERVOS', but that shouldn't mean that features using the code enabled by the define should be used.

To Reproduce

  1. Build and flash any H7 target from source, tested on H7EXTREME and H7RF, likely happens on other targets too.
  2. issue 'defaults' in the cli.
  3. wait for reboot.
  4. go back to the cli and check the 'diff' output.

Expected behavior

Only the features actually wanted are enabled. i.e. none of the above should be enabled by default.

Support ID

N/A

Flight controller

Any H7

Other components

No response

How are the different components wired up (including port information)

No response

Add any other context about the problem that you think might be relevant here

See validateAndFixConfig.

e.g.

#ifdef USE_RANGEFINDER
    featureEnableImmediate(FEATURE_RANGEFINDER);
#endif
#ifdef USE_SERVOS
    featureEnableImmediate(FEATURE_CHANNEL_FORWARDING);
    featureEnableImmediate(FEATURE_SERVO_TILT);
#endif
@hydra hydra added the Template: Bug Set by auto_close_issue. label Apr 29, 2024
@hydra
Copy link
Contributor Author

hydra commented Apr 29, 2024

This is tested on 4.5-maintenance from yesterday's release of 4.5.0, commit: c155f5830d0ffdee1c34071dd21f174ffc374c81

@ledvinap
Copy link
Contributor

@hydra: someone spent considerable effort to enable these features (config and feature handling is total mess).

Maybe we can use different values of USE_ define?

#define FEATURE_DEFAULT_OFF 1
#define FEATURE_DEFAULT_ON 2
#define FEATURE_FORCE_ON 3

#define USE_SERVO FEATURE_DEFAULT_OFF 

with some improvement/rewording

@haslinghuis haslinghuis linked a pull request Apr 29, 2024 that will close this issue
@hydra
Copy link
Contributor Author

hydra commented May 14, 2024

@ledvinap Not sure what the solution is, but there's some good discussion in #13608

@hydra
Copy link
Contributor Author

hydra commented May 19, 2024

It seems there's some work going on in #13494 butwith reference to https://github.com/betaflight/betaflight/pull/13494/files#r1605977635 we must not forget the commit or additional PR that fixes the bug described in the OP #13602 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template: Bug Set by auto_close_issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants