Browse Source

allow 0 for looptime to go back to not-rate-limited loop.

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@183 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop 13 years ago
parent
commit
75adda0597
  1. 4738
      obj/baseflight.hex
  2. 2
      src/cli.c
  3. 2
      src/config.c
  4. 2
      src/mw.c

4738
obj/baseflight.hex
File diff suppressed because it is too large
View File

2
src/cli.c

@ -142,7 +142,7 @@ const clivalue_t valueTable[] = {
{ "nav_speed_min", VAR_UINT16, &cfg.nav_speed_min, 10, 2000 },
{ "nav_speed_max", VAR_UINT16, &cfg.nav_speed_max, 10, 2000 },
{ "nav_slew_rate", VAR_UINT8, &cfg.nav_slew_rate, 0, 100 },
{ "looptime", VAR_UINT16, &cfg.looptime, 1500, 9000 },
{ "looptime", VAR_UINT16, &cfg.looptime, 0, 9000 },
{ "p_pitch", VAR_UINT8, &cfg.P8[PITCH], 0, 200 },
{ "i_pitch", VAR_UINT8, &cfg.I8[PITCH], 0, 200 },
{ "d_pitch", VAR_UINT8, &cfg.D8[PITCH], 0, 200 },

2
src/config.c

@ -89,7 +89,7 @@ void checkFirstTime(bool reset)
featureClearAll();
featureSet(FEATURE_VBAT);
cfg.looptime = 3000;
cfg.looptime = 0;
cfg.P8[ROLL] = 40;
cfg.I8[ROLL] = 30;
cfg.D8[ROLL] = 23;

2
src/mw.c

@ -523,7 +523,7 @@ void loop(void)
}
currentTime = micros();
if (currentTime > loopTime) {
if (cfg.looptime == 0 || currentTime > loopTime) {
loopTime = currentTime + cfg.looptime;
computeIMU();

Loading…
Cancel
Save