From 55328b1c310fbc206e44df8843a2ffc6a3dd5905 Mon Sep 17 00:00:00 2001 From: Michel Pastor Date: Tue, 27 Feb 2018 13:06:39 +0100 Subject: [PATCH] Add SOFTSERIAL support on RX4/TX4 for MATEKF405 target --- src/main/target/MATEKF405/target.c | 4 ++-- src/main/target/MATEKF405/target.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) mode change 100755 => 100644 src/main/target/MATEKF405/target.c mode change 100755 => 100644 src/main/target/MATEKF405/target.h diff --git a/src/main/target/MATEKF405/target.c b/src/main/target/MATEKF405/target.c old mode 100755 new mode 100644 index 9951be8c88d..2076cf9bad2 --- a/src/main/target/MATEKF405/target.c +++ b/src/main/target/MATEKF405/target.c @@ -36,7 +36,7 @@ const timerHardware_t timerHardware[USABLE_TIMER_CHANNEL_COUNT] = { { TIM5, IO_TAG(PA2), TIM_Channel_3, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_PWM }, //TX2 - //{ TIM5, IO_TAG(PA0), TIM_Channel_1, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_ANY }, //TX4 softserial1_tx - //{ TIM5, IO_TAG(PA1), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_ANY }, //RX4 softserial1_rx + { TIM5, IO_TAG(PA0), TIM_Channel_1, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_PWM }, //TX4 softserial1_tx + { TIM5, IO_TAG(PA1), TIM_Channel_2, 1, IOCFG_AF_PP_PD, GPIO_AF_TIM5, TIM_USE_PWM }, //RX4 softserial1_rx }; diff --git a/src/main/target/MATEKF405/target.h b/src/main/target/MATEKF405/target.h old mode 100755 new mode 100644 index 36fe9b2ac37..70f9f01ad2c --- a/src/main/target/MATEKF405/target.h +++ b/src/main/target/MATEKF405/target.h @@ -118,11 +118,11 @@ #define UART5_RX_PIN PD2 #define UART5_TX_PIN PC12 -//#define USE_SOFTSERIAL1 -//#define SOFTSERIAL_1_RX_PIN PA1 //RX4 -//#define SOFTSERIAL_1_TX_PIN PA0 //TX4 +#define USE_SOFTSERIAL1 +#define SOFTSERIAL_1_RX_PIN PA1 //RX4 +#define SOFTSERIAL_1_TX_PIN PA0 //TX4 -#define SERIAL_PORT_COUNT 6 +#define SERIAL_PORT_COUNT 7 #define DEFAULT_RX_TYPE RX_TYPE_SERIAL #define SERIALRX_PROVIDER SERIALRX_SBUS @@ -182,7 +182,7 @@ #define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 #define RSSI_ADC_CHANNEL ADC_CHN_3 -#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY ) +#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY ) #define CURRENT_METER_SCALE 179 #define USE_LED_STRIP @@ -201,6 +201,6 @@ #define TARGET_IO_PORTC 0xffff #define TARGET_IO_PORTD (BIT(2)) -#define USABLE_TIMER_CHANNEL_COUNT 9 +#define USABLE_TIMER_CHANNEL_COUNT 11 #define MAX_PWM_OUTPUT_PORTS 6 #define USED_TIMERS (TIM_N(1)|TIM_N(2)|TIM_N(3)|TIM_N(4)|TIM_N(5)|TIM_N(8)|TIM_N(9))