Merge pull request #855 from blckmn/betaflight
small cleanup for serial_cli and fix for warning when skip float pid not defined
This commit is contained in:
commit
229291d22d
|
@ -66,9 +66,10 @@ uint8_t PIDweight[3];
|
|||
static int32_t errorGyroI[3];
|
||||
static float errorGyroIf[3];
|
||||
|
||||
#ifdef SKIP_PID_FLOAT
|
||||
|
||||
static void pidLegacy(const pidProfile_t *pidProfile, uint16_t max_angle_inclination,
|
||||
const rollAndPitchTrims_t *angleTrim, const rxConfig_t *rxConfig);
|
||||
#ifdef SKIP_PID_FLOAT
|
||||
pidControllerFuncPtr pid_controller = pidLegacy; // which pid controller are we using
|
||||
#else
|
||||
static void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inclination,
|
||||
|
@ -107,6 +108,7 @@ const angle_index_t rcAliasToAngleIndexMap[] = { AI_ROLL, AI_PITCH };
|
|||
static pt1Filter_t deltaFilter[3];
|
||||
static pt1Filter_t yawFilter;
|
||||
|
||||
#ifndef SKIP_PID_FLOAT
|
||||
// Betaflight pid controller, which will be maintained in the future with additional features specialised for current (mini) multirotor usage. Based on 2DOF reference design (matlab)
|
||||
static void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inclination,
|
||||
const rollAndPitchTrims_t *angleTrim, const rxConfig_t *rxConfig)
|
||||
|
@ -302,6 +304,7 @@ static void pidBetaflight(const pidProfile_t *pidProfile, uint16_t max_angle_inc
|
|||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Legacy pid controller betaflight evolved pid rewrite based on 2.9 releae. Good for fastest cycletimes for those who believe in that. Don't expect much development in the future
|
||||
static void pidLegacy(const pidProfile_t *pidProfile, uint16_t max_angle_inclination,
|
||||
|
|
|
@ -2009,11 +2009,6 @@ static void dumpValues(uint16_t valueSection)
|
|||
cliPrintf("set %s = ", valueTable[i].name);
|
||||
cliPrintVar(value, 0);
|
||||
cliPrint("\r\n");
|
||||
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2089,9 +2084,6 @@ static void cliDump(char *cmdline)
|
|||
if (yaw < 0)
|
||||
cliWrite(' ');
|
||||
cliPrintf("%s\r\n", ftoa(yaw, buf));
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_SERVOS
|
||||
|
@ -2113,10 +2105,6 @@ static void cliDump(char *cmdline)
|
|||
masterConfig.customServoMixer[i].max,
|
||||
masterConfig.customServoMixer[i].box
|
||||
);
|
||||
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -2128,18 +2116,12 @@ static void cliDump(char *cmdline)
|
|||
if (featureNames[i] == NULL)
|
||||
break;
|
||||
cliPrintf("feature -%s\r\n", featureNames[i]);
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
for (i = 0; ; i++) { // reenable what we want.
|
||||
if (featureNames[i] == NULL)
|
||||
break;
|
||||
if (mask & (1 << i))
|
||||
cliPrintf("feature %s\r\n", featureNames[i]);
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef BEEPER
|
||||
|
@ -2194,9 +2176,6 @@ static void cliDump(char *cmdline)
|
|||
for (channel = 0; channel < INPUT_SOURCE_COUNT; channel++) {
|
||||
if (servoDirection(i, channel) < 0) {
|
||||
cliPrintf("smix reverse %d %d r\r\n", i , channel);
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2227,9 +2206,6 @@ static void cliDump(char *cmdline)
|
|||
cliPrint("\r\n# restore original rateprofile selection\r\n");
|
||||
changeControlRateProfile(currentRateIndex);
|
||||
cliRateProfile("");
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
|
||||
cliPrint("\r\n# restore original profile selection\r\n");
|
||||
|
@ -2710,6 +2686,10 @@ static void cliPrint(const char *str)
|
|||
{
|
||||
while (*str)
|
||||
bufWriterAppend(cliWriter, *str++);
|
||||
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cliPutp(void *p, char ch)
|
||||
|
@ -2723,6 +2703,10 @@ static void cliPrintf(const char *fmt, ...)
|
|||
va_start(va, fmt);
|
||||
tfp_format(cliWriter, cliPutp, fmt, va);
|
||||
va_end(va);
|
||||
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cliWrite(uint8_t ch)
|
||||
|
@ -2856,10 +2840,6 @@ static void cliSet(char *cmdline)
|
|||
cliPrintf("%s = ", valueTable[i].name);
|
||||
cliPrintVar(val, len); // when len is 1 (when * is passed as argument), it will print min/max values as well, for gui
|
||||
cliPrint("\r\n");
|
||||
|
||||
#ifdef USE_SLOW_SERIAL_CLI
|
||||
delay(2);
|
||||
#endif
|
||||
}
|
||||
} else if ((eqptr = strstr(cmdline, "=")) != NULL) {
|
||||
// has equals
|
||||
|
|
Loading…
Reference in New Issue