1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-19 22:35:17 +03:00

Work with gyro native sampling

This commit is contained in:
Miguel Angel Mulero Martinez 2020-02-04 11:35:03 +01:00
parent 55aab38680
commit 9394d5901c
7 changed files with 115 additions and 73 deletions

View file

@ -192,16 +192,22 @@ TABS.onboard_logging.initialize = function (callback) {
function populateLoggingRates(loggingRatesSelect) {
// Offer a reasonable choice of logging rates (if people want weird steps they can use CLI)
var loggingRates = [];
var pidRateBase = 8000;
let loggingRates = [];
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0") && PID_ADVANCED_CONFIG.gyroUse32kHz !== 0) {
pidRateBase = 32000;
let pidRate;
if (semver.gte(CONFIG.apiVersion, "1.43.0")) {
pidRate = CONFIG.sampleRateHz / PID_ADVANCED_CONFIG.pid_process_denom;
} else {
let pidRateBase = 8000;
if (semver.gte(CONFIG.apiVersion, "1.25.0") && semver.lt(CONFIG.apiVersion, "1.41.0") && PID_ADVANCED_CONFIG.gyroUse32kHz !== 0) {
pidRateBase = 32000;
}
pidRate = pidRateBase / PID_ADVANCED_CONFIG.gyro_sync_denom / PID_ADVANCED_CONFIG.pid_process_denom;
}
var pidRate = pidRateBase / PID_ADVANCED_CONFIG.gyro_sync_denom /
PID_ADVANCED_CONFIG.pid_process_denom;
if (semver.gte(CONFIG.apiVersion, "1.36.0")) {
loggingRates = [
{text: "Disabled", hz: 0, p_denom: 0},