Skip to content

Instantly share code, notes, and snippets.

@j0uni
Created September 3, 2017 07:26
Show Gist options
  • Save j0uni/1630672c79a9894b2126f361ec4e5588 to your computer and use it in GitHub Desktop.
Save j0uni/1630672c79a9894b2126f361ec4e5588 to your computer and use it in GitHub Desktop.
How to get fixed wing aeroplane work with DYS F4 FC work in iNav 1.7.2
How to get fixed wing aeroplane work with DYS F4 FC work in iNav 1.7.2 By default the motor_2 output doesn't support servos.
Use this mixer:
# mixer
mixer CUSTOMAIRPLANE
mmix 0 1.000 0.000 0.000 0.000
# servo
servo 1 700 2300 1400 125 -1
servo 2 1000 2000 1300 125 -1
servo 3 700 2300 1600 125 -1
# servo mix
smix 0 1 0 100 0
smix 1 2 1 100 0
smix 2 3 0 100 0
--------------
You need to update target.c with following code:
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <platform.h>
#include "drivers/io.h"
#include "drivers/pwm_mapping.h"
#include "drivers/timer.h"
const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = {
#if defined(OMNIBUSF4PRO) || defined(OMNIBUSF4V3)
{ TIM4, IO_TAG(PB8), TIM_Channel_3, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM4, TIM_USE_PPM }, // PPM
{ TIM4, IO_TAG(PB9), TIM_Channel_4, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM4, TIM_USE_ANY }, // S2_IN
#else
{ TIM12, IO_TAG(PB14), TIM_Channel_1, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM12, TIM_USE_PPM }, // PPM / S.BUS input, above MOTOR1
{ TIM12, IO_TAG(PB15), TIM_Channel_2, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM12, TIM_USE_ANY }, // Connected: small CH2 pad, not used as PWM, definition inherited from REVO target - GPIO_PartialRemap_TIM3
#endif
{ TIM8, IO_TAG(PC6), TIM_Channel_1, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, TIM_USE_ANY }, // Connected: UART6 TX, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC7), TIM_Channel_2, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, TIM_USE_ANY }, // Connected: UART6 RX, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC8), TIM_Channel_3, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, TIM_USE_ANY }, // Connected: small CH5 pad, not used as PWM, definition inherited from REVO target
{ TIM8, IO_TAG(PC9), TIM_Channel_4, 0, IOCFG_AF_PP_PD, GPIO_AF_TIM8, TIM_USE_ANY }, // Connected: small CH6 pad, not used as PWM, definition inherited from REVO target
{ TIM3, IO_TAG(PB0), TIM_Channel_3, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM3, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR }, // MOTOR_1
{ TIM3, IO_TAG(PB1), TIM_Channel_4, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM3, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_2
{ TIM9, IO_TAG(PA3), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM9, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_3
{ TIM2, IO_TAG(PA2), TIM_Channel_3, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM2, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_4
{ TIM5, IO_TAG(PA1), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_MC_MOTOR | TIM_USE_FW_SERVO }, // MOTOR_5 - GPIO_PartialRemap_TIM3
{ TIM1, IO_TAG(PA8), TIM_Channel_1, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM1, TIM_USE_MC_MOTOR | TIM_USE_MC_SERVO | TIM_USE_FW_SERVO }, // MOTOR_6
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment