mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Code tidy. Renamed vbatscale in blackbox
This commit is contained in:
parent
86b3d862a2
commit
318fd2ee15
3 changed files with 6 additions and 8 deletions
|
@ -1214,7 +1214,7 @@ static bool blackboxWriteSysinfo()
|
||||||
|
|
||||||
BLACKBOX_PRINT_HEADER_LINE_CUSTOM(
|
BLACKBOX_PRINT_HEADER_LINE_CUSTOM(
|
||||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_VBAT)) {
|
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_VBAT)) {
|
||||||
blackboxPrintfHeaderLine("vbatscale", "%u", voltageSensorADCConfig(VOLTAGE_SENSOR_ADC_VBAT)->vbatscale);
|
blackboxPrintfHeaderLine("vbat_scale", "%u", voltageSensorADCConfig(VOLTAGE_SENSOR_ADC_VBAT)->vbatscale);
|
||||||
} else {
|
} else {
|
||||||
xmitState.headerIndex += 2; // Skip the next two vbat fields too
|
xmitState.headerIndex += 2; // Skip the next two vbat fields too
|
||||||
}
|
}
|
||||||
|
|
|
@ -493,7 +493,6 @@ typedef union {
|
||||||
cliMinMaxConfig_t minmax;
|
cliMinMaxConfig_t minmax;
|
||||||
} cliValueConfig_t;
|
} cliValueConfig_t;
|
||||||
|
|
||||||
#ifdef USE_PARAMETER_GROUPS
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *name;
|
const char *name;
|
||||||
const uint8_t type; // see cliValueFlag_e
|
const uint8_t type; // see cliValueFlag_e
|
||||||
|
@ -975,7 +974,6 @@ displayPortProfile_t displayPortProfileMax7456Copy;
|
||||||
static pidConfig_t pidConfigCopy;
|
static pidConfig_t pidConfigCopy;
|
||||||
static controlRateConfig_t controlRateProfilesCopy[CONTROL_RATE_PROFILE_COUNT];
|
static controlRateConfig_t controlRateProfilesCopy[CONTROL_RATE_PROFILE_COUNT];
|
||||||
static pidProfile_t pidProfileCopy[MAX_PROFILE_COUNT];
|
static pidProfile_t pidProfileCopy[MAX_PROFILE_COUNT];
|
||||||
#endif // USE_PARAMETER_GROUPS
|
|
||||||
|
|
||||||
static void cliPrint(const char *str)
|
static void cliPrint(const char *str)
|
||||||
{
|
{
|
||||||
|
|
|
@ -273,13 +273,13 @@ static float calcHorizonLevelStrength(void) {
|
||||||
|
|
||||||
static float pidLevel(int axis, const pidProfile_t *pidProfile, const rollAndPitchTrims_t *angleTrim, float currentPidSetpoint) {
|
static float pidLevel(int axis, const pidProfile_t *pidProfile, const rollAndPitchTrims_t *angleTrim, float currentPidSetpoint) {
|
||||||
// calculate error angle and limit the angle to the max inclination
|
// calculate error angle and limit the angle to the max inclination
|
||||||
float errorAngle = pidProfile->levelSensitivity * getRcDeflection(axis);
|
float angle = pidProfile->levelSensitivity * getRcDeflection(axis);
|
||||||
#ifdef GPS
|
#ifdef GPS
|
||||||
errorAngle += GPS_angle[axis];
|
angle += GPS_angle[axis];
|
||||||
#endif
|
#endif
|
||||||
errorAngle = constrainf(errorAngle, -pidProfile->levelAngleLimit, pidProfile->levelAngleLimit);
|
angle = constrainf(angle, -pidProfile->levelAngleLimit, pidProfile->levelAngleLimit);
|
||||||
errorAngle = errorAngle - ((attitude.raw[axis] - angleTrim->raw[axis]) / 10.0f);
|
const float errorAngle = angle - ((attitude.raw[axis] - angleTrim->raw[axis]) / 10.0f);
|
||||||
if(FLIGHT_MODE(ANGLE_MODE)) {
|
if (FLIGHT_MODE(ANGLE_MODE)) {
|
||||||
// ANGLE mode - control is angle based, so control loop is needed
|
// ANGLE mode - control is angle based, so control loop is needed
|
||||||
currentPidSetpoint = errorAngle * levelGain;
|
currentPidSetpoint = errorAngle * levelGain;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue