1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 20:10:08 +03:00

#1876 - Radio identifier added inside the firmware - it will help

Companion to recognize the radio type and avoid to flash a wrong
firmware.
Conflicts:
	radio/src/Makefile
This commit is contained in:
bsongis 2015-01-01 00:42:15 +01:00
parent c27392b454
commit 40f496e7fb
7 changed files with 36 additions and 22 deletions

View file

@ -49,6 +49,7 @@
#define FAI_CHOICE
#define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3

View file

@ -49,6 +49,7 @@
#define DSM2
#define DSM2_PPM
#define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "9x128"
#define EEPROM_VARIANT SIMU_M128_VARIANTS
#define GAUGES

View file

@ -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

View file

@ -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

View file

@ -55,8 +55,8 @@
#define HAPTIC
#define REVPLUS
#define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 5
#define FLAVOUR "taranis-plus"
#undef min
#undef max

View file

@ -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
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

View file

@ -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;