mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
Merge branch 'betaflight_f4' into resource_rework
This commit is contained in:
commit
184eef9d03
3 changed files with 101 additions and 201 deletions
|
@ -1118,6 +1118,15 @@ static bool sendFieldDefinition(char mainFrameChar, char deltaFrameChar, const v
|
||||||
return xmitState.headerIndex < headerCount;
|
return xmitState.headerIndex < headerCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef BLACKBOX_PRINT_HEADER_LINE
|
||||||
|
#define BLACKBOX_PRINT_HEADER_LINE(x, ...) case __COUNTER__: \
|
||||||
|
blackboxPrintfHeaderLine(x, __VA_ARGS__); \
|
||||||
|
break;
|
||||||
|
#define BLACKBOX_PRINT_HEADER_LINE_CUSTOM(...) case __COUNTER__: \
|
||||||
|
{__VA_ARGS__}; \
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Transmit a portion of the system information headers. Call the first time with xmitState.headerIndex == 0. Returns
|
* Transmit a portion of the system information headers. Call the first time with xmitState.headerIndex == 0. Returns
|
||||||
* true iff transmission is complete, otherwise call again later to continue transmission.
|
* true iff transmission is complete, otherwise call again later to continue transmission.
|
||||||
|
@ -1130,209 +1139,97 @@ static bool blackboxWriteSysinfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (xmitState.headerIndex) {
|
switch (xmitState.headerIndex) {
|
||||||
case 0:
|
BLACKBOX_PRINT_HEADER_LINE("Firmware type:%s", "Cleanflight");
|
||||||
blackboxPrintfHeaderLine("Firmware type:Cleanflight");
|
BLACKBOX_PRINT_HEADER_LINE("Firmware revision:Betaflight %s (%s) %s", FC_VERSION_STRING, shortGitRevision, targetName);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("Firmware date:%s %s", buildDate, buildTime);
|
||||||
case 1:
|
BLACKBOX_PRINT_HEADER_LINE("P interval:%d/%d", masterConfig.blackbox_rate_num, masterConfig.blackbox_rate_denom);
|
||||||
blackboxPrintfHeaderLine("Firmware revision:Betaflight %s (%s) %s", FC_VERSION_STRING, shortGitRevision, targetName);
|
BLACKBOX_PRINT_HEADER_LINE("minthrottle:%d", masterConfig.escAndServoConfig.minthrottle);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("maxthrottle:%d", masterConfig.escAndServoConfig.maxthrottle);
|
||||||
case 2:
|
BLACKBOX_PRINT_HEADER_LINE("gyro.scale:0x%x", castFloatBytesToInt(gyro.scale));
|
||||||
blackboxPrintfHeaderLine("Firmware date:%s %s", buildDate, buildTime);
|
BLACKBOX_PRINT_HEADER_LINE("acc_1G:%u", acc_1G);
|
||||||
break;
|
|
||||||
case 3:
|
BLACKBOX_PRINT_HEADER_LINE_CUSTOM(
|
||||||
blackboxPrintfHeaderLine("P interval:%d/%d", masterConfig.blackbox_rate_num, masterConfig.blackbox_rate_denom);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
blackboxPrintfHeaderLine("rcRate:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcRate8);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
blackboxPrintfHeaderLine("minthrottle:%d", masterConfig.escAndServoConfig.minthrottle);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
blackboxPrintfHeaderLine("maxthrottle:%d", masterConfig.escAndServoConfig.maxthrottle);
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
blackboxPrintfHeaderLine("gyro.scale:0x%x", castFloatBytesToInt(gyro.scale));
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
blackboxPrintfHeaderLine("acc_1G:%u", acc_1G);
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_VBAT)) {
|
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_VBAT)) {
|
||||||
blackboxPrintfHeaderLine("vbatscale:%u", masterConfig.batteryConfig.vbatscale);
|
blackboxPrintfHeaderLine("vbatscale:%u", masterConfig.batteryConfig.vbatscale);
|
||||||
} else {
|
} else {
|
||||||
xmitState.headerIndex += 2; // Skip the next two vbat fields too
|
xmitState.headerIndex += 2; // Skip the next two vbat fields too
|
||||||
}
|
}
|
||||||
break;
|
);
|
||||||
case 10:
|
|
||||||
blackboxPrintfHeaderLine("vbatcellvoltage:%u,%u,%u", masterConfig.batteryConfig.vbatmincellvoltage,
|
BLACKBOX_PRINT_HEADER_LINE("vbatcellvoltage:%u,%u,%u", masterConfig.batteryConfig.vbatmincellvoltage,
|
||||||
masterConfig.batteryConfig.vbatwarningcellvoltage, masterConfig.batteryConfig.vbatmaxcellvoltage);
|
masterConfig.batteryConfig.vbatwarningcellvoltage,
|
||||||
break;
|
masterConfig.batteryConfig.vbatmaxcellvoltage);
|
||||||
case 11:
|
BLACKBOX_PRINT_HEADER_LINE("vbatref:%u", vbatReference);
|
||||||
blackboxPrintfHeaderLine("vbatref:%u", vbatReference);
|
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE_CUSTOM(
|
||||||
case 12:
|
|
||||||
//Note: Log even if this is a virtual current meter, since the virtual meter uses these parameters too:
|
//Note: Log even if this is a virtual current meter, since the virtual meter uses these parameters too:
|
||||||
if (feature(FEATURE_CURRENT_METER)) {
|
if (feature(FEATURE_CURRENT_METER)) {
|
||||||
blackboxPrintfHeaderLine("currentMeter:%d,%d", masterConfig.batteryConfig.currentMeterOffset, masterConfig.batteryConfig.currentMeterScale);
|
blackboxPrintfHeaderLine("currentMeter:%d,%d", masterConfig.batteryConfig.currentMeterOffset, masterConfig.batteryConfig.currentMeterScale);
|
||||||
}
|
}
|
||||||
break;
|
);
|
||||||
case 13:
|
|
||||||
blackboxPrintfHeaderLine("rcExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcExpo8);
|
BLACKBOX_PRINT_HEADER_LINE("looptime:%d", targetLooptime);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("rcRate:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcRate8);
|
||||||
case 14:
|
BLACKBOX_PRINT_HEADER_LINE("rcExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcExpo8);
|
||||||
blackboxPrintfHeaderLine("rcYawExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcYawExpo8);
|
BLACKBOX_PRINT_HEADER_LINE("rcYawRate:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcYawRate8);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("rcYawExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rcYawExpo8);
|
||||||
case 15:
|
BLACKBOX_PRINT_HEADER_LINE("thrMid:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].thrMid8);
|
||||||
blackboxPrintfHeaderLine("thrMid:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].thrMid8);
|
BLACKBOX_PRINT_HEADER_LINE("thrExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].thrExpo8);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("dynThrPID:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].dynThrPID);
|
||||||
case 16:
|
BLACKBOX_PRINT_HEADER_LINE("tpa_breakpoint:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].tpa_breakpoint);
|
||||||
blackboxPrintfHeaderLine("thrExpo:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].thrExpo8);
|
BLACKBOX_PRINT_HEADER_LINE("rates:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[ROLL],
|
||||||
break;
|
masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[PITCH],
|
||||||
case 17:
|
masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[YAW]);
|
||||||
blackboxPrintfHeaderLine("dynThrPID:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].dynThrPID);
|
BLACKBOX_PRINT_HEADER_LINE("pidController:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.pidController);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("rollPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[ROLL],
|
||||||
case 18:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[ROLL],
|
||||||
blackboxPrintfHeaderLine("tpa_breakpoint:%d", masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].tpa_breakpoint);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[ROLL]);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("pitchPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PITCH],
|
||||||
case 19:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PITCH],
|
||||||
blackboxPrintfHeaderLine("rates:%d,%d,%d",
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PITCH]);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[ROLL],
|
BLACKBOX_PRINT_HEADER_LINE("yawPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[YAW],
|
||||||
masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[PITCH],
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[YAW],
|
||||||
masterConfig.profile[masterConfig.current_profile_index].controlRateProfile[masterConfig.profile[masterConfig.current_profile_index].activeRateProfile].rates[YAW]);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[YAW]);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("altPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDALT],
|
||||||
case 20:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDALT],
|
||||||
blackboxPrintfHeaderLine("looptime:%d", targetLooptime);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDALT]);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("posPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDPOS],
|
||||||
case 21:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDPOS],
|
||||||
blackboxPrintfHeaderLine("pidController:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.pidController);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDPOS]);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("posrPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDPOSR],
|
||||||
case 22:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDPOSR],
|
||||||
blackboxPrintfHeaderLine("rollPID:%d,%d,%d",
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDPOSR]);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[ROLL],
|
BLACKBOX_PRINT_HEADER_LINE("navrPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDNAVR],
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[ROLL],
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDNAVR],
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[ROLL]);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDNAVR]);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("levelPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDLEVEL],
|
||||||
case 23:
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDLEVEL],
|
||||||
blackboxPrintfHeaderLine("pitchPID:%d,%d,%d",
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDLEVEL]);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PITCH],
|
BLACKBOX_PRINT_HEADER_LINE("magPID:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDMAG]);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PITCH],
|
BLACKBOX_PRINT_HEADER_LINE("velPID:%d,%d,%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDVEL],
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PITCH]);
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDVEL],
|
||||||
break;
|
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDVEL]);
|
||||||
case 24:
|
BLACKBOX_PRINT_HEADER_LINE("yaw_p_limit:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.yaw_p_limit);
|
||||||
blackboxPrintfHeaderLine("yawPID:%d,%d,%d",
|
BLACKBOX_PRINT_HEADER_LINE("yaw_lpf_hz:%d", (int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.yaw_lpf_hz * 100.0f));
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[YAW],
|
BLACKBOX_PRINT_HEADER_LINE("dterm_average_count:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_average_count);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[YAW],
|
BLACKBOX_PRINT_HEADER_LINE("dynamic_pid:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.dynamic_pid);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[YAW]);
|
BLACKBOX_PRINT_HEADER_LINE("rollPitchItermIgnoreRate:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.rollPitchItermIgnoreRate);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("yawItermIgnoreRate:%d", masterConfig.profile[masterConfig.current_profile_index].pidProfile.yawItermIgnoreRate);
|
||||||
case 25:
|
BLACKBOX_PRINT_HEADER_LINE("dterm_lpf_hz:%d", (int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_lpf_hz * 100.0f));
|
||||||
blackboxPrintfHeaderLine("altPID:%d,%d,%d",
|
BLACKBOX_PRINT_HEADER_LINE("deadband:%d", masterConfig.rcControlsConfig.deadband);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDALT],
|
BLACKBOX_PRINT_HEADER_LINE("yaw_deadband:%d", masterConfig.rcControlsConfig.yaw_deadband);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDALT],
|
BLACKBOX_PRINT_HEADER_LINE("gyro_lpf:%d", masterConfig.gyro_lpf);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDALT]);
|
BLACKBOX_PRINT_HEADER_LINE("gyro_lowpass_hz:%d", (int)(masterConfig.gyro_soft_lpf_hz * 100.0f));
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("acc_lpf_hz:%d", (int)(masterConfig.acc_lpf_hz * 100.0f));
|
||||||
case 26:
|
BLACKBOX_PRINT_HEADER_LINE("acc_hardware:%d", masterConfig.acc_hardware);
|
||||||
blackboxPrintfHeaderLine("posPID:%d,%d,%d",
|
BLACKBOX_PRINT_HEADER_LINE("baro_hardware:%d", masterConfig.baro_hardware);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDPOS],
|
BLACKBOX_PRINT_HEADER_LINE("mag_hardware:%d", masterConfig.mag_hardware);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDPOS],
|
BLACKBOX_PRINT_HEADER_LINE("gyro_cal_on_first_arm:%d", masterConfig.gyro_cal_on_first_arm);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDPOS]);
|
BLACKBOX_PRINT_HEADER_LINE("vbat_pid_compensation:%d", masterConfig.batteryConfig.vbatPidCompensation);
|
||||||
break;
|
BLACKBOX_PRINT_HEADER_LINE("rc_smoothing:%d", masterConfig.rxConfig.rcSmoothing);
|
||||||
case 27:
|
BLACKBOX_PRINT_HEADER_LINE("airmode_activate_throttle:%d", masterConfig.rxConfig.airModeActivateThreshold);
|
||||||
blackboxPrintfHeaderLine("posrPID:%d,%d,%d",
|
BLACKBOX_PRINT_HEADER_LINE("features:%d", masterConfig.enabledFeatures);
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDPOSR],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDPOSR],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDPOSR]);
|
|
||||||
break;
|
|
||||||
case 28:
|
|
||||||
blackboxPrintfHeaderLine("navrPID:%d,%d,%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDNAVR],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDNAVR],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDNAVR]);
|
|
||||||
break;
|
|
||||||
case 29:
|
|
||||||
blackboxPrintfHeaderLine("levelPID:%d,%d,%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDLEVEL],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDLEVEL],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDLEVEL]);
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
blackboxPrintfHeaderLine("magPID:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDMAG]);
|
|
||||||
break;
|
|
||||||
case 31:
|
|
||||||
blackboxPrintfHeaderLine("velPID:%d,%d,%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.P8[PIDVEL],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.I8[PIDVEL],
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.D8[PIDVEL]);
|
|
||||||
break;
|
|
||||||
case 32:
|
|
||||||
blackboxPrintfHeaderLine("yaw_p_limit:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.yaw_p_limit);
|
|
||||||
break;
|
|
||||||
case 33:
|
|
||||||
blackboxPrintfHeaderLine("yaw_lpf_hz:%d",
|
|
||||||
(int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.yaw_lpf_hz * 100.0f));
|
|
||||||
break;
|
|
||||||
case 34:
|
|
||||||
blackboxPrintfHeaderLine("dterm_average_count:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_average_count);
|
|
||||||
break;
|
|
||||||
case 35:
|
|
||||||
blackboxPrintfHeaderLine("dynamic_pid:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.dynamic_pid);
|
|
||||||
break;
|
|
||||||
case 36:
|
|
||||||
blackboxPrintfHeaderLine("rollPitchItermResetRate:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.rollPitchItermIgnoreRate);
|
|
||||||
break;
|
|
||||||
case 37:
|
|
||||||
blackboxPrintfHeaderLine("yawItermResetRate:%d",
|
|
||||||
masterConfig.profile[masterConfig.current_profile_index].pidProfile.yawItermIgnoreRate);
|
|
||||||
break;
|
|
||||||
case 38:
|
|
||||||
blackboxPrintfHeaderLine("dterm_lpf_hz:%d",
|
|
||||||
(int)(masterConfig.profile[masterConfig.current_profile_index].pidProfile.dterm_lpf_hz * 100.0f));
|
|
||||||
break;
|
|
||||||
case 39:
|
|
||||||
blackboxPrintfHeaderLine("airmode_activate_throttle:%d",
|
|
||||||
masterConfig.rxConfig.airModeActivateThreshold);
|
|
||||||
break;
|
|
||||||
case 40:
|
|
||||||
blackboxPrintfHeaderLine("deadband:%d", masterConfig.rcControlsConfig.deadband);
|
|
||||||
break;
|
|
||||||
case 41:
|
|
||||||
blackboxPrintfHeaderLine("yaw_deadband:%d", masterConfig.rcControlsConfig.yaw_deadband);
|
|
||||||
break;
|
|
||||||
case 42:
|
|
||||||
blackboxPrintfHeaderLine("gyro_lpf:%d", masterConfig.gyro_lpf);
|
|
||||||
break;
|
|
||||||
case 43:
|
|
||||||
blackboxPrintfHeaderLine("gyro_lowpass_hz:%d", (int)(masterConfig.gyro_soft_lpf_hz * 100.0f));
|
|
||||||
break;
|
|
||||||
case 44:
|
|
||||||
blackboxPrintfHeaderLine("acc_lpf_hz:%d", (int)(masterConfig.acc_lpf_hz * 100.0f));
|
|
||||||
break;
|
|
||||||
case 45:
|
|
||||||
blackboxPrintfHeaderLine("acc_hardware:%d", masterConfig.acc_hardware);
|
|
||||||
break;
|
|
||||||
case 46:
|
|
||||||
blackboxPrintfHeaderLine("baro_hardware:%d", masterConfig.baro_hardware);
|
|
||||||
break;
|
|
||||||
case 47:
|
|
||||||
blackboxPrintfHeaderLine("mag_hardware:%d", masterConfig.mag_hardware);
|
|
||||||
break;
|
|
||||||
case 48:
|
|
||||||
blackboxPrintfHeaderLine("gyro_cal_on_first_arm:%d", masterConfig.gyro_cal_on_first_arm);
|
|
||||||
break;
|
|
||||||
case 49:
|
|
||||||
blackboxPrintfHeaderLine("vbat_pid_compensation:%d", masterConfig.batteryConfig.vbatPidCompensation);
|
|
||||||
break;
|
|
||||||
case 50:
|
|
||||||
blackboxPrintfHeaderLine("rc_smoothing:%d", masterConfig.rxConfig.rcSmoothing);
|
|
||||||
break;
|
|
||||||
case 51:
|
|
||||||
blackboxPrintfHeaderLine("features:%d", masterConfig.enabledFeatures);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ float calculateRate(int axis, const controlRateConfig_t *controlRateConfig) {
|
||||||
float angleRate;
|
float angleRate;
|
||||||
|
|
||||||
if (isSuperExpoActive()) {
|
if (isSuperExpoActive()) {
|
||||||
float rcFactor = (axis == YAW) ? (ABS(rcCommand[axis]) / 500.0f) : (ABS(rcCommand[axis]) / (500.0f * (controlRateConfig->rcRate8 / 100.0f)));
|
float rcFactor = (axis == YAW) ? (ABS(rcCommand[axis]) / (500.0f * (controlRateConfig->rcYawRate8 / 100.0f))) : (ABS(rcCommand[axis]) / (500.0f * (controlRateConfig->rcRate8 / 100.0f)));
|
||||||
rcFactor = 1.0f / (constrainf(1.0f - (rcFactor * (controlRateConfig->rates[axis] / 100.0f)), 0.01f, 1.00f));
|
rcFactor = 1.0f / (constrainf(1.0f - (rcFactor * (controlRateConfig->rates[axis] / 100.0f)), 0.01f, 1.00f));
|
||||||
|
|
||||||
angleRate = rcFactor * ((27 * rcCommand[axis]) / 16.0f);
|
angleRate = rcFactor * ((27 * rcCommand[axis]) / 16.0f);
|
||||||
|
|
|
@ -2051,24 +2051,27 @@ static void cliDump(char *cmdline)
|
||||||
|
|
||||||
if (dumpMask & DUMP_ALL) {
|
if (dumpMask & DUMP_ALL) {
|
||||||
uint8_t activeProfile = masterConfig.current_profile_index;
|
uint8_t activeProfile = masterConfig.current_profile_index;
|
||||||
uint8_t currentRateIndex = currentProfile->activeRateProfile;
|
|
||||||
uint8_t profileCount;
|
uint8_t profileCount;
|
||||||
uint8_t rateCount;
|
|
||||||
for (profileCount=0; profileCount<MAX_PROFILE_COUNT;profileCount++) {
|
for (profileCount=0; profileCount<MAX_PROFILE_COUNT;profileCount++) {
|
||||||
cliDumpProfile(profileCount);
|
cliDumpProfile(profileCount);
|
||||||
|
|
||||||
|
uint8_t currentRateIndex = currentProfile->activeRateProfile;
|
||||||
|
uint8_t rateCount;
|
||||||
for (rateCount=0; rateCount<MAX_RATEPROFILES; rateCount++)
|
for (rateCount=0; rateCount<MAX_RATEPROFILES; rateCount++)
|
||||||
cliDumpRateProfile(rateCount);
|
cliDumpRateProfile(rateCount);
|
||||||
|
|
||||||
|
cliPrint("\r\n# restore original rateprofile selection\r\n");
|
||||||
|
|
||||||
|
changeControlRateProfile(currentRateIndex);
|
||||||
|
cliRateProfile("");
|
||||||
}
|
}
|
||||||
|
|
||||||
cliPrint("\r\n# restore original profile / rateprofile selection\r\n");
|
cliPrint("\r\n# restore original profile selection\r\n");
|
||||||
|
|
||||||
changeProfile(activeProfile);
|
changeProfile(activeProfile);
|
||||||
cliProfile("");
|
cliProfile("");
|
||||||
printSectionBreak();
|
printSectionBreak();
|
||||||
|
|
||||||
changeControlRateProfile(currentRateIndex);
|
|
||||||
cliRateProfile("");
|
|
||||||
|
|
||||||
cliPrint("\r\n# save configuration\r\nsave\r\n");
|
cliPrint("\r\n# save configuration\r\nsave\r\n");
|
||||||
} else {
|
} else {
|
||||||
cliDumpProfile(masterConfig.current_profile_index);
|
cliDumpProfile(masterConfig.current_profile_index);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue