1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-24 00:35:20 +03:00

Intermediate commit.

Not currently working
This commit is contained in:
Marcelo Bezerra 2023-09-05 21:21:46 +02:00
parent 553bde1b37
commit 372dcae919
4 changed files with 87 additions and 14 deletions

View file

@ -3,7 +3,8 @@
let OutputMappingCollection = function () {
let self = {},
data = [];
data = [],
timerOverrides = {};
const TIM_USE_ANY = 0;
const TIM_USE_PPM = 0;
@ -19,6 +20,26 @@ let OutputMappingCollection = function () {
const OUTPUT_TYPE_MOTOR = 0;
const OUTPUT_TYPE_SERVO = 1;
const TIMER_OUTPUT_MODE_AUTO = 0;
const TIMER_OUTPUT_MODE_MOTORS = 1;
const TIMER_OUTPUT_MODE_SERVOS = 2;
self.flushTimerOverrides = function() {
timerOverrides = {};
}
self.setTimerOverride = function (timer, outputMode) {
timerOverrides[timer] = outputMode;
}
self.getTimerOverride = function (timer) {
timerOverrides[timer] = outputMode;
}
self.getTimerOverrideIds = function (timer) {
return Object.keys(timerOverrides).sort((a, b) => a - b);
}
function getTimerMap(isMR, motors, servos) {
let timerMap = [],
motorsToGo = motors,