mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Drop Betaflight PIDc support for OPBL
This commit is contained in:
parent
5e5b44f593
commit
f4796c3676
4 changed files with 9 additions and 0 deletions
|
@ -199,7 +199,11 @@ static void resetControlRateConfig(controlRateConfig_t *controlRateConfig)
|
||||||
|
|
||||||
static void resetPidProfile(pidProfile_t *pidProfile)
|
static void resetPidProfile(pidProfile_t *pidProfile)
|
||||||
{
|
{
|
||||||
|
#if defined(SKIP_PID_FLOAT)
|
||||||
|
pidProfile->pidController = PID_CONTROLLER_LEGACY;
|
||||||
|
#else
|
||||||
pidProfile->pidController = PID_CONTROLLER_BETAFLIGHT;
|
pidProfile->pidController = PID_CONTROLLER_BETAFLIGHT;
|
||||||
|
#endif
|
||||||
|
|
||||||
pidProfile->P8[ROLL] = 45;
|
pidProfile->P8[ROLL] = 45;
|
||||||
pidProfile->I8[ROLL] = 40;
|
pidProfile->I8[ROLL] = 40;
|
||||||
|
|
|
@ -862,7 +862,9 @@ const clivalue_t valueTable[] = {
|
||||||
{ "yaw_lowpass", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yaw_lpf_hz, .config.minmax = {0, 500 } },
|
{ "yaw_lowpass", VAR_UINT16 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.yaw_lpf_hz, .config.minmax = {0, 500 } },
|
||||||
{ "pid_process_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.pid_process_denom, .config.minmax = { 1, 8 } },
|
{ "pid_process_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.pid_process_denom, .config.minmax = { 1, 8 } },
|
||||||
|
|
||||||
|
#ifndef SKIP_PID_FLOAT
|
||||||
{ "pid_controller", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.pidController, .config.lookup = { TABLE_PID_CONTROLLER } },
|
{ "pid_controller", VAR_UINT8 | PROFILE_VALUE | MODE_LOOKUP, &masterConfig.profile[0].pidProfile.pidController, .config.lookup = { TABLE_PID_CONTROLLER } },
|
||||||
|
#endif
|
||||||
|
|
||||||
{ "p_pitch", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.P8[PITCH], .config.minmax = { 0, 200 } },
|
{ "p_pitch", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.P8[PITCH], .config.minmax = { 0, 200 } },
|
||||||
{ "i_pitch", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.I8[PITCH], .config.minmax = { 0, 200 } },
|
{ "i_pitch", VAR_UINT8 | PROFILE_VALUE, &masterConfig.profile[0].pidProfile.I8[PITCH], .config.minmax = { 0, 200 } },
|
||||||
|
|
|
@ -1353,8 +1353,10 @@ static bool processInCommand(void)
|
||||||
read16();
|
read16();
|
||||||
break;
|
break;
|
||||||
case MSP_SET_PID_CONTROLLER:
|
case MSP_SET_PID_CONTROLLER:
|
||||||
|
#ifndef SKIP_PID_FLOAT
|
||||||
currentProfile->pidProfile.pidController = constrain(read8(), 0, 1);
|
currentProfile->pidProfile.pidController = constrain(read8(), 0, 1);
|
||||||
pidSetController(currentProfile->pidProfile.pidController);
|
pidSetController(currentProfile->pidProfile.pidController);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case MSP_SET_PID:
|
case MSP_SET_PID:
|
||||||
for (i = 0; i < PID_ITEM_COUNT; i++) {
|
for (i = 0; i < PID_ITEM_COUNT; i++) {
|
||||||
|
|
|
@ -118,6 +118,7 @@
|
||||||
#undef SONAR
|
#undef SONAR
|
||||||
#undef USE_SOFTSERIAL1
|
#undef USE_SOFTSERIAL1
|
||||||
#undef LED_STRIP
|
#undef LED_STRIP
|
||||||
|
#define SKIP_PID_FLOAT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
#define DEFAULT_RX_FEATURE FEATURE_RX_PPM
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue