mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-25 17:25:18 +03:00
Merge remote-tracking branch 'multiwii/master'
Conflicts: obj/baseflight.hex src/config.c src/drivers/system_common.c src/main.c src/mw.h src/serial_cli.c
This commit is contained in:
commit
a3d2a3df2d
8 changed files with 32 additions and 15 deletions
20
src/config.c
20
src/config.c
|
@ -79,6 +79,16 @@ static bool isEEPROMContentValid(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
void activateConfig(void)
|
||||
{
|
||||
generatePitchCurve(&cfg.controlRateConfig);
|
||||
generateThrottleCurve(&cfg.controlRateConfig, mcfg.minthrottle, mcfg.maxthrottle);
|
||||
|
||||
setPIDController(cfg.pidController);
|
||||
gpsSetPIDs();
|
||||
useFailsafeConfig(&cfg.failsafeConfig);
|
||||
}
|
||||
|
||||
void readEEPROM(void)
|
||||
{
|
||||
// Sanity check
|
||||
|
@ -90,14 +100,9 @@ void readEEPROM(void)
|
|||
// Copy current profile
|
||||
if (mcfg.current_profile > 2) // sanity check
|
||||
mcfg.current_profile = 0;
|
||||
memcpy(&cfg, &mcfg.profile[mcfg.current_profile], sizeof(config_t));
|
||||
memcpy(&cfg, &mcfg.profile[mcfg.current_profile], sizeof(config_t));
|
||||
|
||||
generatePitchCurve(&cfg.controlRateConfig);
|
||||
generateThrottleCurve(&cfg.controlRateConfig, mcfg.minthrottle, mcfg.maxthrottle);
|
||||
|
||||
setPIDController(cfg.pidController);
|
||||
gpsSetPIDs();
|
||||
useFailsafeConfig(&cfg.failsafeConfig);
|
||||
activateConfig();
|
||||
}
|
||||
|
||||
void readEEPROMAndNotify(void)
|
||||
|
@ -232,6 +237,7 @@ static void resetConf(void)
|
|||
mcfg.serialConfig.reboot_character = 'R';
|
||||
|
||||
mcfg.looptime = 3500;
|
||||
mcfg.emfAvoidance = 0;
|
||||
mcfg.rssi_aux_channel = 0;
|
||||
|
||||
cfg.pidController = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue