1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-18 22:05:13 +03:00

Added support for disabling the motor output protocol.

This commit is contained in:
mikeller 2020-03-22 15:27:56 +13:00
parent 3faab9cedc
commit ebd36055da
9 changed files with 125 additions and 67 deletions

View file

@ -353,20 +353,32 @@ function processBoardInfo() {
}
function checkReportProblems() {
const PROBLEM_ANALYTICS_EVENT = 'ProblemFound';
const problemItemTemplate = $('#dialogReportProblems-listItemTemplate');
function checkReportProblem(problemName, problemDialogList) {
if (bit_check(CONFIG.configurationProblems, FC.CONFIGURATION_PROBLEM_FLAGS[problemName])) {
problemItemTemplate.clone().html(i18n.getMessage(`reportProblemsDialog${problemName}`)).appendTo(problemDialogList);
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, PROBLEM_ANALYTICS_EVENT, problemName);
return true;
}
return false;
}
MSP.send_message(MSPCodes.MSP_STATUS, false, false, function () {
let needsProblemReportingDialog = false;
const problemDialogList = $('#dialogReportProblems-list');
problemDialogList.empty();
const problemItemTemplate = $('.dialogReportProblems-listItem');
const PROBLEM_ANALYTICS_EVENT = 'ProblemFound';
if (have_sensor(CONFIG.activeSensors, 'acc') && bit_check(CONFIG.targetCapabilities, FC.TARGET_CAPABILITIES_FLAGS.ACC_NEEDS_CALIBRATION)) {
needsProblemReportingDialog = true;
problemDialogList.append(problemItemTemplate.clone().html(i18n.getMessage('reportProblemsDialogAccCalibrationNeeded')));
analytics.sendEvent(analytics.EVENT_CATEGORIES.FLIGHT_CONTROLLER, PROBLEM_ANALYTICS_EVENT, 'AccNotCalibrated');
if (have_sensor(CONFIG.activeSensors, 'acc')) {
needsProblemReportingDialog = checkReportProblem('ACC_NEEDS_CALIBRATION', problemDialogList) || needsProblemReportingDialog;
}
needsProblemReportingDialog = checkReportProblem('MOTOR_PROTOCOL_DISABLED', problemDialogList) || needsProblemReportingDialog;
if (needsProblemReportingDialog) {
const problemDialog = $('#dialogReportProblems')[0];
$('#dialogReportProblems-closebtn').click(function() {