From 2f119a41a79feb52fe2624a990c02abfe9ea35bd Mon Sep 17 00:00:00 2001 From: jflyper Date: Sat, 11 Feb 2017 03:52:03 +0900 Subject: [PATCH] Pre-define software uarts in common.h --- src/main/target/common.h | 4 ++++ src/main/target/common_post.h | 11 ++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/target/common.h b/src/main/target/common.h index 65eb2bd9d..6a7c8bbd7 100644 --- a/src/main/target/common.h +++ b/src/main/target/common.h @@ -71,6 +71,10 @@ #define USE_PWM #define USE_PPM +// Force two softserials (Individual target.h may turn these off) +#define USE_SOFTSERIAL1 +#define USE_SOFTSERIAL2 + #if defined(STM32F4) || defined(STM32F7) #define TASK_GYROPID_DESIRED_PERIOD 125 #define SCHEDULER_DELAY_LIMIT 10 diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index 2364c6904..041bbfe85 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -27,15 +27,8 @@ # undef VTX_TRAMP #endif -// Forced configuration of two software serials and SERIAL_PORT_COUNT recalc -#ifndef USE_SOFTSERIAL1 -# define USE_SOFTSERIAL1 -#endif - -#ifndef USE_SOFTSERIAL2 -# define USE_SOFTSERIAL2 -#endif - +// Forced config of USE_SOFTSERIAL{1,2} in common.h makes SERIAL_PORT_COUNT +// defined in target.h invalid. Count them and re-define SERIAL_PORT_COUNT. #ifdef USE_VCP # define N_VCP 1 #else