1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-24 00:35:14 +03:00

Compilation options updated

This commit is contained in:
Bertrand Songis 2019-05-15 15:56:09 +02:00
parent 5b54df8140
commit 4bdd76a214
15 changed files with 77 additions and 38 deletions

View file

@ -233,7 +233,7 @@ int getSwitchWarningsCount()
}
#define IF_INTERNAL_MODULE_ON(x) (IS_INTERNAL_MODULE_ENABLED() ? (uint8_t)(x) : HIDDEN_ROW)
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
#define INTERNAL_MODULE_MODE_ROWS (isModuleXJT(INTERNAL_MODULE) ? (uint8_t)1 : (uint8_t)0) // Module type + RF protocols
#else
#define INTERNAL_MODULE_MODE_ROWS 0 // (OFF / RF protocols)
@ -666,7 +666,7 @@ void menuModelSetup(event_t event)
lcdDrawTextAlignedLeft(y, TR_INTERNALRF);
break;
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
case ITEM_MODEL_INTERNAL_MODULE_MODE:
lcdDrawTextAlignedLeft(y, STR_MODE);
lcdDrawTextAtIndex(MODEL_SETUP_2ND_COLUMN, y, STR_MODULE_PROTOCOLS, g_model.moduleData[INTERNAL_MODULE].type, menuHorizontalPosition==0 ? attr : 0);
@ -919,7 +919,7 @@ void menuModelSetup(event_t event)
break;
case 1:
CHECK_INCDEC_MODELVAR(event, moduleData.channelsCount, -4, min<int8_t>(maxModuleChannels_M8(moduleIdx), 32-8-moduleData.channelsStart));
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
if ((k == ITEM_MODEL_EXTERNAL_MODULE_CHANNELS && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) || (k == ITEM_MODEL_INTERNAL_MODULE_CHANNELS && g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_PPM) || (k == ITEM_MODEL_TRAINER_LINE1)) {
SET_DEFAULT_PPM_FRAME_LENGTH(moduleIdx);
}

View file

@ -40,7 +40,7 @@ const LayoutFactory * getLayoutFactory(const char * name)
return (*it);
}
}
return NULL;
return nullptr;
}
Layout * loadLayout(const char * name, Layout::PersistentData * persistentData)
@ -49,7 +49,7 @@ Layout * loadLayout(const char * name, Layout::PersistentData * persistentData)
if (factory) {
return factory->load(persistentData);
}
return NULL;
return nullptr;
}
void loadCustomScreens()
@ -62,9 +62,11 @@ void loadCustomScreens()
customScreens[i] = loadLayout(name, &g_model.screenData[i].layoutData);
}
if (customScreens[0] == NULL && getRegisteredLayouts().size()) {
if (customScreens[0] == nullptr && getRegisteredLayouts().size()) {
customScreens[0] = getRegisteredLayouts().front()->create(&g_model.screenData[0].layoutData);
}
if (topbar) {
topbar->load();
}
}

View file

@ -568,13 +568,12 @@ 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)
#if defined(INTMODULE_NO_PXX1)
return false;
return !isModuleUSingSport(EXTERNAL_MODULE, g_model.moduleData[EXTERNAL_MODULE].type);
#else
return (!isModuleUSingSport(EXTERNAL_MODULE, g_model.moduleData[EXTERNAL_MODULE].type));
#endif
if (moduleType == MODULE_TYPE_PXX_XJT)
return false;
#endif
#if defined(PXX2)

View file

@ -88,7 +88,7 @@ inline bool isExtraModule(uint8_t)
}
#endif
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
inline bool isModulePPM(uint8_t idx)
{
return (idx == INTERNAL_MODULE && g_model.moduleData[INTERNAL_MODULE].type == MODULE_TYPE_PPM) ||

View file

@ -65,7 +65,7 @@ void setupPulsesPPMTrainer()
setupPulsesPPM<trainer_pulse_duration_t>(&trainerPulsesData.ppm, g_model.trainerData.channelsStart, g_model.trainerData.channelsCount, g_model.trainerData.frameLength);
}
#if defined(PCBTARANIS) && defined(TARANIS_INTERNAL_PPM)
#if defined(PCBTARANIS) && defined(INTERNAL_MODULE_PPM)
void setupPulsesPPMInternalModule()
{
setupPulsesPPM(&intmodulePulsesData.ppm, g_model.moduleData[INTERNAL_MODULE].channelsStart, g_model.moduleData[INTERNAL_MODULE].channelsCount, g_model.moduleData[INTERNAL_MODULE].ppm.frameLength);

View file

@ -267,7 +267,7 @@ void setupPulsesInternalModule(uint8_t protocol)
break;
#endif
#if defined(PCBTARANIS) && defined(TARANIS_INTERNAL_PPM)
#if defined(PCBTARANIS) && defined(INTERNAL_MODULE_PPM)
case PROTOCOL_CHANNELS_PPM:
setupPulsesPPM(&extmodulePulsesData.ppm, g_model.moduleData[INTERNAL_MODULE].channelsStart, g_model.moduleData[INTERNAL_MODULE].channelsCount, g_model.moduleData[INTERNAL_MODULE].ppm.frameLength);
scheduleNextMixerCalculation(INTERNAL_MODULE, PPM_PERIOD(INTERNAL_MODULE));

View file

@ -256,7 +256,7 @@ union InternalModulePulsesData {
Pxx2Pulses pxx2;
#endif
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
PpmPulsesData<pulse_duration_t> ppm;
#endif
} __ALIGNED(4);

View file

@ -146,6 +146,7 @@ uint8_t serial2TracesEnabled()
#endif
}
#if !defined(SIMU)
extern "C" void SERIAL_USART_IRQHandler(void)
{
DEBUG_INTERRUPT(INT_SER2);
@ -179,3 +180,4 @@ extern "C" void SERIAL_USART_IRQHandler(void)
}
#endif
}
#endif

View file

@ -15,7 +15,6 @@ set(SIMU_SRC
simueeprom.cpp
simufatfs.cpp
simudisk.cpp
)
if(SIMU_DISKIO)

View file

@ -1,6 +1,7 @@
option(SHUTDOWN_CONFIRMATION "Shutdown confirmation" OFF)
option(LCD_DUAL_BUFFER "Dual LCD Buffer" OFF)
option(TARANIS_INTERNAL_PPM "Taranis internal module hack to output PPM" OFF)
option(INTERNAL_MODULE_PPM "Taranis internal module hack to output PPM" OFF)
option(INTERNAL_MODULE_PXX1 "Taranis internal module hack to output PXX1" OFF)
option(USEHORUSBT "X9E BT module replaced by Horus BT module" OFF)
option(PXX1 "PXX1 protocol support" ON)
option(PXX2 "PXX2 protocol support" ON)
@ -269,8 +270,12 @@ if(LCD_DUAL_BUFFER)
add_definitions(-DLCD_DUAL_BUFFER)
endif()
if(TARANIS_INTERNAL_PPM)
add_definitions(-DTARANIS_INTERNAL_PPM)
if(INTERNAL_MODULE_PPM)
add_definitions(-DINTERNAL_MODULE_PPM)
endif()
if(INTERNAL_MODULE_PXX1)
add_definitions(-DINTERNAL_MODULE_PXX1)
endif()
if(USEHORUSBT)

View file

@ -198,7 +198,7 @@ void disable_serial(uint8_t module);
void intmoduleStop();
void intmodulePxxStart();
void intmoduleSerialStart(uint32_t baudrate, uint8_t rxEnable);
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
void intmodulePpmStart(void);
#endif
void intmoduleSendBuffer(const uint8_t * data, uint8_t size);

View file

@ -702,8 +702,8 @@
// Internal Module
#define HARDWARE_INTERNAL_MODULE
#if defined(PCBXLITES) || defined(PCBX9LITE)
#define INTMODULE_NO_PXX1
#if !(defined(PCBXLITES) && !defined(PCBX9LITE))
#define INTERNAL_MODULE_PXX1
#endif
#if defined(PCBXLITE) || defined(PCBX9LITE)
#define INTMODULE_RCC_APB1Periph RCC_APB1Periph_TIM3

View file

@ -47,7 +47,7 @@ void intmoduleSendNextFrame()
break;
#endif
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
case PROTOCOL_CHANNELS_PPM:
INTMODULE_TIMER->CCR3 = GET_MODULE_PPM_DELAY(INTERNAL_MODULE) * 2;
INTMODULE_TIMER->CCER = TIM_CCER_CC3E | (GET_MODULE_PPM_POLARITY(INTERNAL_MODULE) ? 0 : TIM_CCER_CC3P);
@ -107,7 +107,7 @@ void intmodulePxxStart()
NVIC_SetPriority(INTMODULE_TIMER_CC_IRQn, 7);
}
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
void intmodulePpmStart()
{
INTERNAL_MODULE_ON();
@ -139,7 +139,7 @@ void intmodulePpmStart()
NVIC_EnableIRQ(INTMODULE_TIMER_CC_IRQn);
NVIC_SetPriority(INTMODULE_TIMER_CC_IRQn, 7);
}
#endif // defined(TARANIS_INTERNAL_PPM)
#endif // defined(INTERNAL_MODULE_PPM)
extern "C" void INTMODULE_DMA_STREAM_IRQHandler()
{

View file

@ -86,7 +86,7 @@ void init_ppm(uint8_t module)
if (module == EXTERNAL_MODULE) {
extmodulePpmStart();
}
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
else {
intmodulePpmStart();
}
@ -98,7 +98,7 @@ void disable_ppm(uint8_t module)
if (module == EXTERNAL_MODULE) {
extmoduleStop();
}
#if defined(TARANIS_INTERNAL_PPM)
#if defined(INTERNAL_MODULE_PPM)
else {
intmoduleStop();
}

View file

@ -66,7 +66,7 @@ options_ar9x = {
"flexr9m": ("MODULE_R9M_FLEX_FW", "YES", None)
}
options_taranis = {
options_taranis_x9d = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
@ -77,13 +77,13 @@ options_taranis = {
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"internalppm": ("TARANIS_INTERNAL_PPM", "YES", "NO"),
"internalppm": ("INTERNAL_MODULE_PPM", "YES", "NO"),
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"multimodule": ("MULTIMODULE", "YES", "NO"),
}
options_taranisplus = {
options_taranis_x9dp = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
@ -94,13 +94,45 @@ options_taranisplus = {
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"internalppm": ("TARANIS_INTERNAL_PPM", "YES", "NO"),
"internalppm": ("INTERNAL_MODULE_PPM", "YES", "NO"),
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"multimodule": ("MULTIMODULE", "YES", "NO"),
}
options_xlite = {
options_taranis_x9lite = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
"luac": ("LUA_COMPILER", "YES", "NO"),
"nogvars": ("GVARS", "NO", "YES"),
"sqt5font": ("FONT", "SQT5", None),
"noras": ("RAS", "NO", "YES"),
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"multimodule": ("MULTIMODULE", "YES", "NO"),
"internalpxx1": ("INTERNAL_MODULE_PXX1", "NO", "YES"),
}
options_taranis_xlite = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
"luac": ("LUA_COMPILER", "YES", "NO"),
"nogvars": ("GVARS", "NO", "YES"),
"sqt5font": ("FONT", "SQT5", None),
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"multimodule": ("MULTIMODULE", "YES", "NO")
}
options_taranis_xlites = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
@ -113,10 +145,10 @@ options_xlite = {
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"multimodule": ("MULTIMODULE", "YES", "NO"),
"stdr9m": ("MODULE_R9M_FULLSIZE", "YES", None),
"internalpxx1": ("INTERNAL_MODULE_PXX1", "NO", "YES"),
}
options_taranisx9e = {
options_taranis_x9e = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
@ -126,14 +158,14 @@ options_taranisx9e = {
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"internalppm": ("TARANIS_INTERNAL_PPM", "YES", "NO"),
"internalppm": ("INTERNAL_MODULE_PPM", "YES", "NO"),
"shutdownconfirm": ("SHUTDOWN_CONFIRMATION", "YES", "NO"),
"eu": ("SUPPORT_D16_EU_ONLY", "YES", "NO"),
"horussticks": ("STICKS", "HORUS", "STANDARD"),
"multimodule": ("MULTIMODULE", "YES", "NO"),
}
options_x12s = {
options_horus_x12s = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),
@ -147,7 +179,7 @@ options_x12s = {
"pcbdev": ("PCBREV", "10", None),
}
options_x10 = {
options_horus_x10 = {
"noheli": ("HELI", "NO", "YES"),
"ppmus": ("PPM_UNIT", "US", "PERCENT_PREC1"),
"lua": ("LUA", "YES", "NO_MODEL_SCRIPTS"),