1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

Get setting default values from settings.yaml (#6595)

* Get setting default values from settings.yaml

* settings: Make the generator more robust and versatile

- Add support for resolving types and values in multiple compilers
- Add support for resolving types and values in clang 10
- Add support for using the host compiler for resolving the settings

This allows us to run the generator for the unit tests, since they now
need the settings_generated.h file to get the default setting values
from it.

* Fix regexps in settings.rb and add execution bit

* Fix git revision issue

* Fix issue with settings validation

* Fix issue with targets not defining USE_MAG

Co-authored-by: Alberto García Hierro <alberto@garciahierro.com>
This commit is contained in:
Michel Pastor 2021-04-07 17:48:09 +02:00 committed by GitHub
parent 7b705bccac
commit fc0e5e2741
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 1708 additions and 1875 deletions

View file

@ -44,6 +44,7 @@
#include "fc/rc_curves.h"
#include "fc/rc_modes.h"
#include "fc/runtime_config.h"
#include "fc/settings.h"
#include "flight/pid.h"
#include "flight/failsafe.h"
@ -73,22 +74,22 @@ FASTRAM int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and
PG_REGISTER_WITH_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 2);
PG_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig,
.deadband = 5,
.yaw_deadband = 5,
.pos_hold_deadband = 10,
.alt_hold_deadband = 50,
.mid_throttle_deadband = 50,
.airmodeHandlingType = STICK_CENTER,
.airmodeThrottleThreshold = AIRMODE_THROTTLE_THRESHOLD,
.deadband = SETTING_DEADBAND_DEFAULT,
.yaw_deadband = SETTING_YAW_DEADBAND_DEFAULT,
.pos_hold_deadband = SETTING_POS_HOLD_DEADBAND_DEFAULT,
.alt_hold_deadband = SETTING_ALT_HOLD_DEADBAND_DEFAULT,
.mid_throttle_deadband = SETTING_3D_DEADBAND_THROTTLE_DEFAULT,
.airmodeHandlingType = SETTING_AIRMODE_TYPE_DEFAULT,
.airmodeThrottleThreshold = SETTING_AIRMODE_THROTTLE_THRESHOLD_DEFAULT,
);
PG_REGISTER_WITH_RESET_TEMPLATE(armingConfig_t, armingConfig, PG_ARMING_CONFIG, 2);
PG_RESET_TEMPLATE(armingConfig_t, armingConfig,
.fixed_wing_auto_arm = 0,
.disarm_kill_switch = 1,
.switchDisarmDelayMs = DEFAULT_RC_SWITCH_DISARM_DELAY_MS,
.prearmTimeoutMs = DEFAULT_PREARM_TIMEOUT,
.fixed_wing_auto_arm = SETTING_FIXED_WING_AUTO_ARM_DEFAULT,
.disarm_kill_switch = SETTING_DISARM_KILL_SWITCH_DEFAULT,
.switchDisarmDelayMs = SETTING_SWITCH_DISARM_DELAY_DEFAULT,
.prearmTimeoutMs = SETTING_PREARM_TIMEOUT_DEFAULT,
);
bool areSticksInApModePosition(uint16_t ap_mode)