From 19f320e2f6d6a5a6f430b73a9ab51f9f34b1a3f1 Mon Sep 17 00:00:00 2001 From: Hydra Date: Sat, 1 Apr 2017 16:50:42 +0100 Subject: [PATCH] CF/BF - fix blackbox logging to use the right device numbers. --- tabs/onboard_logging.js | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/tabs/onboard_logging.js b/tabs/onboard_logging.js index 76a6402e..473b350a 100644 --- a/tabs/onboard_logging.js +++ b/tabs/onboard_logging.js @@ -86,7 +86,7 @@ TABS.onboard_logging.initialize = function (callback) { * * The best we can do on those targets is check the BLACKBOX feature bit to identify support for Blackbox instead. */ - if ((BLACKBOX.supported || DATAFLASH.supported) && FEATURE_CONFIG.features.isEnabled('BLACKBOX')) { + if ((BLACKBOX.supported || DATAFLASH.supported) && (semver.gte(CONFIG.apiVersion, "1.33.0") || FEATURE_CONFIG.features.isEnabled('BLACKBOX'))) { blackboxSupport = 'yes'; } else { blackboxSupport = 'no'; @@ -149,15 +149,25 @@ TABS.onboard_logging.initialize = function (callback) { function populateDevices(deviceSelect) { deviceSelect.empty(); - - deviceSelect.append(''); - if (DATAFLASH.ready) { - deviceSelect.append(''); + + if (semver.gte(CONFIG.apiVersion, "1.33.0")) { + deviceSelect.append(''); + if (DATAFLASH.ready) { + deviceSelect.append(''); + } + if (SDCARD.supported) { + deviceSelect.append(''); + } + deviceSelect.append(''); + } else { + deviceSelect.append(''); + if (DATAFLASH.ready) { + deviceSelect.append(''); + } + if (SDCARD.supported) { + deviceSelect.append(''); + } } - if (SDCARD.supported) { - deviceSelect.append(''); - } - deviceSelect.append(''); deviceSelect.val(BLACKBOX.blackboxDevice); }