mirror of
https://github.com/iNavFlight/inav-configurator.git
synced 2025-07-23 08:15:19 +03:00
Use new special label info from msp to tag led pin.
This commit is contained in:
parent
442859e55b
commit
16b212e244
3 changed files with 12 additions and 3 deletions
|
@ -1420,13 +1420,15 @@ var mspHelper = (function () {
|
|||
*/
|
||||
case MSPCodes.MSPV2_INAV_OUTPUT_MAPPING_EXT2:
|
||||
FC.OUTPUT_MAPPING.flush();
|
||||
for (let i = 0; i < data.byteLength; i += 5) {
|
||||
for (let i = 0; i < data.byteLength; i += 6) {
|
||||
let timerId = data.getUint8(i);
|
||||
let usageFlags = data.getUint32(i + 1, true);
|
||||
let specialLabels = data.getUint8(i + 5);
|
||||
FC.OUTPUT_MAPPING.put(
|
||||
{
|
||||
'timerId': timerId,
|
||||
'usageFlags': usageFlags
|
||||
'usageFlags': usageFlags,
|
||||
'specialLabels': specialLabels
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -32,6 +32,8 @@ var OutputMappingCollection = function () {
|
|||
const OUTPUT_TYPE_SERVO = 1;
|
||||
const OUTPUT_TYPE_LED = 2;
|
||||
|
||||
const SPECIAL_LABEL_LED = 1;
|
||||
|
||||
self.TIMER_OUTPUT_MODE_AUTO = 0;
|
||||
self.TIMER_OUTPUT_MODE_MOTORS = 1;
|
||||
self.TIMER_OUTPUT_MODE_SERVOS = 2;
|
||||
|
@ -55,6 +57,10 @@ var OutputMappingCollection = function () {
|
|||
return colorTable[timerIndex % colorTable.length];
|
||||
}
|
||||
|
||||
self.isLedPin = function(timer) {
|
||||
return data[timer].specialLabels == SPECIAL_LABEL_LED;
|
||||
}
|
||||
|
||||
self.getOutputTimerColor = function (output) {
|
||||
let timerId = self.getTimerId(output);
|
||||
|
||||
|
|
|
@ -94,8 +94,9 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
|
|||
|
||||
let timerId = FC.OUTPUT_MAPPING.getTimerId(i - 1);
|
||||
let color = FC.OUTPUT_MAPPING.getOutputTimerColor(i - 1);
|
||||
let isLed = FC.OUTPUT_MAPPING.isLedPin(i - 1);
|
||||
|
||||
$outputRow.append('<td style="background-color: ' + color + '">S' + i + ' (Timer ' + (timerId + 1) + ')</td>');
|
||||
$outputRow.append('<td style="background-color: ' + color + '">S' + i + (isLed ? '/LED' : '') + ' (Timer ' + (timerId + 1) + ')</td>');
|
||||
$functionRow.append('<td id="function-' + i +'">-</td>');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue