Skip to content

Commit 44e7de1

Browse files
committed
Merge fix/output-mapping-timer-priority into feature/unified-pinio-pwm-output
Combine PINIO output support (HEAD) with timer priority fixes (merged branch): - PINIO pre-assignment: outputs with specialLabels >= SPECIAL_LABEL_PINIO_BASE are assigned OUTPUT_TYPE_PINIO before the two-pass motor/servo loop, since PINIO identity comes from MSP specialLabels not from timer priority. - Two-pass priority, motor numbering, B-type overflow guard, parseInt fix, and live change handler all carried forward from fix/output-mapping-timer-priority.
2 parents 5888a50 + 04937a2 commit 44e7de1

22 files changed

Lines changed: 1374 additions & 284 deletions

images/icons/search-white.svg

Lines changed: 11 additions & 4 deletions
Loading

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ <h1 class="modal__title modal__title" data-i18n="appUpdateNotificationHeader"></
8787
<div class="dropdown dropdown-dark">
8888
<form name="profile-change" id="profile-change">
8989
<!--suppress HtmlFormInputWithoutLabel -->
90-
<select class="dropdown-select" id="profilechange">
90+
<select class="dropdown-select" id="profilechange" data-i18n_title="sensorProfileTitle">
9191
<option value="0" i18n="sensorProfile1"></option>
9292
<option value="1" i18n="sensorProfile2"></option>
9393
<option value="2" i18n="sensorProfile3"></option>
@@ -98,7 +98,7 @@ <h1 class="modal__title modal__title" data-i18n="appUpdateNotificationHeader"></
9898
<div id="mixer_profile_change">
9999
<div class="dropdown dropdown-dark">
100100
<form name="mixer-profile-change" id="mixer-profile-change">
101-
<select class="dropdown-select" id="mixerprofilechange">
101+
<select class="dropdown-select" id="mixerprofilechange" data-i18n_title="mixerProfileTitle">
102102
<option value="0" i18n="mixerProfile1"></option>
103103
<option value="1" i18n="mixerProfile2"></option>
104104
</select>
@@ -109,7 +109,7 @@ <h1 class="modal__title modal__title" data-i18n="appUpdateNotificationHeader"></
109109
<div class="dropdown dropdown-dark">
110110
<form name="battery-profile-change" id="battery-profile-change">
111111
<!--suppress HtmlFormInputWithoutLabel -->
112-
<select class="dropdown-select" id="batteryprofilechange">
112+
<select class="dropdown-select" id="batteryprofilechange" data-i18n_title="sensorBatteryProfileTitle">
113113
<option value="0" i18n="sensorBatteryProfile1"></option>
114114
<option value="1" i18n="sensorBatteryProfile2"></option>
115115
<option value="2" i18n="sensorBatteryProfile3"></option>
@@ -120,10 +120,9 @@ <h1 class="modal__title modal__title" data-i18n="appUpdateNotificationHeader"></
120120
</div>
121121
<div id="dataflash_wrapper_global">
122122
<div class="noflash_global" align="center" i18n="sensorDataFlashNotFound"></div>
123+
<div class="dataflash-free_global_label" i18n="sensorDataFlashFreeSpace"></div>
123124
<ul class="dataflash-contents_global">
124-
<li class="dataflash-free_global">
125-
<div class="legend" i18n="sensorDataFlashFreeSpace"></div>
126-
</li>
125+
<li class="dataflash-free_global"></li>
127126
</ul>
128127
</div>
129128
<div id="sensor-status" class="sensor_state mode-connected">
@@ -161,6 +160,7 @@ <h1 class="modal__title modal__title" data-i18n="appUpdateNotificationHeader"></
161160
<div class="battery-status"></div>
162161
</div>
163162
</div>
163+
<div class="battery-label">Batt</div>
164164
<div class="battery-legend" i18n="sensorBatteryVoltage"></div>
165165
<div class="bottomStatusIcons">
166166
<div id="armedIcon" class="statusicon armed cf_tip" data-i18n_title="mainHelpArmed"></div>

js/connection/connectionBle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const BleDevices = [
1919
{
2020
name: "Nordic Semiconductor NRF",
2121
serviceUuid: '6e400001-b5a3-f393-e0a9-e50e24dcca9e',
22-
writeCharateristic: '6e400003-b5a3-f393-e0a9-e50e24dcca9e',
23-
readCharateristic: '6e400002-b5a3-f393-e0a9-e50e24dcca9e',
22+
writeCharateristic: '6e400002-b5a3-f393-e0a9-e50e24dcca9e',
23+
readCharateristic: '6e400003-b5a3-f393-e0a9-e50e24dcca9e',
2424
delay: 30,
2525
},
2626
{

js/gui.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,17 +452,17 @@ GUI_control.prototype.sliderize = function ($input, value, min, max) {
452452
GUI_control.prototype.update_dataflash_global = function () {
453453
function formatFilesize(bytes) {
454454
if (bytes < 1024) {
455-
return bytes + "B";
455+
return Math.round(bytes / 1024) + " KB";
456456
}
457457
var kilobytes = bytes / 1024;
458458

459459
if (kilobytes < 1024) {
460-
return Math.round(kilobytes) + "kB";
460+
return Math.round(kilobytes) + " KB";
461461
}
462462

463463
var megabytes = kilobytes / 1024;
464464

465-
return megabytes.toFixed(1) + "MB";
465+
return megabytes.toFixed(1) + " MB";
466466
}
467467

468468
var supportsDataflash = FC.DATAFLASH.totalSize > 0;
@@ -480,7 +480,7 @@ GUI_control.prototype.update_dataflash_global = function () {
480480
width: (100-(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize) / FC.DATAFLASH.totalSize * 100) + "%",
481481
display: 'block'
482482
});
483-
$(".dataflash-free_global div").html(i18n.getMessage('sensorDataFlashFreeSpace') + formatFilesize(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize));
483+
$(".dataflash-free_global_label").html(i18n.getMessage('sensorDataFlashFreeSpace') + formatFilesize(FC.DATAFLASH.totalSize - FC.DATAFLASH.usedSize) + " free");
484484
} else {
485485
$(".noflash_global").css({
486486
display: 'block'

js/msp/MSPHelper.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2766,20 +2766,25 @@ var mspHelper = (function () {
27662766
}
27672767
};
27682768

2769-
self.sendLedStripConfig = function (onCompleteCallback) {
2769+
self.sendLedStripConfig = function (onCompleteCallback, slotsToSend) {
27702770

2771-
var nextFunction = send_next_led_strip_config;
2772-
2773-
var ledIndex = 0;
2771+
var indicesToSend = [];
2772+
for (var i = 0; i < FC.LED_STRIP.length; i++) {
2773+
if (!slotsToSend || slotsToSend.has(i)) {
2774+
indicesToSend.push(i);
2775+
}
2776+
}
27742777

2775-
if (FC.LED_STRIP.length == 0) {
2778+
if (indicesToSend.length === 0) {
27762779
onCompleteCallback();
2777-
} else {
2778-
send_next_led_strip_config();
2780+
return;
27792781
}
27802782

2781-
function send_next_led_strip_config() {
2783+
var position = 0;
2784+
send_next_led_strip_config();
27822785

2786+
function send_next_led_strip_config() {
2787+
var ledIndex = indicesToSend[position];
27832788
var led = FC.LED_STRIP[ledIndex];
27842789
/*
27852790
var led = {
@@ -2849,10 +2854,8 @@ var mspHelper = (function () {
28492854
buffer.push(BitHelper.specificByte(extra, 0));
28502855

28512856
// prepare for next iteration
2852-
ledIndex++;
2853-
if (ledIndex == FC.LED_STRIP.length) {
2854-
nextFunction = onCompleteCallback;
2855-
}
2857+
position++;
2858+
var nextFunction = (position === indicesToSend.length) ? onCompleteCallback : send_next_led_strip_config;
28562859

28572860
MSP.send_message(MSPCodes.MSP2_INAV_SET_LED_STRIP_CONFIG_EX, buffer, false, nextFunction);
28582861
}

0 commit comments

Comments
 (0)