1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 11:59:50 +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 FAI_CHOICE
#define FRSKY_STICKS #define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION #define OVERRIDE_CHANNEL_FUNCTION
#define FLAVOUR "gruvin9x"
#define EEPROM_VARIANT 3 #define EEPROM_VARIANT 3

View file

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

View file

@ -52,10 +52,9 @@
#define FRSKY_STICKS #define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION #define OVERRIDE_CHANNEL_FUNCTION
#define FAS_OFFSET #define FAS_OFFSET
#define EEPROM_VARIANT SIMU_STOCK_VARIANTS #define EEPROM_VARIANT SIMU_STOCK_VARIANTS
#define GAUGES #define GAUGES
#define FLAVOUR "9x"
#define NUM_POTS 3 #define NUM_POTS 3
#undef min #undef min

View file

@ -55,9 +55,9 @@
#define FAI_CHOICE #define FAI_CHOICE
#define FRSKY_STICKS #define FRSKY_STICKS
#define OVERRIDE_CHANNEL_FUNCTION #define OVERRIDE_CHANNEL_FUNCTION
#define NUM_POTS 3 #define NUM_POTS 3
#define EEPROM_VARIANT 3 #define EEPROM_VARIANT 3
#define FLAVOUR "sky9x"
#undef min #undef min
#undef max #undef max

View file

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

View file

@ -386,8 +386,10 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR))
PULSESSRC = pulses/pulses_avr.cpp PULSESSRC = pulses/pulses_avr.cpp
ifeq ($(PCB), 9XR) ifeq ($(PCB), 9XR)
FLAVOUR = 9xr
CPPDEFS += -DPCB9XR CPPDEFS += -DPCB9XR
else else
FLAVOUR = 9x
CPPDEFS += -DPCB9X CPPDEFS += -DPCB9X
endif endif
@ -451,8 +453,10 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128))
PULSESSRC = pulses/pulses_avr.cpp PULSESSRC = pulses/pulses_avr.cpp
ifeq ($(PCB), 9XR128) ifeq ($(PCB), 9XR128)
FLAVOUR = 9xr128
CPPDEFS += -DPCB9XR128 CPPDEFS += -DPCB9XR128
else else
FLAVOUR = 9x128
CPPDEFS += -DPCB9X128 CPPDEFS += -DPCB9X128
endif endif
@ -512,8 +516,10 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561))
PULSESSRC = pulses/pulses_avr.cpp PULSESSRC = pulses/pulses_avr.cpp
ifeq ($(PCB), 9XR2561) ifeq ($(PCB), 9XR2561)
FLAVOUR = 9xr2561
CPPDEFS += -DPCB9XR2561 CPPDEFS += -DPCB9XR2561
else else
FLAVOUR = 9x2561
CPPDEFS += -DPCB9X2561 CPPDEFS += -DPCB9X2561
endif endif
@ -552,6 +558,7 @@ endif
ifeq ($(PCB), GRUVIN9X) ifeq ($(PCB), GRUVIN9X)
# 9x radio with a gruvin9x replacement board # 9x radio with a gruvin9x replacement board
FLAVOUR = gruvin9x
ARCH = AVR ARCH = AVR
LCDSIZE = 128 LCDSIZE = 128
ifeq ($(PCBREV), REV0) ifeq ($(PCBREV), REV0)
@ -599,6 +606,7 @@ endif
ifeq ($(PCB), MEGA2560) ifeq ($(PCB), MEGA2560)
# ARDUINO2560 DIY RADIO # ARDUINO2560 DIY RADIO
FLAVOUR = mega2560
ARCH = AVR ARCH = AVR
LCDSIZE = 128 LCDSIZE = 128
TRGT = avr- TRGT = avr-
@ -650,17 +658,21 @@ ifeq ($(PCB), $(filter $(PCB), SKY9X 9XRPRO))
LCDSIZE = 128 LCDSIZE = 128
CPPDEFS = -Dat91sam3s4 CPPDEFS = -Dat91sam3s4
ifeq ($(PCB), 9XRPRO) ifeq ($(PCB), 9XRPRO)
FLAVOUR = 9xrpro
CPPDEFS += -DREVX CPPDEFS += -DREVX
LDSCRIPT = targets/sky9x/sam3s8c_flash.ld LDSCRIPT = targets/sky9x/sam3s8c_flash.ld
else ifeq ($(PCBREV), REVA) else ifeq ($(PCBREV), REVA)
FLAVOUR = sky9x
CPPDEFS += -DREVA CPPDEFS += -DREVA
LDSCRIPT = targets/sky9x/sam3s2c_flash.ld LDSCRIPT = targets/sky9x/sam3s2c_flash.ld
CPPSRC += targets/sky9x/coproc_driver.cpp CPPSRC += targets/sky9x/coproc_driver.cpp
else ifeq ($(PCBREV), REVB) else ifeq ($(PCBREV), REVB)
FLAVOUR = sky9x
CPPDEFS += -DREVB -DCOPROCESSOR CPPDEFS += -DREVB -DCOPROCESSOR
LDSCRIPT = targets/sky9x/sam3s4c_flash.ld LDSCRIPT = targets/sky9x/sam3s4c_flash.ld
CPPSRC += targets/sky9x/coproc_driver.cpp CPPSRC += targets/sky9x/coproc_driver.cpp
else else
FLAVOUR = sky9x
CPPDEFS += -DREVC -DCOPROCESSOR CPPDEFS += -DREVC -DCOPROCESSOR
LDSCRIPT = targets/sky9x/sam3s4c_flash.ld LDSCRIPT = targets/sky9x/sam3s4c_flash.ld
CPPSRC += targets/sky9x/coproc_driver.cpp CPPSRC += targets/sky9x/coproc_driver.cpp
@ -723,29 +735,29 @@ ifeq ($(PCB), TARANIS)
# TARANIS radio # TARANIS radio
ARCH = ARM ARCH = ARM
LCDSIZE = 212 LCDSIZE = 212
ifeq ($(PCBREV), REV3) ifeq ($(PCBREV), REV9E)
CPPDEFS = -DREV3 FLAVOUR = taranis-x9e
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)
CPPDEFS = -DREVPLUS -DREV9E CPPDEFS = -DREVPLUS -DREV9E
ifeq ($(LCD_DUAL_BUFFER), YES) ifeq ($(LCD_DUAL_BUFFER), YES)
CPPDEFS += -DLCD_DUAL_BUFFER CPPDEFS += -DLCD_DUAL_BUFFER
endif endif
HAPTIC = YES 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 else
FLAVOUR = taranis
CPPDEFS = -DREV4 CPPDEFS = -DREV4
SWR = YES
endif endif
ifeq ($(SPORT_FILE_LOG), YES) ifeq ($(SPORT_FILE_LOG), YES)
CPPDEFS += -DSPORT_FILE_LOG CPPDEFS += -DSPORT_FILE_LOG
@ -1264,6 +1276,7 @@ MSG_CLEANING = Cleaning project:
# Combine all necessary flags and optional flags. # Combine all necessary flags and optional flags.
# Add target processor to 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) 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 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); #define EEPROM_STR DEFNUMSTR(EEPROM_VER);
#endif #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;