diff --git a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp index 3edf3a2af..e1dd2d5d0 100644 --- a/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxGruvin9xsimulator.cpp @@ -49,6 +49,7 @@ #define FAI_CHOICE #define FRSKY_STICKS #define OVERRIDE_CHANNEL_FUNCTION +#define FLAVOUR "gruvin9x" #define EEPROM_VARIANT 3 diff --git a/companion/src/firmwares/opentx/opentxM128simulator.cpp b/companion/src/firmwares/opentx/opentxM128simulator.cpp index 6df8d70d2..5a5ea43a7 100644 --- a/companion/src/firmwares/opentx/opentxM128simulator.cpp +++ b/companion/src/firmwares/opentx/opentxM128simulator.cpp @@ -49,6 +49,7 @@ #define DSM2 #define DSM2_PPM #define OVERRIDE_CHANNEL_FUNCTION +#define FLAVOUR "9x128" #define EEPROM_VARIANT SIMU_M128_VARIANTS #define GAUGES diff --git a/companion/src/firmwares/opentx/opentxM64simulator.cpp b/companion/src/firmwares/opentx/opentxM64simulator.cpp index fe233e03c..abc0007da 100644 --- a/companion/src/firmwares/opentx/opentxM64simulator.cpp +++ b/companion/src/firmwares/opentx/opentxM64simulator.cpp @@ -52,10 +52,9 @@ #define FRSKY_STICKS #define OVERRIDE_CHANNEL_FUNCTION #define FAS_OFFSET - #define EEPROM_VARIANT SIMU_STOCK_VARIANTS #define GAUGES - +#define FLAVOUR "9x" #define NUM_POTS 3 #undef min diff --git a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp index 0c8d3fbd4..4f5da3d0c 100644 --- a/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp +++ b/companion/src/firmwares/opentx/opentxSky9xsimulator.cpp @@ -55,9 +55,9 @@ #define FAI_CHOICE #define FRSKY_STICKS #define OVERRIDE_CHANNEL_FUNCTION - #define NUM_POTS 3 #define EEPROM_VARIANT 3 +#define FLAVOUR "sky9x" #undef min #undef max diff --git a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp index 6a1e260d7..ac52dd795 100644 --- a/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp +++ b/companion/src/firmwares/opentx/opentxTaranisSimulator.cpp @@ -55,8 +55,8 @@ #define HAPTIC #define REVPLUS #define OVERRIDE_CHANNEL_FUNCTION - #define NUM_POTS 5 +#define FLAVOUR "taranis-plus" #undef min #undef max diff --git a/radio/src/Makefile b/radio/src/Makefile index 43be11d18..096492c3d 100644 --- a/radio/src/Makefile +++ b/radio/src/Makefile @@ -386,8 +386,10 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR)) PULSESSRC = pulses/pulses_avr.cpp ifeq ($(PCB), 9XR) + FLAVOUR = 9xr CPPDEFS += -DPCB9XR else + FLAVOUR = 9x CPPDEFS += -DPCB9X endif @@ -451,8 +453,10 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128)) PULSESSRC = pulses/pulses_avr.cpp ifeq ($(PCB), 9XR128) + FLAVOUR = 9xr128 CPPDEFS += -DPCB9XR128 else + FLAVOUR = 9x128 CPPDEFS += -DPCB9X128 endif @@ -512,8 +516,10 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561)) PULSESSRC = pulses/pulses_avr.cpp ifeq ($(PCB), 9XR2561) + FLAVOUR = 9xr2561 CPPDEFS += -DPCB9XR2561 else + FLAVOUR = 9x2561 CPPDEFS += -DPCB9X2561 endif @@ -552,6 +558,7 @@ endif ifeq ($(PCB), GRUVIN9X) # 9x radio with a gruvin9x replacement board + FLAVOUR = gruvin9x ARCH = AVR LCDSIZE = 128 ifeq ($(PCBREV), REV0) @@ -599,6 +606,7 @@ endif ifeq ($(PCB), MEGA2560) # ARDUINO2560 DIY RADIO + FLAVOUR = mega2560 ARCH = AVR LCDSIZE = 128 TRGT = avr- @@ -650,17 +658,21 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO)) LCDSIZE = 128 CPPDEFS = -Dat91sam3s4 ifeq ($(PCB), 9XRPRO) + FLAVOUR = 9xrpro CPPDEFS += -DREVX LDSCRIPT = targets/sky9x/sam3s8c_flash.ld else ifeq ($(PCBREV), REVA) + FLAVOUR = sky9x CPPDEFS += -DREVA LDSCRIPT = targets/sky9x/sam3s2c_flash.ld CPPSRC += targets/sky9x/coproc_driver.cpp else ifeq ($(PCBREV), REVB) + FLAVOUR = sky9x CPPDEFS += -DREVB -DCOPROCESSOR LDSCRIPT = targets/sky9x/sam3s4c_flash.ld CPPSRC += targets/sky9x/coproc_driver.cpp else + FLAVOUR = sky9x CPPDEFS += -DREVC -DCOPROCESSOR LDSCRIPT = targets/sky9x/sam3s4c_flash.ld CPPSRC += targets/sky9x/coproc_driver.cpp @@ -723,29 +735,29 @@ ifeq ($(PCB), TARANIS) # TARANIS radio ARCH = ARM LCDSIZE = 212 - ifeq ($(PCBREV), REV3) - CPPDEFS = -DREV3 - SWR = YES - else ifeq ($(PCBREV), REV4a) - CPPDEFS = -DREV4a - SWR = YES - else ifeq ($(PCBREV), REVPLUS) - CPPDEFS = -DREVPLUS - ifeq ($(LCD_DUAL_BUFFER), YES) - CPPDEFS += -DLCD_DUAL_BUFFER - endif - HAPTIC = YES - SWR = NO - else ifeq ($(PCBREV), REV9E) + ifeq ($(PCBREV), REV9E) + FLAVOUR = taranis-x9e CPPDEFS = -DREVPLUS -DREV9E ifeq ($(LCD_DUAL_BUFFER), YES) - CPPDEFS += -DLCD_DUAL_BUFFER + CPPDEFS += -DLCD_DUAL_BUFFER endif HAPTIC = YES - SWR = YES + else ifeq ($(PCBREV), REVPLUS) + FLAVOUR = taranis-plus + CPPDEFS = -DREVPLUS + ifeq ($(LCD_DUAL_BUFFER), YES) + CPPDEFS += -DLCD_DUAL_BUFFER + endif + HAPTIC = YES + else ifeq ($(PCBREV), REV3) + FLAVOUR = taranis + CPPDEFS = -DREV3 + else ifeq ($(PCBREV), REV4a) + FLAVOUR = taranis + CPPDEFS = -DREV4a else + FLAVOUR = taranis CPPDEFS = -DREV4 - SWR = YES endif ifeq ($(SPORT_FILE_LOG), YES) CPPDEFS += -DSPORT_FILE_LOG @@ -1264,6 +1276,7 @@ MSG_CLEANING = Cleaning project: # Combine all necessary flags and optional flags. # Add target processor to flags. +CPPFLAGS += -DFLAVOUR=\"$(FLAVOUR)\" ARMCPPFLAGS = -c -mcpu=$(MCU) -mthumb -fomit-frame-pointer -fverbose-asm -Wa,-ahlms=opentx.lst -DRUN_FROM_FLASH=1 -O$(OPT) $(CPPFLAGS) -fdata-sections -ffunction-sections $(INCFLAGS) $(EXTRAINCFLAGS) $(GENDEPFLAGS) AVRCPPFLAGS = -mmcu=$(MCU) -I. -x c++ -O$(OPT) $(CPPFLAGS) $(INCFLAGS) $(EXTRAINCFLAGS) $(GENDEPFLAGS) -fwhole-program diff --git a/radio/src/stamp.cpp b/radio/src/stamp.cpp index f4dec0b66..8cd446cfb 100644 --- a/radio/src/stamp.cpp +++ b/radio/src/stamp.cpp @@ -46,4 +46,4 @@ #define EEPROM_STR DEFNUMSTR(EEPROM_VER); #endif -const pm_char vers_stamp[] PROGMEM = "VERS\037\033: " VERS_STR "\036DATE\037\033: " DATE_STR"\036TIME\037\033: " TIME_STR "\036EEPR\037\033: " EEPROM_STR; +const pm_char vers_stamp[] PROGMEM = "VERS\037\033: " "opentx-" FLAVOUR "-" VERS_STR "\036DATE\037\033: " DATE_STR"\036TIME\037\033: " TIME_STR "\036EEPR\037\033: " EEPROM_STR;