Compilation options updated

This commit is contained in:
Bertrand Songis
2019-05-15 15:56:52 +02:00
parent 5b54df8140
commit 4bdd76a214
15 changed files with 77 additions and 38 deletions
+3 -3
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);
}
+6 -4
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);
}
topbar->load();
if (topbar) {
topbar->load();
}
}
+4 -5
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)
+1 -1
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) ||
+1 -1
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);
+1 -1
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));
+1 -1
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);
@@ -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
-1
View File
@@ -15,7 +15,6 @@ set(SIMU_SRC
simueeprom.cpp
simufatfs.cpp
simudisk.cpp
)
if(SIMU_DISKIO)
+8 -3
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)
+1 -1
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);
+2 -2
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
@@ -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()
{
+2 -2
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();
}