mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Various measures to save ROM
This commit is contained in:
parent
87a06b55f9
commit
d9733b8206
9 changed files with 91 additions and 29 deletions
|
@ -255,6 +255,7 @@ void resetGpsProfile(gpsProfile_t *gpsProfile)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef BARO
|
||||
void resetBarometerConfig(barometerConfig_t *barometerConfig)
|
||||
{
|
||||
barometerConfig->baro_sample_count = 21;
|
||||
|
@ -262,6 +263,7 @@ void resetBarometerConfig(barometerConfig_t *barometerConfig)
|
|||
barometerConfig->baro_cf_vel = 0.985f;
|
||||
barometerConfig->baro_cf_alt = 0.965f;
|
||||
}
|
||||
#endif
|
||||
|
||||
void resetSensorAlignment(sensorAlignmentConfig_t *sensorAlignmentConfig)
|
||||
{
|
||||
|
@ -291,6 +293,7 @@ void resetFlight3DConfig(flight3DConfig_t *flight3DConfig)
|
|||
flight3DConfig->deadband3d_throttle = 50;
|
||||
}
|
||||
|
||||
#ifdef TELEMETRY
|
||||
void resetTelemetryConfig(telemetryConfig_t *telemetryConfig)
|
||||
{
|
||||
telemetryConfig->telemetry_inversion = 0;
|
||||
|
@ -303,6 +306,7 @@ void resetTelemetryConfig(telemetryConfig_t *telemetryConfig)
|
|||
telemetryConfig->frsky_vfas_cell_voltage = 0;
|
||||
telemetryConfig->hottAlarmSoundInterval = 5;
|
||||
}
|
||||
#endif
|
||||
|
||||
void resetBatteryConfig(batteryConfig_t *batteryConfig)
|
||||
{
|
||||
|
@ -483,7 +487,9 @@ static void resetConf(void)
|
|||
|
||||
resetBatteryConfig(&masterConfig.batteryConfig);
|
||||
|
||||
#ifdef TELEMETRY
|
||||
resetTelemetryConfig(&masterConfig.telemetryConfig);
|
||||
#endif
|
||||
|
||||
#ifdef SERIALRX_PROVIDER
|
||||
masterConfig.rxConfig.serialrx_provider = SERIALRX_PROVIDER;
|
||||
|
@ -573,7 +579,9 @@ static void resetConf(void)
|
|||
masterConfig.accDeadband.z = 40;
|
||||
masterConfig.acc_unarmedcal = 1;
|
||||
|
||||
#ifdef BARO
|
||||
resetBarometerConfig(&masterConfig.barometerConfig);
|
||||
#endif
|
||||
|
||||
// Radio
|
||||
parseRcChannels("AETR1234", &masterConfig.rxConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue