diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 65323db4..2ec4f069 100755
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -3334,5 +3334,17 @@
},
"functionFlags": {
"message": "Flags"
+ },
+ "configurationI2cSpeed": {
+ "message": "I2C Speed"
+ },
+ "configurationI2cSpeedHelp": {
+ "message": "I2C speed should be kept at the highest level that allows for all connected devices to work. Default 400kHz is a save value and it is suggested to switch to 800kHz in case of Multirotors."
+ },
+ "i2cSpeedSuggested800khz": {
+ "message": "Please switch to 800kHz if connected hardware allows for it"
+ },
+ "i2cSpeedTooLow": {
+ "message": "This I2C speed is too low!"
}
}
diff --git a/tabs/configuration.html b/tabs/configuration.html
index bc11cd21..f8db957b 100644
--- a/tabs/configuration.html
+++ b/tabs/configuration.html
@@ -30,6 +30,16 @@
+
+
+
+
diff --git a/tabs/configuration.js b/tabs/configuration.js
index 81ebfb0a..a8228cc3 100644
--- a/tabs/configuration.js
+++ b/tabs/configuration.js
@@ -63,9 +63,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
mspHelper.saveVTXConfig,
saveCraftName,
mspHelper.saveMiscV2,
+ saveSettings,
mspHelper.saveToEeprom
];
+ function saveSettings(onComplete) {
+ Settings.saveInputs().then(onComplete);
+ }
+
saveChainer.setChain(saveChain);
saveChainer.setExitPoint(reboot);
@@ -85,7 +90,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
function load_html() {
- GUI.load("./tabs/configuration.html", process_html);
+ GUI.load("./tabs/configuration.html", Settings.processHtml(process_html));
}
function process_html() {
@@ -278,6 +283,39 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('#battery_capacity_critical').val(MISC.battery_capacity_critical * 100 / MISC.battery_capacity);
$('#battery_capacity_unit').val(MISC.battery_capacity_unit);
+ let $i2cSpeed = $('#i2c_speed'),
+ $i2cSpeedInfo = $('#i2c_speed-info');
+
+ $i2cSpeed.change(function () {
+ let $this = $(this),
+ value = $this.children("option:selected").text();
+
+ if (value == "400KHZ") {
+
+ $i2cSpeedInfo.removeClass('ok-box');
+ $i2cSpeedInfo.addClass('info-box');
+ $i2cSpeedInfo.removeClass('warning-box');
+
+ $i2cSpeedInfo.html(chrome.i18n.getMessage('i2cSpeedSuggested800khz'));
+ $i2cSpeedInfo.show();
+
+ } else if (value == "800KHZ") {
+ $i2cSpeedInfo.removeClass('ok-box');
+ $i2cSpeedInfo.removeClass('info-box');
+ $i2cSpeedInfo.removeClass('warning-box');
+ $i2cSpeedInfo.hide();
+ } else {
+ $i2cSpeedInfo.removeClass('ok-box');
+ $i2cSpeedInfo.removeClass('info-box');
+ $i2cSpeedInfo.addClass('warning-box');
+ $i2cSpeedInfo.html(chrome.i18n.getMessage('i2cSpeedTooLow'));
+ $i2cSpeedInfo.show();
+ }
+
+ });
+
+ $i2cSpeed.change();
+
var $looptime = $("#looptime");
var $gyroLpf = $("#gyro-lpf"),
@@ -460,12 +498,8 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
googleAnalytics.sendEvent('Setting', 'Looptime', FC_CONFIG.loopTime);
-
- /*
- * send gyro LPF and async_mode tracking
- */
googleAnalytics.sendEvent('Setting', 'GyroLpf', FC.getGyroLpfValues()[INAV_PID_CONFIG.gyroscopeLpf].label);
- googleAnalytics.sendEvent('Setting', 'AsyncMode', FC.getAsyncModes()[INAV_PID_CONFIG.asynchronousMode]);
+ googleAnalytics.sendEvent('Setting', 'I2CSpeed', $('#i2c_speed').children("option:selected").text());
googleAnalytics.sendEvent('Board', 'Accelerometer', FC.getAccelerometerNames()[SENSOR_CONFIG.accelerometer]);
googleAnalytics.sendEvent('Board', 'Magnetometer', FC.getMagnetometerNames()[SENSOR_CONFIG.magnetometer]);
@@ -479,6 +513,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
}
}
+
helper.features.reset();
helper.features.fromUI($('.tab-configuration'));
helper.features.execute(function () {