mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 23:35:34 +03:00
CF/BF - Remove usage of USE_FC based on PR discussion decisions. Add
USE_VIRTUAL_CURRENT_METER.
This commit is contained in:
parent
b4dc3b53f5
commit
be063ebbbf
11 changed files with 66 additions and 64 deletions
|
@ -66,7 +66,6 @@
|
|||
#include "fc/rc_controls.h"
|
||||
#include "fc/runtime_config.h"
|
||||
|
||||
#ifdef USE_FC
|
||||
#include "flight/altitude.h"
|
||||
#include "flight/failsafe.h"
|
||||
#include "flight/imu.h"
|
||||
|
@ -74,7 +73,6 @@
|
|||
#include "flight/navigation.h"
|
||||
#include "flight/pid.h"
|
||||
#include "flight/servos.h"
|
||||
#endif
|
||||
|
||||
#include "io/beeper.h"
|
||||
#include "io/gimbal.h"
|
||||
|
@ -99,7 +97,7 @@
|
|||
|
||||
#include "telemetry/telemetry.h"
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
pidProfile_t *currentPidProfile;
|
||||
#endif
|
||||
|
||||
|
@ -121,7 +119,7 @@ PG_RESET_TEMPLATE(featureConfig_t, featureConfig,
|
|||
|
||||
PG_REGISTER_WITH_RESET_TEMPLATE(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 0);
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
PG_RESET_TEMPLATE(systemConfig_t, systemConfig,
|
||||
.pidProfileIndex = 0,
|
||||
.activeRateProfile = 0,
|
||||
|
@ -459,7 +457,7 @@ void pgResetFn_statusLedConfig(statusLedConfig_t *statusLedConfig)
|
|||
;
|
||||
}
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
uint8_t getCurrentPidProfileIndex(void)
|
||||
{
|
||||
return systemConfig()->pidProfileIndex;
|
||||
|
@ -495,7 +493,7 @@ void resetConfigs(void)
|
|||
|
||||
pgActivateProfile(0);
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
setPidProfile(0);
|
||||
setControlRateProfile(0);
|
||||
#endif
|
||||
|
@ -507,7 +505,7 @@ void resetConfigs(void)
|
|||
|
||||
void activateConfig(void)
|
||||
{
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
generateThrottleCurve();
|
||||
|
||||
resetAdjustmentStates();
|
||||
|
@ -531,7 +529,7 @@ void activateConfig(void)
|
|||
|
||||
void validateAndFixConfig(void)
|
||||
{
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
if((motorConfig()->dev.motorPwmProtocol == PWM_TYPE_BRUSHED) && (motorConfig()->mincommand < 1000)){
|
||||
motorConfigMutable()->mincommand = 1000;
|
||||
}
|
||||
|
@ -607,7 +605,7 @@ void validateAndFixConfig(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
void validateAndFixGyroConfig(void)
|
||||
{
|
||||
// Prevent invalid notch cutoff
|
||||
|
@ -687,7 +685,7 @@ void validateAndFixGyroConfig(void)
|
|||
|
||||
void readEEPROM(void)
|
||||
{
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
suspendRxSignal();
|
||||
#endif
|
||||
|
||||
|
@ -695,7 +693,7 @@ void readEEPROM(void)
|
|||
if (!loadEEPROM()) {
|
||||
failureMode(FAILURE_INVALID_EEPROM_CONTENTS);
|
||||
}
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
if (systemConfig()->activeRateProfile >= CONTROL_RATE_PROFILE_COUNT) {// sanity check
|
||||
systemConfigMutable()->activeRateProfile = 0;
|
||||
}
|
||||
|
@ -710,20 +708,20 @@ void readEEPROM(void)
|
|||
validateAndFixConfig();
|
||||
activateConfig();
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
resumeRxSignal();
|
||||
#endif
|
||||
}
|
||||
|
||||
void writeEEPROM(void)
|
||||
{
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
suspendRxSignal();
|
||||
#endif
|
||||
|
||||
writeConfigToEEPROM();
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
resumeRxSignal();
|
||||
#endif
|
||||
}
|
||||
|
@ -749,7 +747,7 @@ void saveConfigAndNotify(void)
|
|||
beeperConfirmationBeeps(1);
|
||||
}
|
||||
|
||||
#ifdef USE_FC
|
||||
#ifndef USE_OSD_SLAVE
|
||||
void changePidProfile(uint8_t pidProfileIndex)
|
||||
{
|
||||
if (pidProfileIndex >= MAX_PROFILE_COUNT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue