Improve NV14 CMake
This commit is contained in:
committed by
Raphael Coeffic
parent
f952c5f7c7
commit
1a918bf072
@@ -378,7 +378,7 @@ static void enablePulsesInternalModule(uint8_t protocol)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
#if defined(PXX1) && !defined(INTMODULE_USART)
|
#if defined(INTERNAL_MODULE_PXX1) && !defined(INTMODULE_USART)
|
||||||
case PROTOCOL_CHANNELS_PXX1_PULSES:
|
case PROTOCOL_CHANNELS_PXX1_PULSES:
|
||||||
intmodulePxx1PulsesStart();
|
intmodulePxx1PulsesStart();
|
||||||
#if defined(INTMODULE_HEARTBEAT)
|
#if defined(INTMODULE_HEARTBEAT)
|
||||||
@@ -388,14 +388,14 @@ static void enablePulsesInternalModule(uint8_t protocol)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX1) && defined(INTMODULE_USART)
|
#if defined(INTERNAL_MODULE_PXX1) && defined(INTMODULE_USART)
|
||||||
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
case PROTOCOL_CHANNELS_PXX1_SERIAL:
|
||||||
internalModuleContext = Pxx1InternalSerialDriver.init(INTERNAL_MODULE);
|
internalModuleContext = Pxx1InternalSerialDriver.init(INTERNAL_MODULE);
|
||||||
internalModuleDriver = &Pxx1InternalSerialDriver;
|
internalModuleDriver = &Pxx1InternalSerialDriver;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX2)
|
#if defined(INTERNAL_MODULE_PXX2)
|
||||||
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
|
case PROTOCOL_CHANNELS_PXX2_HIGHSPEED:
|
||||||
internalModuleContext = Pxx2InternalDriver.init(INTERNAL_MODULE);
|
internalModuleContext = Pxx2InternalDriver.init(INTERNAL_MODULE);
|
||||||
internalModuleDriver = &Pxx2InternalDriver;
|
internalModuleDriver = &Pxx2InternalDriver;
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ PACK(struct GhostPulsesData {
|
|||||||
});
|
});
|
||||||
|
|
||||||
union InternalModulePulsesData {
|
union InternalModulePulsesData {
|
||||||
#if defined(PXX1)
|
#if defined(INTERNAL_MODULE_PXX1)
|
||||||
#if defined(INTMODULE_USART)
|
#if defined(INTMODULE_USART)
|
||||||
UartPxx1Pulses pxx_uart;
|
UartPxx1Pulses pxx_uart;
|
||||||
#else
|
#else
|
||||||
@@ -156,19 +156,19 @@ union InternalModulePulsesData {
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(PXX2)
|
#if defined(INTERNAL_MODULE_PXX2)
|
||||||
Pxx2Pulses pxx2;
|
Pxx2Pulses pxx2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(INTMODULE_USART) && defined(AFHDS2)
|
#if defined(INTERNAL_MODULE_AFHDS2A)
|
||||||
FlySkySerialPulsesData flysky;
|
FlySkySerialPulsesData flysky;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MULTIMODULE)
|
#if defined(INTERNAL_MODULE_MULTI)
|
||||||
UartMultiPulses multi;
|
UartMultiPulses multi;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(CROSSFIRE)
|
#if defined(INTERNAL_MODULE_CRSF)
|
||||||
CrossfirePulsesData crossfire;
|
CrossfirePulsesData crossfire;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ template class Pxx1Pulses<StandardPxx1Transport<PwmPxxBitTransport> >;
|
|||||||
template class Pxx1Pulses<StandardPxx1Transport<SerialPxxBitTransport> >;
|
template class Pxx1Pulses<StandardPxx1Transport<SerialPxxBitTransport> >;
|
||||||
template class Pxx1Pulses<UartPxx1Transport>;
|
template class Pxx1Pulses<UartPxx1Transport>;
|
||||||
|
|
||||||
#if defined(INTMODULE_USART)
|
#if defined(INTMODULE_USART) && defined(INTERNAL_MODULE_PXX1)
|
||||||
#include "intmodule_serial_driver.h"
|
#include "intmodule_serial_driver.h"
|
||||||
|
|
||||||
static const etx_serial_init pxx1SerialInit = {
|
static const etx_serial_init pxx1SerialInit = {
|
||||||
|
|||||||
@@ -59,6 +59,16 @@ if(INTERNAL_MODULE_CRSF)
|
|||||||
add_definitions(-DINTERNAL_MODULE_SERIAL_TELEMETRY)
|
add_definitions(-DINTERNAL_MODULE_SERIAL_TELEMETRY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(INTERNAL_MODULE_AFHDS2A)
|
||||||
|
add_definitions(-DHARDWARE_INTERNAL_MODULE)
|
||||||
|
add_definitions(-DINTERNAL_MODULE_AFHDS2A)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(INTERNAL_MODULE_AFHDS3)
|
||||||
|
add_definitions(-DHARDWARE_INTERNAL_MODULE)
|
||||||
|
add_definitions(-DINTERNAL_MODULE_AFHDS3)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(INTERNAL_MODULE_PPM)
|
if(INTERNAL_MODULE_PPM)
|
||||||
add_definitions(-DHARDWARE_INTERNAL_MODULE)
|
add_definitions(-DHARDWARE_INTERNAL_MODULE)
|
||||||
add_definitions(-DINTERNAL_MODULE_PPM)
|
add_definitions(-DINTERNAL_MODULE_PPM)
|
||||||
@@ -217,7 +227,7 @@ if(MULTIMODULE OR AFHDS3)
|
|||||||
set(SRC ${SRC} telemetry/flysky_ibus.cpp)
|
set(SRC ${SRC} telemetry/flysky_ibus.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(AFHDS2)
|
if(AFHDS2 AND INTERNAL_MODULE_AFHDS2A)
|
||||||
add_definitions(-DAFHDS2)
|
add_definitions(-DAFHDS2)
|
||||||
set(SRC ${SRC} telemetry/flysky_nv14.cpp)
|
set(SRC ${SRC} telemetry/flysky_nv14.cpp)
|
||||||
set(PULSES_SRC ${PULSES_SRC} flysky.cpp)
|
set(PULSES_SRC ${PULSES_SRC} flysky.cpp)
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ set(HAPTIC YES)
|
|||||||
set(GUI_DIR colorlcd)
|
set(GUI_DIR colorlcd)
|
||||||
set(BITMAPS_DIR 480x272)
|
set(BITMAPS_DIR 480x272)
|
||||||
set(HARDWARE_EXTERNAL_MODULE YES)
|
set(HARDWARE_EXTERNAL_MODULE YES)
|
||||||
#set(AUX_SERIAL ON)
|
|
||||||
# set(NAVIGATION_TYPE touch)
|
|
||||||
set(TARGET_DIR nv14)
|
set(TARGET_DIR nv14)
|
||||||
add_definitions(-DHARDWARE_TRAINER_JACK)
|
add_definitions(-DHARDWARE_TRAINER_JACK)
|
||||||
|
|
||||||
@@ -46,13 +45,11 @@ set(PCB_RF_BAUD 921600 CACHE STRING "INTERNAL_MODULE_BAUDRATE: ${RF_BAUD_RATE}")
|
|||||||
set_property(CACHE PCB_RF_BAUD PROPERTY STRINGS ${RF_BAUD_RATE})
|
set_property(CACHE PCB_RF_BAUD PROPERTY STRINGS ${RF_BAUD_RATE})
|
||||||
|
|
||||||
set(FLAVOUR nv14)
|
set(FLAVOUR nv14)
|
||||||
#add_definitions(-DPCBNV14 -DPCBFLYSKY -DINTERNAL_MODULE_BAUDRATE=${PCB_RF_BAUD})
|
add_definitions(-DPCBNV14 -DPCBFLYSKY -DAFHDS2_BAUDRATE=${PCB_RF_BAUD})
|
||||||
add_definitions(-DPCBNV14 -DPCBFLYSKY -DINTERNAL_MODULE_SERIAL -DAFHDS2_BAUDRATE=${PCB_RF_BAUD})
|
add_definitions(-DBATTERY_CHARGE)
|
||||||
add_definitions(-DBATTERY_CHARGE) # -DSOFTWARE_VOLUME
|
|
||||||
add_definitions(-DINTERNAL_MODULE_AFHDS2A)
|
|
||||||
|
|
||||||
# defines existing internal modules
|
# defines existing internal modules
|
||||||
set(INTERNAL_MODULES AFHDS2A CACHE STRING "Internal modules")
|
set(INTERNAL_MODULES AFHDS2A AFHDS3 CACHE STRING "Internal modules")
|
||||||
set(DEFAULT_INTERNAL_MODULE FLYSKY CACHE STRING "Default internal module")
|
set(DEFAULT_INTERNAL_MODULE FLYSKY CACHE STRING "Default internal module")
|
||||||
|
|
||||||
set(BITMAPS_TARGET nv14_bitmaps)
|
set(BITMAPS_TARGET nv14_bitmaps)
|
||||||
@@ -75,11 +72,6 @@ add_definitions(
|
|||||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||||
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
||||||
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
add_definitions(-DPWR_BUTTON_${PWR_BUTTON})
|
||||||
add_definitions(-DCROSSFIRE_NATIVE)
|
|
||||||
add_definitions(-DAFHDS2)
|
|
||||||
add_definitions(-DHARDWARE_EXTERNAL_MODULE)
|
|
||||||
#add_definitions(-DAUX_SERIAL)
|
|
||||||
#add_definitions(-DFLYSKY_AUTO_POWER_DOWN)
|
|
||||||
|
|
||||||
if(STICKS_DEAD_ZONE)
|
if(STICKS_DEAD_ZONE)
|
||||||
add_definitions(-DSTICK_DEAD_ZONE)
|
add_definitions(-DSTICK_DEAD_ZONE)
|
||||||
@@ -94,9 +86,7 @@ if(STICKS_DEAD_ZONE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(AFHDS2 ON)
|
set(AFHDS2 ON)
|
||||||
|
set(AFHDS3 ON)
|
||||||
# disable for now as it crashes on radio
|
|
||||||
#set(AFHDS3 ON)
|
|
||||||
|
|
||||||
# VCP CLI
|
# VCP CLI
|
||||||
set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")
|
set(ENABLE_SERIAL_PASSTHROUGH ON CACHE BOOL "Enable serial passthrough")
|
||||||
|
|||||||
@@ -399,7 +399,6 @@
|
|||||||
#define FLYSKY_HALL_TX_DMA_Stream_IRQHandler DMA1_Stream4_IRQHandler
|
#define FLYSKY_HALL_TX_DMA_Stream_IRQHandler DMA1_Stream4_IRQHandler
|
||||||
|
|
||||||
// Internal Module
|
// Internal Module
|
||||||
#define HARDWARE_INTERNAL_MODULE
|
|
||||||
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_DMA1)
|
#define INTMODULE_RCC_AHB1Periph (RCC_AHB1Periph_GPIOF | RCC_AHB1Periph_GPIOH | RCC_AHB1Periph_DMA1)
|
||||||
#define INTMODULE_PWR_GPIO GPIOH
|
#define INTMODULE_PWR_GPIO GPIOH
|
||||||
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_9 // PH.09
|
#define INTMODULE_PWR_GPIO_PIN GPIO_Pin_9 // PH.09
|
||||||
|
|||||||
Reference in New Issue
Block a user