diff --git a/src/Makefile b/src/Makefile index 95b2ebdd7..56bb0759e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -227,49 +227,188 @@ SHELL = sh IMG2LBM = -python ../util/img2lbm.py SVNREV = $(shell sh -c "svnversion | egrep -o '[[:digit:]]+[[:alpha:]]*$$'") -CPPDEFS = +SRC = +CPPSRC = # MCU name +ifneq ($(PCB), $(filter $(PCB), STD 9X 9XR STD128 9X128 9XR128 GRUVIN9X MEGA2560 SKY9X TARANIS)) + $(error Sorry, the PCB $(PCB) is not supported yet in openTx) +endif + ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR)) + # 9x/9xr radio ARCH = AVR TRGT = avr- - MCU = atmega64 - CPPDEFS += -DF_CPU=$(F_CPU)UL + MCU = atmega64 + OPT = s XCURVES = NO SDCARD = NO + EXTRAINCDIRS = stock + CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM64 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc) + BOARDSRC = stock/board_stock.cpp + EXTRABOARDSRC = stock/lcd_driver.cpp + EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp + PULSESSRC = pulses_avr.cpp + + ifeq ($(PCB), 9XR) + CPPDEFS += -DPCB9XR + else + CPPDEFS += -DPCB9X + endif + + ifeq ($(AUDIO), YES) + CPPDEFS += -DAUDIO + CPPSRC += audio_avr.cpp + else + CPPSRC += beeper.cpp + endif + + ifeq ($(VOICE), YES) + CPPSRC += stock/voice.cpp + CPPDEFS += -DVOICE + endif + + ifeq ($(PWM_BACKLIGHT), YES) + ifeq ($(VOICE), YES) + $(error Sorry, PWM_BACKLIGHT doesnt work on stock board with VOICE mod) + else + CPPDEFS += -DPWM_BACKLIGHT + endif + endif + + ifeq ($(HAPTIC), YES) + CPPDEFS += -DHAPTIC + CPPSRC += haptic.cpp + endif + + ifeq ($(SP22), YES) + CPPDEFS += -DSP22 + endif endif ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128)) + # 9x/9xr radio with Atmega 64 replaced by Atmega 128 ARCH = AVR TRGT = avr- MCU = atmega128 - CPPDEFS += -DF_CPU=$(F_CPU)UL + OPT = 2 SDCARD = NO + CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=0x8000 + EXTRAINCDIRS = stock + BOARDSRC = stock/board_stock.cpp + EXTRABOARDSRC = stock/lcd_driver.cpp + EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp + PULSESSRC = pulses_avr.cpp + + ifeq ($(PCB), 9XR128) + CPPDEFS += -DPCB9XR128 + else + CPPDEFS += -DPCB9X128 + endif + + ifeq ($(AUDIO), YES) + CPPDEFS += -DAUDIO + CPPSRC += audio_avr.cpp + else + CPPSRC += beeper.cpp + endif + + ifeq ($(VOICE), YES) + CPPSRC += stock/voice.cpp + CPPDEFS += -DVOICE + endif + + ifeq ($(PWM_BACKLIGHT), YES) + ifeq ($(VOICE), YES) + $(error Sorry, PWM_BACKLIGHT doesnt work on stock board with VOICE mod) + else + CPPDEFS += -DPWM_BACKLIGHT + endif + endif + + ifeq ($(HAPTIC), YES) + CPPDEFS += -DHAPTIC + CPPSRC += haptic.cpp + endif + + ifeq ($(SP22), YES) + CPPDEFS += -DSP22 + endif endif ifeq ($(PCB), GRUVIN9X) + # 9x radio with a gruvin9x replacement board ARCH = AVR ifeq ($(PCBREV), REV0) - CPPDEFS += -DREV0 + CPPDEFS = -DREV0 else - CPPDEFS += -DREV1 + CPPDEFS = -DREV1 endif TRGT = avr- MCU = atmega2560 - CPPDEFS += -DF_CPU=$(F_CPU)UL + OPT = 2 + CPPDEFS += -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC SDCARD = NO + EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option + BOARDSRC = gruvin9x/board_gruvin9x.cpp + EXTRABOARDSRC = stock/lcd_driver.cpp + EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp + PULSESSRC = pulses_avr.cpp + CPPSRC += audio_avr.cpp haptic.cpp + + ifeq ($(SDCARD), YES) + CPPDEFS += -DRTCLOCK + CPPSRC += rtc.cpp gruvin9x/rtc_driver.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c gruvin9x/diskio.cpp + endif + + ifeq ($(VOICE), YES) + CPPSRC += gruvin9x/somo14d.cpp + CPPDEFS += -DVOICE + endif + + # Enable extra rotary encoders (Gruvin9x board only) + # Values = YES, NO + ROTARY_ENCODERS = 2 + CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS} endif ifeq ($(PCB), MEGA2560) + # ARDUINO2560 DIY RADIO ARCH = AVR TRGT = avr- MCU = atmega2560 - CPPDEFS += -DF_CPU=$(F_CPU)UL + OPT = 2 + CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC SDCARD = NO + EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option + BOARDSRC = mega2560/board_mega2560.cpp + EXTRABOARDSRC = mega2560/lcd_driver_ST7565R.cpp + EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp + PULSESSRC = pulses_avr.cpp + CPPSRC += audio_avr.cpp haptic.cpp + + ifeq ($(SDCARD), YES) + CPPDEFS += -DRTCLOCK + CPPSRC += rtc.cpp gruvin9x/rtc_driver.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c gruvin9x/diskio.cpp + endif + + ifeq ($(VOICE), YES) + CPPSRC += gruvin9x/somo14d.cpp + CPPDEFS += -DVOICE + endif + + # Enable extra rotary encoders (Gruvin9x board only) + # Values = YES, NO + ROTARY_ENCODERS = 2 + CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS} endif ifeq ($(PCB), SKY9X) + # 9x radio with a sky9x replacement board ARCH = ARM + CPPDEFS = -Dat91sam3s4 ifeq ($(PCBREV), REVA) CPPDEFS += -DREVA LDSCRIPT = sky9x/sam3s2c_flash.ld @@ -282,23 +421,112 @@ ifeq ($(PCB), SKY9X) endif TRGT = arm-none-eabi- MCU = cortex-m3 - CPPDEFS += -Dat91sam3s4 + OPT = 2 SDCARD = YES + CPPDEFS += -DPCBSKY9X -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 + EXTRAINCDIRS = sky9x CoOS/kernel CoOS/portable + BOARDSRC = sky9x/board_sky9x.cpp + EXTRABOARDSRC = sky9x/lcd_driver.cpp + SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c + SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c + SRC += sky9x/usb/device/core/USBD_UDP.c sky9x/usb/device/core/USBDDriver.c + SRC += sky9x/usb/device/massstorage/MSDDriver.c sky9x/usb/device/massstorage/MSDDStateMachine.c sky9x/usb/device/massstorage/MSDLun.c sky9x/usb/device/massstorage/MSDDriverDescriptors.c sky9x/usb/device/massstorage/SBCMethods.c + SRC += sky9x/usb/common/core/USBEndpointDescriptor.c sky9x/usb/common/core/USBGenericRequest.c sky9x/usb/common/core/USBFeatureRequest.c sky9x/usb/common/core/USBInterfaceRequest.c sky9x/usb/common/core/USBGetDescriptorRequest.c sky9x/usb/common/core/USBSetAddressRequest.c sky9x/usb/common/core/USBSetConfigurationRequest.c sky9x/usb/common/core/USBConfigurationDescriptor.c sky9x/usb/common/core/USBGenericDescriptor.c + SRC += sky9x/MEDSdcard.c + EEPROMSRC = eeprom_common.cpp eeprom_raw.cpp eeprom_conversions.cpp + PULSESSRC = pulses_arm.cpp + CPPSRC += audio_arm.cpp haptic.cpp + CPPSRC += sky9x/pwr_driver.cpp sky9x/adc_driver.cpp sky9x/coproc_driver.cpp sky9x/rotenc_driver.cpp sky9x/eeprom_driver.cpp sky9x/pulses_driver.cpp sky9x/keys_driver.cpp sky9x/audio_driver.cpp sky9x/buzzer_driver.cpp sky9x/haptic_driver.cpp sky9x/sdcard_driver.cpp sky9x/massstorage.cpp + + ifeq ($(SDCARD), YES) + EXTRAINCDIRS += FatFs FatFs/option + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.cpp + CPPDEFS += -DVOICE + endif + + ifeq ($(RTCLOCK), YES) + CPPDEFS += -DRTCLOCK + CPPSRC += rtc.cpp sky9x/rtc_driver.cpp + endif + + ifeq ($(BLUETOOTH), YES) + CPPDEFS += -DBLUETOOTH + CPPSRC += sky9x/bluetooth.cpp + endif + + ifeq ($(DEBUG), YES) + CPPSRC += debug.cpp + CPPSRC += sky9x/debug_driver.cpp + SRC += sky9x/syscalls.c + endif endif ifeq ($(PCB), TARANIS) + # TARANIS radio ARCH = ARM ifeq ($(PCBREV), REV3) - CPPDEFS += -DREV3 + CPPDEFS = -DREV3 else - CPPDEFS += -DREV4 + CPPDEFS = -DREV4 endif LDSCRIPT = taranis/stm32_flash.ld TRGT = arm-none-eabi- MCU = cortex-m3 + OPT = 2 CPPDEFS += -DHSE_VALUE=12000000 SDCARD = YES EXT = FRSKY + CPPDEFS += -DPCBTARANIS -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX + EXTRAINCDIRS = taranis CoOS/kernel CoOS/portable + EXTRAINCDIRS += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/include + EXTRAINCDIRS += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc + EXTRAINCDIRS += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc + BOARDSRC = taranis/board_taranis.cpp + EXTRABOARDSRC += taranis/lcd_driver.cpp taranis/aspi.cpp taranis/i2c.c + SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c + EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp # TODO later eeprom_conversions.cpp + PULSESSRC = pulses_arm.cpp + CPPSRC += audio_arm.cpp + CPPSRC += taranis/pwr_driver.cpp taranis/pulses_driver.cpp taranis/keys_driver.cpp taranis/adc_driver.cpp taranis/trainer_driver.cpp taranis/audio_driver.cpp taranis/delays.cpp taranis/uart_driver.cpp taranis/sport_driver.cpp + CPPSRC += bmp.cpp view_channels.cpp + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c + SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s + SRC += taranis/usb_bsp.c taranis/usbd_desc.c taranis/usbd_usr.c taranis/usbd_storage_msd.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c + SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c + # SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c + + ifeq ($(SDCARD), YES) + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c taranis/diskio.cpp + CPPDEFS += -DVOICE + EXTRAINCDIRS += FatFs FatFs/option + endif + + ifeq ($(RTCLOCK), YES) + CPPDEFS += -DRTCLOCK + CPPSRC += rtc.cpp taranis/rtc_driver.cpp + endif + + ifeq ($(DEBUG), YES) + CPPSRC += debug.cpp + SRC += sky9x/syscalls.c + endif endif CC = $(TRGT)gcc @@ -327,19 +555,7 @@ SRC = STD_TTS_SRC = translations/tts_$(shell sh -c "echo $(TTS) | tr '[:upper:]' '[:lower:]'").cpp TTS_SRC = $(shell sh -c "if test -f $(STD_TTS_SRC); then echo $(STD_TTS_SRC); else echo translations/tts_en.cpp; fi") -CPPSRC = opentx.cpp $(PULSESSRC) stamp.cpp menus.cpp menu_model.cpp menu_general.cpp view_main.cpp view_statistics.cpp $(EEPROMSRC) lcd.cpp keys.cpp maths.cpp translations.cpp $(TTS_SRC) - -ifeq ($(EXT), JETI) - CPPSRC += telemetry_jeti.cpp -endif - -ifeq ($(EXT), ARDUPILOT) - CPPSRC += telemetry_ardupilot.cpp -endif - -ifeq ($(EXT), NMEA) - CPPSRC += telemetry_nmea.cpp -endif +CPPSRC += opentx.cpp $(PULSESSRC) stamp.cpp menus.cpp menu_model.cpp menu_general.cpp view_main.cpp view_statistics.cpp $(EEPROMSRC) lcd.cpp keys.cpp maths.cpp translations.cpp $(TTS_SRC) # Debugging format. # Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs. @@ -351,7 +567,7 @@ DBGFMT = dwarf-2 # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS = . translations +EXTRAINCDIRS += . translations CPPDEFS += -DTRANSLATIONS_$(TRANSLATIONS) @@ -447,24 +663,29 @@ ifeq ($(ARITHMETIC_OVERFLOW_CHECK), YES) CPPDEFS += -DPREVENT_ARITHMETIC_OVERFLOW endif -# If STD-Support is enabled + +# EXTENSIONS (for Telemetry protocols) +ifneq ($(EXT), $(filter $(EXT), STD FRSKY ARDUPILOT NMEA JETI MAVLINK TELEMETREZ)) + $(error Sorry, the EXT $(EXT) is not supported yet in openTx) +endif + ifeq ($(EXT), STD) CPPDEFS += -DEXTSTD endif -# If ARDUPILOT-Support is enabled ifeq ($(EXT), ARDUPILOT) CPPDEFS += -DARDUPILOT + CPPSRC += telemetry_ardupilot.cpp endif -# If NMEA-Support is enabled ifeq ($(EXT), NMEA) CPPDEFS += -DNMEA + CPPSRC += telemetry_nmea.cpp endif -# If JETI-Support is enabled ifeq ($(EXT), JETI) CPPDEFS += -DJETI + CPPSRC += telemetry_jeti.cpp endif ifeq ($(EXT), MAVLINK) @@ -476,7 +697,6 @@ ifeq ($(EXT), TELEMETREZ) CPPDEFS += -DTELEMETREZ endif -# If FRSKY-Support is enabled ifeq ($(EXT), $(filter $(EXT), FRSKY TELEMETREZ)) CPPDEFS += -DFRSKY ifeq ($(PCB), TARANIS) @@ -521,251 +741,6 @@ endif RUN_FROM_FLASH = 1 -ifeq ($(PCB), TARANIS) - # TARANIS radio - OPT = 2 - CPPDEFS += -DPCBTARANIS -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DPXX - EXTRAINCDIRS += taranis CoOS/kernel CoOS/portable - EXTRAINCDIRS += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/include - EXTRAINCDIRS += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc - EXTRAINCDIRS += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc - BOARDSRC = taranis/board_taranis.cpp - EXTRABOARDSRC += taranis/lcd_driver.cpp taranis/aspi.cpp taranis/i2c.c - SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c - EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp # TODO later eeprom_conversions.cpp - PULSESSRC = pulses_arm.cpp - CPPSRC += audio_arm.cpp - CPPSRC += taranis/pwr_driver.cpp taranis/pulses_driver.cpp taranis/keys_driver.cpp taranis/adc_driver.cpp taranis/trainer_driver.cpp taranis/audio_driver.cpp taranis/delays.cpp taranis/uart_driver.cpp taranis/sport_driver.cpp - CPPSRC += bmp.cpp view_channels.cpp - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c - SRC += taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s - SRC += taranis/usb_bsp.c taranis/usbd_desc.c taranis/usbd_usr.c taranis/usbd_storage_msd.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c - SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c - # SRC += taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c - - ifeq ($(SDCARD), YES) - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c taranis/diskio.cpp - CPPDEFS += -DVOICE - EXTRAINCDIRS += FatFs FatFs/option - endif - - ifeq ($(RTCLOCK), YES) - CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp taranis/rtc_driver.cpp - endif - - ifeq ($(DEBUG), YES) - CPPSRC += debug.cpp - SRC += sky9x/syscalls.c - endif -endif - -ifeq ($(PCB), SKY9X) - # 9x radio with a sky9x replacement board - OPT = 2 - CPPDEFS += -DPCBSKY9X -DCPUARM -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC -DPXX -DDSM2 -DDSM2_PPM -DROTARY_ENCODERS=1 - EXTRAINCDIRS += sky9x CoOS/kernel CoOS/portable - BOARDSRC = sky9x/board_sky9x.cpp - EXTRABOARDSRC += sky9x/lcd_driver.cpp - SRC += sky9x/core_cm3.c sky9x/board_lowlevel.c sky9x/crt.c sky9x/vectors_sam3s.c - SRC += CoOS/kernel/core.c CoOS/kernel/hook.c CoOS/kernel/task.c CoOS/kernel/event.c CoOS/kernel/time.c CoOS/kernel/timer.c CoOS/kernel/flag.c CoOS/kernel/mutex.c CoOS/kernel/serviceReq.c CoOS/portable/GCC/port.c CoOS/portable/arch.c - SRC += sky9x/usb/device/core/USBD_UDP.c sky9x/usb/device/core/USBDDriver.c - SRC += sky9x/usb/device/massstorage/MSDDriver.c sky9x/usb/device/massstorage/MSDDStateMachine.c sky9x/usb/device/massstorage/MSDLun.c sky9x/usb/device/massstorage/MSDDriverDescriptors.c sky9x/usb/device/massstorage/SBCMethods.c - SRC += sky9x/usb/common/core/USBEndpointDescriptor.c sky9x/usb/common/core/USBGenericRequest.c sky9x/usb/common/core/USBFeatureRequest.c sky9x/usb/common/core/USBInterfaceRequest.c sky9x/usb/common/core/USBGetDescriptorRequest.c sky9x/usb/common/core/USBSetAddressRequest.c sky9x/usb/common/core/USBSetConfigurationRequest.c sky9x/usb/common/core/USBConfigurationDescriptor.c sky9x/usb/common/core/USBGenericDescriptor.c - SRC += sky9x/MEDSdcard.c - EEPROMSRC = eeprom_common.cpp eeprom_raw.cpp eeprom_conversions.cpp - PULSESSRC = pulses_arm.cpp - CPPSRC += audio_arm.cpp haptic.cpp - CPPSRC += sky9x/pwr_driver.cpp sky9x/adc_driver.cpp sky9x/coproc_driver.cpp sky9x/rotenc_driver.cpp sky9x/eeprom_driver.cpp sky9x/pulses_driver.cpp sky9x/keys_driver.cpp sky9x/audio_driver.cpp sky9x/buzzer_driver.cpp sky9x/haptic_driver.cpp sky9x/sdcard_driver.cpp sky9x/massstorage.cpp - - ifeq ($(SDCARD), YES) - EXTRAINCDIRS += FatFs FatFs/option - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.cpp - CPPDEFS += -DVOICE - endif - - ifeq ($(RTCLOCK), YES) - CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp sky9x/rtc_driver.cpp - endif - - ifeq ($(BLUETOOTH), YES) - CPPDEFS += -DBLUETOOTH - CPPSRC += sky9x/bluetooth.cpp - endif - - ifeq ($(DEBUG), YES) - CPPSRC += debug.cpp - CPPSRC += sky9x/debug_driver.cpp - SRC += sky9x/syscalls.c - endif -endif - -ifeq ($(PCB), GRUVIN9X) - # 9x radio with a gruvin9x replacement board - OPT = 2 - CPPDEFS += -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC - EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option - BOARDSRC += gruvin9x/board_gruvin9x.cpp - EXTRABOARDSRC += stock/lcd_driver.cpp - EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp - CPPSRC += audio_avr.cpp haptic.cpp - - ifeq ($(SDCARD), YES) - CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp gruvin9x/rtc_driver.cpp - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c gruvin9x/diskio.cpp - endif - - ifeq ($(VOICE), YES) - CPPSRC += gruvin9x/somo14d.cpp - CPPDEFS += -DVOICE - endif - - # Enable extra rotary encoders (Gruvin9x board only) - # Values = YES, NO - ROTARY_ENCODERS = 2 - CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS} -endif - -ifeq ($(PCB), MEGA2560) - # ARDUINO2560 DIY RADIO - OPT = 2 - CPPDEFS += -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC - EXTRAINCDIRS += gruvin9x stock FatFs FatFs/option - BOARDSRC += mega2560/board_mega2560.cpp - EXTRABOARDSRC += mega2560/lcd_driver_ST7565R.cpp - EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp - CPPSRC += audio_avr.cpp haptic.cpp - - ifeq ($(SDCARD), YES) - CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp gruvin9x/rtc_driver.cpp - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c gruvin9x/diskio.cpp - endif - - ifeq ($(VOICE), YES) - CPPSRC += gruvin9x/somo14d.cpp - CPPDEFS += -DVOICE - endif - - # Enable extra rotary encoders (Gruvin9x board only) - # Values = YES, NO - ROTARY_ENCODERS = 2 - CPPDEFS += -DROTARY_ENCODERS=${ROTARY_ENCODERS} -endif - -ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128)) - # 9x radio with Atmega 64 replace by Atmega 128 - OPT = 2 - CPPDEFS += -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=0x8000 - EXTRAINCDIRS += stock - BOARDSRC = stock/board_stock.cpp - EXTRABOARDSRC += stock/lcd_driver.cpp - EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp - - ifeq ($(PCB), 9XR128) - CPPDEFS += -DPCB9XR128 - else - CPPDEFS += -DPCB9X128 - endif - - ifeq ($(AUDIO), YES) - CPPDEFS += -DAUDIO - CPPSRC += audio_avr.cpp - else - CPPSRC += beeper.cpp - endif - - ifeq ($(VOICE), YES) - CPPSRC += stock/voice.cpp - CPPDEFS += -DVOICE - endif - - ifeq ($(PWM_BACKLIGHT), YES) - ifeq ($(VOICE), YES) - $(error Sorry, PWM_BACKLIGHT doesnt work on stock board with VOICE mod) - else - CPPDEFS += -DPWM_BACKLIGHT - endif - endif - - ifeq ($(HAPTIC), YES) - CPPDEFS += -DHAPTIC - CPPSRC += haptic.cpp - endif - - ifeq ($(SP22), YES) - CPPDEFS += -DSP22 - endif -endif - -ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR)) - # 9x radio - OPT = s - EXTRAINCDIRS += stock - CPPDEFS += -DPCBSTD -DCPUM64 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc) - BOARDSRC = stock/board_stock.cpp - EXTRABOARDSRC += stock/lcd_driver.cpp - EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp - - ifeq ($(PCB), 9XR) - CPPDEFS += -DPCB9XR - else - CPPDEFS += -DPCB9X - endif - - ifeq ($(AUDIO), YES) - CPPDEFS += -DAUDIO - CPPSRC += audio_avr.cpp - else - CPPSRC += beeper.cpp - endif - - ifeq ($(VOICE), YES) - CPPSRC += stock/voice.cpp - CPPDEFS += -DVOICE - endif - - ifeq ($(PWM_BACKLIGHT), YES) - ifeq ($(VOICE), YES) - $(error Sorry, PWM_BACKLIGHT doesnt work on stock board with VOICE mod) - else - CPPDEFS += -DPWM_BACKLIGHT - endif - endif - - ifeq ($(HAPTIC), YES) - CPPDEFS += -DHAPTIC - CPPSRC += haptic.cpp - endif - - ifeq ($(SP22), YES) - CPPDEFS += -DSP22 - endif -endif - ### Global Build-Option Directives ### ifeq ($(PPM_CENTER_ADJUSTABLE), YES) diff --git a/src/menu_model.cpp b/src/menu_model.cpp index bd658f97e..a35814c5f 100644 --- a/src/menu_model.cpp +++ b/src/menu_model.cpp @@ -3176,7 +3176,7 @@ void menuModelCustomSwitchOne(uint8_t event) int8_t v2_min=0, v2_max=MIXSRC_LAST_TELEM; if (cstate == CS_VBOOL) { putsSwitches(CSWONE_2ND_COLUMN, y, cs->v2, attr); - v2_min = SWSRC_OFF+1; v2_max = SWSRC_OFF-1; + v2_min = SWSRC_OFF+1; v2_max = SWSRC_ON-1; } else if (cstate == CS_VCOMP) { putsMixerSource(CSWONE_2ND_COLUMN, y, cs->v2, attr); diff --git a/src/myeeprom.h b/src/myeeprom.h index 677211b02..2f77690a3 100644 --- a/src/myeeprom.h +++ b/src/myeeprom.h @@ -160,7 +160,7 @@ enum BeeperMode { #define LIMITDATA_EXTRA char name[6]; #define swstate_t uint16_t #elif defined(PCBSKY9X) -#define MODELDATA_EXTRA uint8_t ppmSCH; int8_t ppm2SCH; int8_t ppm2NCH; int8_t rfProtocol; uint8_t rfCountryCode; +#define MODELDATA_EXTRA uint8_t ppmSCH; int8_t ppm2SCH; int8_t ppm2NCH; int8_t rfProtocol; #define LIMITDATA_EXTRA #define swstate_t uint8_t #else