From 67bde984595ce8dfab7ab7d54594d61d7da73a30 Mon Sep 17 00:00:00 2001 From: jflyper Date: Sat, 22 Sep 2018 12:12:29 +0900 Subject: [PATCH] Move board specific to config.c --- src/main/target/SPRACINGF7DUAL/config.c | 13 ++++++++++--- src/main/target/SPRACINGF7DUAL/target.h | 2 -- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/target/SPRACINGF7DUAL/config.c b/src/main/target/SPRACINGF7DUAL/config.c index 61200984c9..96e96a2418 100644 --- a/src/main/target/SPRACINGF7DUAL/config.c +++ b/src/main/target/SPRACINGF7DUAL/config.c @@ -55,13 +55,20 @@ #include "config_helper.h" +#define GPS_UART SERIAL_PORT_USART3 #define TELEMETRY_UART SERIAL_PORT_UART5 -#ifdef USE_TELEMETRY static targetSerialPortFunction_t targetSerialPortFunction[] = { - { TELEMETRY_UART, FUNCTION_TELEMETRY_SMARTPORT }, -}; +#ifdef USE_GPS + { GPS_UART, FUNCTION_GPS }, #endif +#ifdef USE_TELEMETRY + { TELEMETRY_UART, FUNCTION_TELEMETRY_SMARTPORT }, +#endif +#if !defined(USE_GPS) && !defined(USE_TELEMETRY) + { SERIAL_PORT_NONE, FUNCTION_NONE }, +#endif +}; void targetConfiguration(void) { diff --git a/src/main/target/SPRACINGF7DUAL/target.h b/src/main/target/SPRACINGF7DUAL/target.h index 5535d165c7..e5ba4ca4e1 100644 --- a/src/main/target/SPRACINGF7DUAL/target.h +++ b/src/main/target/SPRACINGF7DUAL/target.h @@ -208,8 +208,6 @@ #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL #define DEFAULT_FEATURES (FEATURE_TRANSPONDER | FEATURE_RSSI_ADC | FEATURE_TELEMETRY | FEATURE_OSD | FEATURE_LED_STRIP) -#define GPS_UART SERIAL_PORT_USART3 - #define SERIALRX_UART SERIAL_PORT_USART2 #define SERIALRX_PROVIDER SERIALRX_SBUS