From 0774567df78d4534b8d03a1a1b1cd254af583393 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Thu, 16 May 2019 14:50:23 +0200 Subject: [PATCH] Revert "Compilation options updated" This reverts commit 68a9edc8 --- companion/src/firmwares/opentx/opentxinterface.cpp | 1 + radio/src/gui/gui_common.cpp | 2 +- radio/src/targets/taranis/CMakeLists.txt | 5 +++++ radio/src/targets/taranis/hal.h | 3 +++ radio/util/fwoptions.py | 4 +++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/companion/src/firmwares/opentx/opentxinterface.cpp b/companion/src/firmwares/opentx/opentxinterface.cpp index 31fe94e98..eac802f48 100644 --- a/companion/src/firmwares/opentx/opentxinterface.cpp +++ b/companion/src/firmwares/opentx/opentxinterface.cpp @@ -1207,6 +1207,7 @@ void registerOpenTxFirmwares() /* FrSky X-Lite S/PRO board */ firmware = new OpenTxFirmware("opentx-xlites", QCoreApplication::translate("Firmware", "FrSky Taranis X-Lite S/PRO"), BOARD_TARANIS_XLITES); addOpenTxTaranisOptions(firmware); + firmware->addOption("internalpxx1", Firmware::tr("Support for PXX1 internal module replacement")); registerOpenTxFirmware(firmware); /* FrSky X-Lite board */ diff --git a/radio/src/gui/gui_common.cpp b/radio/src/gui/gui_common.cpp index cb024c839..9df9addf5 100644 --- a/radio/src/gui/gui_common.cpp +++ b/radio/src/gui/gui_common.cpp @@ -568,7 +568,7 @@ bool isInternalModuleAvailable(int moduleType) if (moduleType == MODULE_TYPE_NONE) return true; -#if defined(PXX1) +#if defined(PXX1) && defined(INTERNAL_MODULE_PXX1) if (moduleType == MODULE_TYPE_PXX_XJT) return !isModuleUSingSport(EXTERNAL_MODULE, g_model.moduleData[EXTERNAL_MODULE].type); #else diff --git a/radio/src/targets/taranis/CMakeLists.txt b/radio/src/targets/taranis/CMakeLists.txt index 6da864db2..03fff3ef9 100644 --- a/radio/src/targets/taranis/CMakeLists.txt +++ b/radio/src/targets/taranis/CMakeLists.txt @@ -1,6 +1,7 @@ option(SHUTDOWN_CONFIRMATION "Shutdown confirmation" OFF) option(LCD_DUAL_BUFFER "Dual LCD Buffer" OFF) option(INTERNAL_MODULE_PPM "Support for PPM internal module hack" OFF) +option(INTERNAL_MODULE_PXX1 "Support for PXX1 internal module replacement" OFF) option(USEHORUSBT "X9E BT module replaced by Horus BT module" OFF) option(PXX1 "PXX1 protocol support" ON) option(PXX2 "PXX2 protocol support" ON) @@ -273,6 +274,10 @@ if(INTERNAL_MODULE_PPM) add_definitions(-DINTERNAL_MODULE_PPM) endif() +if(INTERNAL_MODULE_PXX1) + add_definitions(-DINTERNAL_MODULE_PXX1) +endif() + if(USEHORUSBT) add_definitions(-DUSEHORUSBT) endif(USEHORUSBT) diff --git a/radio/src/targets/taranis/hal.h b/radio/src/targets/taranis/hal.h index 35e0f5e27..0dee931ca 100644 --- a/radio/src/targets/taranis/hal.h +++ b/radio/src/targets/taranis/hal.h @@ -702,6 +702,9 @@ // Internal Module #define HARDWARE_INTERNAL_MODULE +#if !(defined(PCBXLITES) && !defined(PCBX9LITE)) + #define INTERNAL_MODULE_PXX1 +#endif #if defined(PCBXLITE) || defined(PCBX9LITE) #define INTMODULE_RCC_APB1Periph RCC_APB1Periph_TIM3 #define INTMODULE_RCC_APB2Periph RCC_APB2Periph_USART1 diff --git a/radio/util/fwoptions.py b/radio/util/fwoptions.py index 94a4c2dcf..997946f99 100755 --- a/radio/util/fwoptions.py +++ b/radio/util/fwoptions.py @@ -113,7 +113,8 @@ options_taranis_x9lite = { "nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"), "shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"), "eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"), - "multimodule": ("MULTIMODULE", "YES", "NO") + "multimodule": ("MULTIMODULE", "YES", "NO"), + "internalpxx1": ("INTERNAL_MODULE_PXX1", "NO", "YES"), } options_taranis_xlite = { @@ -144,6 +145,7 @@ options_taranis_xlites = { "shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"), "eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"), "multimodule": ("MULTIMODULE", "YES", "NO"), + "internalpxx1": ("INTERNAL_MODULE_PXX1", "NO", "YES"), } options_taranis_x9e = {