mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
implemented various things for cli
added 'reset to defaults' to cli got rid of 'servo' feature since that's not really a feature a user can set added couple more configurable tricopter things to config struct. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@118 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
2861482bb6
commit
2fc24b338e
8 changed files with 3048 additions and 2542 deletions
15
src/config.c
15
src/config.c
|
@ -8,7 +8,7 @@
|
|||
config_t cfg;
|
||||
|
||||
static uint32_t enabledSensors = 0;
|
||||
static uint8_t checkNewConf = 3;
|
||||
static uint8_t checkNewConf = 4;
|
||||
|
||||
void readEEPROM(void)
|
||||
{
|
||||
|
@ -52,13 +52,13 @@ void writeParams(void)
|
|||
blinkLED(15, 20, 1);
|
||||
}
|
||||
|
||||
void checkFirstTime(void)
|
||||
void checkFirstTime(bool reset)
|
||||
{
|
||||
uint8_t test_val, i;
|
||||
|
||||
test_val = *(uint8_t *)FLASH_WRITE_ADDR;
|
||||
|
||||
if (test_val == checkNewConf)
|
||||
if (!reset && test_val == checkNewConf)
|
||||
return;
|
||||
|
||||
// Default settings
|
||||
|
@ -115,7 +115,9 @@ void checkFirstTime(void)
|
|||
cfg.wing_left_mid = 1500;
|
||||
cfg.wing_right_mid = 1500;
|
||||
cfg.tri_yaw_middle = 1500;
|
||||
|
||||
cfg.tri_yaw_min = 1020;
|
||||
cfg.tri_yaw_max = 2000;
|
||||
|
||||
// gimbal
|
||||
cfg.tilt_pitch_prop = 10;
|
||||
cfg.tilt_roll_prop = 10;
|
||||
|
@ -157,3 +159,8 @@ void featureClearAll()
|
|||
{
|
||||
cfg.enabledFeatures = 0;
|
||||
}
|
||||
|
||||
uint32_t featureMask(void)
|
||||
{
|
||||
return cfg.enabledFeatures;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue