diff --git a/src/Makefile b/src/Makefile index 338cbe1e6..34746e6ec 100644 --- a/src/Makefile +++ b/src/Makefile @@ -170,6 +170,10 @@ PXX = NO # Values = NO, SERIAL, PPM DSM2 = NO +# HUBSAN protocol +# Values = NO, YES +HUBSAN = NO + # DSM/PPM TX caddy PCB (Gruvin) # For auto-switching switching between DSM2/X and Fr-Sky transmitter modules # Values = YES, NO @@ -252,12 +256,12 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR)) XCURVES = NO SDCARD = NO THR_TRACE = NO - EXTRAINCDIRS = stock + EXTRAINCDIRS = targets/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 + BOARDSRC = targets/stock/board_stock.cpp + EXTRABOARDSRC = targets/stock/lcd_driver.cpp EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp + PULSESSRC = protocols/pulses_avr.cpp ifeq ($(PCB), 9XR) CPPDEFS += -DPCB9XR @@ -275,7 +279,7 @@ ifeq ($(PCB), $(filter $(PCB), STD 9X 9XR)) ifeq ($(VOICE), YES) CPPDEFS += -DVOICE - CPPSRC += stock/voice.cpp + CPPSRC += targets/stock/voice.cpp endif ifeq ($(PWM_BACKLIGHT), YES) @@ -308,11 +312,11 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128)) THR_TRACE = NO EEPROM_VARIANT += ${M128_VARIANT} CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM128 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc) - EXTRAINCDIRS = stock - BOARDSRC = stock/board_stock.cpp - EXTRABOARDSRC = stock/lcd_driver.cpp + EXTRAINCDIRS = targets/stock + BOARDSRC = targets/stock/board_stock.cpp + EXTRABOARDSRC = targets/stock/lcd_driver.cpp EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp + PULSESSRC = protocols/pulses_avr.cpp ifeq ($(PCB), 9XR128) CPPDEFS += -DPCB9XR128 @@ -330,7 +334,7 @@ ifeq ($(PCB), $(filter $(PCB), STD128 9X128 9XR128)) ifeq ($(VOICE), YES) CPPDEFS += -DVOICE - CPPSRC += stock/voice.cpp + CPPSRC += targets/stock/voice.cpp endif ifeq ($(PWM_BACKLIGHT), YES) @@ -363,11 +367,11 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561)) THR_TRACE = YES EEPROM_VARIANT += ${M2561_VARIANT} CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBSTD -DCPUM2561 -DEEPROM_VARIANT=$(shell echo ${EEPROM_VARIANT} | bc) - EXTRAINCDIRS = stock - BOARDSRC = stock/board_stock.cpp - EXTRABOARDSRC = stock/lcd_driver.cpp + EXTRAINCDIRS = targets/stock + BOARDSRC = targets/stock/board_stock.cpp + EXTRABOARDSRC = targets/stock/lcd_driver.cpp EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp + PULSESSRC = protocols/pulses_avr.cpp ifeq ($(PCB), 9XR2561) CPPDEFS += -DPCB9XR2561 @@ -385,7 +389,7 @@ ifeq ($(PCB), $(filter $(PCB), 9X2561)) ifeq ($(VOICE), YES) CPPDEFS += -DVOICE - CPPSRC += stock/voice.cpp + CPPSRC += targets/stock/voice.cpp endif ifeq ($(PWM_BACKLIGHT), YES) @@ -423,17 +427,17 @@ ifeq ($(PCB), GRUVIN9X) SDCARD = NO BUZZER = NO THR_TRACE = YES - EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option - BOARDSRC = gruvin9x/board_gruvin9x.cpp - EXTRABOARDSRC = stock/lcd_driver.cpp + EXTRAINCDIRS = targets/gruvin9x targets/stock FatFs FatFs/option + BOARDSRC = targets/gruvin9x/board_gruvin9x.cpp + EXTRABOARDSRC = targets/stock/lcd_driver.cpp EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp + PULSESSRC = protocols/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 + CPPSRC += rtc.cpp targets/gruvin9x/rtc_driver.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/gruvin9x/diskio.cpp endif ifeq ($(BUZZER), YES) @@ -443,7 +447,7 @@ ifeq ($(PCB), GRUVIN9X) ifeq ($(VOICE), YES) CPPDEFS += -DVOICE - CPPSRC += gruvin9x/somo14d.cpp + CPPSRC += targets/gruvin9x/somo14d.cpp endif # Enable extra rotary encoders (Gruvin9x board only) @@ -461,21 +465,21 @@ ifeq ($(PCB), MEGA2560) CPPDEFS = -DF_CPU=$(F_CPU)UL -DPCBGRUVIN9X -DEEPROM_VARIANT=0 -DAUDIO -DHAPTIC SDCARD = NO THR_TRACE = YES - EXTRAINCDIRS = gruvin9x stock FatFs FatFs/option - BOARDSRC = mega2560/board_mega2560.cpp - EXTRABOARDSRC = mega2560/lcd_driver_ST7565R.cpp + EXTRAINCDIRS = targets/gruvin9x targets/stock FatFs FatFs/option + BOARDSRC = targets/mega2560/board_mega2560.cpp + EXTRABOARDSRC = targets/mega2560/lcd_driver_ST7565R.cpp EEPROMSRC = eeprom_common.cpp eeprom_rlc.cpp - PULSESSRC = pulses_avr.cpp + PULSESSRC = protocols/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 + CPPSRC += rtc.cpp targets/gruvin9x/rtc_driver.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/gruvin9x/diskio.cpp endif ifeq ($(VOICE), YES) - CPPSRC += gruvin9x/somo14d.cpp + CPPSRC += targets/gruvin9x/somo14d.cpp CPPDEFS += -DVOICE endif @@ -491,13 +495,13 @@ ifeq ($(PCB), SKY9X) CPPDEFS = -Dat91sam3s4 ifeq ($(PCBREV), REVA) CPPDEFS += -DREVA - LDSCRIPT = sky9x/sam3s2c_flash.ld + LDSCRIPT = targets/sky9x/sam3s2c_flash.ld else ifeq ($(PCBREV), REVB) CPPDEFS += -DREVB - LDSCRIPT = sky9x/sam3s4c_flash.ld + LDSCRIPT = targets/sky9x/sam3s4c_flash.ld else CPPDEFS += -DREVC - LDSCRIPT = sky9x/sam3s4c_flash.ld + LDSCRIPT = targets/sky9x/sam3s4c_flash.ld endif TRGT = arm-none-eabi- MCU = cortex-m3 @@ -506,24 +510,24 @@ ifeq ($(PCB), SKY9X) BUZZER = NO THR_TRACE = 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 + EXTRAINCDIRS = targets/sky9x CoOS/kernel CoOS/portable + BOARDSRC = targets/sky9x/board_sky9x.cpp + EXTRABOARDSRC = targets/sky9x/lcd_driver.cpp + SRC += targets/sky9x/core_cm3.c targets/sky9x/board_lowlevel.c targets/sky9x/crt.c targets/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 + SRC += targets/sky9x/usb/device/core/USBD_UDP.c targets/sky9x/usb/device/core/USBDDriver.c + SRC += targets/sky9x/usb/device/massstorage/MSDDriver.c targets/sky9x/usb/device/massstorage/MSDDStateMachine.c targets/sky9x/usb/device/massstorage/MSDLun.c targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.c targets/sky9x/usb/device/massstorage/SBCMethods.c + SRC += targets/sky9x/usb/common/core/USBEndpointDescriptor.c targets/sky9x/usb/common/core/USBGenericRequest.c targets/sky9x/usb/common/core/USBFeatureRequest.c targets/sky9x/usb/common/core/USBInterfaceRequest.c targets/sky9x/usb/common/core/USBGetDescriptorRequest.c targets/sky9x/usb/common/core/USBSetAddressRequest.c targets/sky9x/usb/common/core/USBSetConfigurationRequest.c targets/sky9x/usb/common/core/USBConfigurationDescriptor.c targets/sky9x/usb/common/core/USBGenericDescriptor.c + SRC += targets/sky9x/MEDSdcard.c EEPROMSRC = eeprom_common.cpp eeprom_raw.cpp eeprom_conversions.cpp - PULSESSRC = pulses_arm.cpp + PULSESSRC = protocols/pulses_arm.cpp protocols/ppm_arm.cpp protocols/pxx_arm.cpp protocols/dsm2_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 + CPPSRC += targets/sky9x/pwr_driver.cpp targets/sky9x/adc_driver.cpp targets/sky9x/coproc_driver.cpp targets/sky9x/rotenc_driver.cpp targets/sky9x/eeprom_driver.cpp targets/sky9x/pulses_driver.cpp targets/sky9x/keys_driver.cpp targets/sky9x/audio_driver.cpp targets/sky9x/buzzer_driver.cpp targets/sky9x/haptic_driver.cpp targets/sky9x/sdcard_driver.cpp targets/sky9x/massstorage.cpp ifeq ($(SDCARD), YES) CPPDEFS += -DVOICE EXTRAINCDIRS += FatFs FatFs/option - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c sky9x/diskio.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/sky9x/diskio.cpp endif ifeq ($(BUZZER), YES) @@ -533,18 +537,18 @@ ifeq ($(PCB), SKY9X) ifeq ($(RTCLOCK), YES) CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp sky9x/rtc_driver.cpp + CPPSRC += rtc.cpp targets/sky9x/rtc_driver.cpp endif ifeq ($(BLUETOOTH), YES) CPPDEFS += -DBLUETOOTH - CPPSRC += sky9x/bluetooth.cpp + CPPSRC += targets/sky9x/bluetooth.cpp endif ifeq ($(DEBUG), YES) CPPSRC += debug.cpp - CPPSRC += sky9x/debug_driver.cpp - SRC += sky9x/syscalls.c + CPPSRC += targets/sky9x/debug_driver.cpp + SRC += targets/sky9x/syscalls.c endif endif @@ -556,7 +560,7 @@ ifeq ($(PCB), TARANIS) else CPPDEFS = -DREV4 endif - LDSCRIPT = taranis/stm32_flash.ld + LDSCRIPT = targets/taranis/stm32_flash.ld TRGT = arm-none-eabi- MCU = cortex-m3 OPT = 2 @@ -565,57 +569,63 @@ ifeq ($(PCB), TARANIS) THR_TRACE = 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 + EXTRAINCDIRS = targets/taranis CoOS/kernel CoOS/portable + EXTRAINCDIRS += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/include + EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc + EXTRAINCDIRS += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc + BOARDSRC = targets/taranis/board_taranis.cpp + EXTRABOARDSRC += targets/taranis/lcd_driver.cpp targets/taranis/aspi.cpp targets/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 + PULSESSRC = protocols/pulses_arm.cpp protocols/ppm_arm.cpp protocols/pxx_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 - 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 - EXTRABOARDSRC += taranis/usbd_usr.cpp taranis/usbd_storage_msd.cpp + CPPSRC += targets/taranis/pwr_driver.cpp targets/taranis/pulses_driver.cpp targets/taranis/keys_driver.cpp targets/taranis/adc_driver.cpp targets/taranis/trainer_driver.cpp targets/taranis/audio_driver.cpp targets/taranis/delays.cpp targets/taranis/uart_driver.cpp targets/taranis/sport_driver.cpp + CPPSRC += bmp.cpp gui/view_channels.cpp + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c + SRC += targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s + SRC += targets/taranis/usb_bsp.c targets/taranis/usbd_desc.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c + SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c + # SRC += targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c + EXTRABOARDSRC += targets/taranis/usbd_usr.cpp targets/taranis/usbd_storage_msd.cpp ifeq ($(SDCARD), YES) - EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c taranis/diskio.cpp + EXTRABOARDSRC += FatFs/ff.c FatFs/fattime.c FatFs/option/ccsbcs.c targets/taranis/diskio.cpp CPPDEFS += -DVOICE EXTRAINCDIRS += FatFs FatFs/option endif ifeq ($(RTCLOCK), YES) CPPDEFS += -DRTCLOCK - CPPSRC += rtc.cpp taranis/rtc_driver.cpp + CPPSRC += rtc.cpp targets/taranis/rtc_driver.cpp endif ifeq ($(DEBUG), YES) CPPSRC += debug.cpp - SRC += sky9x/syscalls.c - endif + SRC += targets/sky9x/syscalls.c + endif + + ifeq ($(HUBSAN), YES) + CPPDEFS += -DHUBSAN + CPPSRC += protocols/hubsan.cpp + # SRC += targets/sky9x/syscalls.c + endif endif CC = $(TRGT)gcc @@ -643,7 +653,7 @@ TARGET = opentx 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) +CPPSRC += opentx.cpp $(PULSESSRC) stamp.cpp gui/menus.cpp gui/menu_model.cpp gui/menu_general.cpp gui/view_main.cpp gui/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. @@ -762,22 +772,22 @@ endif ifeq ($(EXT), ARDUPILOT) CPPDEFS += -DARDUPILOT - CPPSRC += telemetry_ardupilot.cpp + CPPSRC += telemetry/ardupilot.cpp endif ifeq ($(EXT), NMEA) CPPDEFS += -DNMEA - CPPSRC += telemetry_nmea.cpp + CPPSRC += telemetry/nmea.cpp endif ifeq ($(EXT), JETI) CPPDEFS += -DJETI - CPPSRC += telemetry_jeti.cpp + CPPSRC += telemetry/jeti.cpp endif ifeq ($(EXT), MAVLINK) CPPDEFS += -DMAVLINK - CPPSRC += telemetry_mavlink.cpp rotarysw.cpp serial.cpp + CPPSRC += telemetry/mavlink.cpp rotarysw.cpp serial.cpp endif ifeq ($(EXT), TELEMETREZ) @@ -787,17 +797,17 @@ endif ifeq ($(EXT), $(filter $(EXT), FRSKY TELEMETREZ)) CPPDEFS += -DFRSKY ifeq ($(PCB), TARANIS) - TELEMETRY_PROTO = $(shell sh -c "if test -f telemetry_sport.cpp; then echo SPORT; else echo FRSKY; fi") + TELEMETRY_PROTO = $(shell sh -c "if test -f telemetry/frsky_sport.cpp; then echo SPORT; else echo FRSKY; fi") ifeq ($(TELEMETRY_PROTO), SPORT) - CPPSRC += telemetry_sport.cpp + CPPSRC += telemetry/frsky_sport.cpp CPPDEFS += -DFRSKY_SPORT else - CPPSRC += telemetry_frsky.cpp + CPPSRC += telemetry/frsky.cpp endif else - CPPSRC += telemetry_frsky.cpp + CPPSRC += telemetry/frsky.cpp endif - CPPSRC += view_telemetry.cpp + CPPSRC += gui/view_telemetry.cpp # If FRSKY-Hub is enabled ifeq ($(FRSKY_HUB), YES) CPPDEFS += -DFRSKY_HUB @@ -977,6 +987,8 @@ else build: stamp_header lbm allsrc.cpp elf remallsrc bin lss endif +lbm: bitmaps/font.lbm bitmaps/sticks.lbm + elf: $(TARGET).elf bin: $(TARGET).bin hex: $(TARGET).hex @@ -984,8 +996,6 @@ eep: $(TARGET).eep lss: $(TARGET).lss sym: $(TARGET).sym -lbm: font.lbm font_tiny.lbm font_small.lbm font_midsize.lbm font_dblsize.lbm sticks.lbm splash_9x.lbm splash_taranis.lbm logo_taranis.lbm icons.lbm asterisk.lbm - # Build stamp-file stamp_header: @echo @@ -1026,73 +1036,37 @@ arm-stamp: @echo "#define SVN_VERS \"opentx-r$(SVNREV)\"" >> stamp-opentx-arm.txt @cat stamp-opentx-arm.txt -font.lbm: font.xbm font_extra.xbm translations/font_se.xbm translations/font_de.xbm translations/font_it.xbm translations/font_cz.xbm translations/font_fr.xbm translations/font_es.xbm +bitmaps/font.lbm: bitmaps/font.xbm bitmaps/font_extra.xbm bitmaps/font_tiny.xbm bitmaps/font_small.xbm bitmaps/font_midsize.xbm bitmaps/font_dblsize.xbm bitmaps/font_dblsize_extra.xbm translations/font_se.xbm translations/font_de.xbm translations/font_it.xbm translations/font_cz.xbm translations/font_fr.xbm translations/font_es.xbm translations/font_dblsize_se.xbm translations/font_dblsize_de.xbm translations/font_dblsize_it.xbm translations/font_dblsize_fr.xbm translations/font_dblsize_es.xbm @echo - @echo "Convert font from xbm to lbm:" - $(IMG2LBM) font.xbm font.lbm 5x7 - $(IMG2LBM) font_extra.xbm font_extra.lbm 5x7 + @echo "Convert fonts from xbm to lbm:" + $(IMG2LBM) bitmaps/font.xbm bitmaps/font.lbm 5x7 + $(IMG2LBM) bitmaps/font_extra.xbm bitmaps/font_extra.lbm 5x7 + $(IMG2LBM) bitmaps/font_tiny.xbm bitmaps/font_tiny.lbm 3x5 + $(IMG2LBM) bitmaps/font_small.xbm bitmaps/font_small.lbm 4x6 + $(IMG2LBM) bitmaps/font_midsize.xbm bitmaps/font_midsize.lbm 8x10 + $(IMG2LBM) bitmaps/font_dblsize.xbm bitmaps/font_dblsize.lbm 10x14 + $(IMG2LBM) bitmaps/font_dblsize_extra.xbm bitmaps/font_dblsize_extra.lbm 10x14 $(IMG2LBM) translations/font_se.xbm translations/font_se.lbm 5x7 $(IMG2LBM) translations/font_de.xbm translations/font_de.lbm 5x7 $(IMG2LBM) translations/font_it.xbm translations/font_it.lbm 5x7 $(IMG2LBM) translations/font_cz.xbm translations/font_cz.lbm 5x7 $(IMG2LBM) translations/font_fr.xbm translations/font_fr.lbm 5x7 $(IMG2LBM) translations/font_es.xbm translations/font_es.lbm 5x7 - -font_tiny.lbm: font_tiny.xbm - @echo - @echo "Convert font from xbm to lbm:" - $(IMG2LBM) $< $@ 3x5 - -font_small.lbm: font_small.xbm - @echo - @echo "Convert font from xbm to lbm:" - $(IMG2LBM) $< $@ 4x6 - -font_midsize.lbm: font_midsize.xbm - @echo - @echo "Convert font from xbm to lbm:" - $(IMG2LBM) $< $@ 8x10 - -font_dblsize.lbm: font_dblsize.xbm font_dblsize_extra.xbm translations/font_dblsize_se.xbm translations/font_dblsize_de.xbm translations/font_dblsize_it.xbm translations/font_dblsize_fr.xbm translations/font_dblsize_es.xbm - @echo - @echo "Convert font from xbm to lbm:" - $(IMG2LBM) font_dblsize.xbm font_dblsize.lbm 10x14 - $(IMG2LBM) font_dblsize_extra.xbm font_dblsize_extra.lbm 10x14 $(IMG2LBM) translations/font_dblsize_se.xbm translations/font_dblsize_se.lbm 10x14 $(IMG2LBM) translations/font_dblsize_de.xbm translations/font_dblsize_de.lbm 10x14 $(IMG2LBM) translations/font_dblsize_it.xbm translations/font_dblsize_it.lbm 10x14 $(IMG2LBM) translations/font_dblsize_fr.xbm translations/font_dblsize_fr.lbm 10x14 $(IMG2LBM) translations/font_dblsize_es.xbm translations/font_dblsize_es.lbm 10x14 -sticks.lbm: sticks_4x1.xbm +bitmaps/sticks.lbm: bitmaps/sticks_4x1.xbm bitmaps/splash_9x.xbm bitmaps/splash_taranis.png bitmaps/logo_taranis.bmp bitmaps/icons.png bitmaps/asterisk.xbm @echo - @echo "Convert sticks from xbm to lbm:" - $(IMG2LBM) $< $@ img 4 - -splash_9x.lbm: splash_9x.xbm - @echo - @echo "Convert 9x splash from xbm to lbm:" - $(IMG2LBM) $< $@ img - -splash_taranis.lbm: splash_taranis.png - @echo - @echo "Convert Taranis splash from png to lbm:" - $(IMG2LBM) $< $@ bmp - -logo_taranis.lbm: logo_taranis.bmp - @echo - @echo "Convert Taranis logo from bmp to lbm:" - $(IMG2LBM) $< $@ bmp - -icons.lbm: icons.png - @echo - @echo "Convert icons from png to lbm:" - $(IMG2LBM) $< $@ bmp - -asterisk.lbm: asterisk.xbm - @echo - @echo "Convert asterisk from xbm to lbm:" - $(IMG2LBM) $< $@ img + @echo "Convert bitmaps from xbm to lbm:" + $(IMG2LBM) bitmaps/sticks_4x1.xbm bitmaps/sticks.lbm img 4 + $(IMG2LBM) bitmaps/splash_9x.xbm bitmaps/splash_9x.lbm img + $(IMG2LBM) bitmaps/splash_taranis.png bitmaps/splash_taranis.lbm bmp + $(IMG2LBM) bitmaps/logo_taranis.bmp bitmaps/logo_taranis.lbm bmp + $(IMG2LBM) bitmaps/icons.png bitmaps/icons.lbm bmp + $(IMG2LBM) bitmaps/asterisk.xbm bitmaps/asterisk.lbm img # Eye candy. # AVR Studio 3.x does not check make's exit code but relies on @@ -1135,7 +1109,7 @@ FOXLIB=-L/usr/local/lib \ -lFOX-1.6 \ -Wl,-rpath,$(FOXPATH)/src/.libs -simu: stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp simpgmspace.cpp *.h *.lbm eeprom.bin +simu: stamp_header $(BOARDSRC) $(CPPSRC) Makefile simu.cpp simpgmspace.cpp *.h lbm eeprom.bin g++ $(CPPFLAGS) simu.cpp $(BOARDSRC) $(CPPSRC) simpgmspace.cpp -MD -DSIMU -O0 -o simu $(FOXINC) $(FOXLIB) -pthread eeprom.bin: diff --git a/src/asterisk.lbm b/src/bitmaps/asterisk.lbm similarity index 100% rename from src/asterisk.lbm rename to src/bitmaps/asterisk.lbm diff --git a/src/asterisk.xbm b/src/bitmaps/asterisk.xbm similarity index 100% rename from src/asterisk.xbm rename to src/bitmaps/asterisk.xbm diff --git a/src/font.lbm b/src/bitmaps/font.lbm similarity index 100% rename from src/font.lbm rename to src/bitmaps/font.lbm diff --git a/src/font.xbm b/src/bitmaps/font.xbm similarity index 100% rename from src/font.xbm rename to src/bitmaps/font.xbm diff --git a/src/font_dblsize.lbm b/src/bitmaps/font_dblsize.lbm similarity index 100% rename from src/font_dblsize.lbm rename to src/bitmaps/font_dblsize.lbm diff --git a/src/font_dblsize.xbm b/src/bitmaps/font_dblsize.xbm similarity index 100% rename from src/font_dblsize.xbm rename to src/bitmaps/font_dblsize.xbm diff --git a/src/font_dblsize_extra.lbm b/src/bitmaps/font_dblsize_extra.lbm similarity index 100% rename from src/font_dblsize_extra.lbm rename to src/bitmaps/font_dblsize_extra.lbm diff --git a/src/font_dblsize_extra.xbm b/src/bitmaps/font_dblsize_extra.xbm similarity index 100% rename from src/font_dblsize_extra.xbm rename to src/bitmaps/font_dblsize_extra.xbm diff --git a/src/font_extra.lbm b/src/bitmaps/font_extra.lbm similarity index 100% rename from src/font_extra.lbm rename to src/bitmaps/font_extra.lbm diff --git a/src/font_extra.xbm b/src/bitmaps/font_extra.xbm similarity index 100% rename from src/font_extra.xbm rename to src/bitmaps/font_extra.xbm diff --git a/src/font_midsize.lbm b/src/bitmaps/font_midsize.lbm similarity index 100% rename from src/font_midsize.lbm rename to src/bitmaps/font_midsize.lbm diff --git a/src/font_midsize.xbm b/src/bitmaps/font_midsize.xbm similarity index 100% rename from src/font_midsize.xbm rename to src/bitmaps/font_midsize.xbm diff --git a/src/font_small.lbm b/src/bitmaps/font_small.lbm similarity index 100% rename from src/font_small.lbm rename to src/bitmaps/font_small.lbm diff --git a/src/font_small.xbm b/src/bitmaps/font_small.xbm similarity index 100% rename from src/font_small.xbm rename to src/bitmaps/font_small.xbm diff --git a/src/font_tiny.lbm b/src/bitmaps/font_tiny.lbm similarity index 100% rename from src/font_tiny.lbm rename to src/bitmaps/font_tiny.lbm diff --git a/src/font_tiny.xbm b/src/bitmaps/font_tiny.xbm similarity index 100% rename from src/font_tiny.xbm rename to src/bitmaps/font_tiny.xbm diff --git a/src/icons.lbm b/src/bitmaps/icons.lbm similarity index 100% rename from src/icons.lbm rename to src/bitmaps/icons.lbm diff --git a/src/icons.png b/src/bitmaps/icons.png similarity index 100% rename from src/icons.png rename to src/bitmaps/icons.png diff --git a/src/logo_taranis.bmp b/src/bitmaps/logo_taranis.bmp similarity index 100% rename from src/logo_taranis.bmp rename to src/bitmaps/logo_taranis.bmp diff --git a/src/logo_taranis.lbm b/src/bitmaps/logo_taranis.lbm similarity index 100% rename from src/logo_taranis.lbm rename to src/bitmaps/logo_taranis.lbm diff --git a/src/splash_9x.lbm b/src/bitmaps/splash_9x.lbm similarity index 100% rename from src/splash_9x.lbm rename to src/bitmaps/splash_9x.lbm diff --git a/src/splash_9x.xbm b/src/bitmaps/splash_9x.xbm similarity index 100% rename from src/splash_9x.xbm rename to src/bitmaps/splash_9x.xbm diff --git a/src/splash_taranis.lbm b/src/bitmaps/splash_taranis.lbm similarity index 100% rename from src/splash_taranis.lbm rename to src/bitmaps/splash_taranis.lbm diff --git a/src/splash_taranis.png b/src/bitmaps/splash_taranis.png similarity index 100% rename from src/splash_taranis.png rename to src/bitmaps/splash_taranis.png diff --git a/src/sticks.lbm b/src/bitmaps/sticks.lbm similarity index 100% rename from src/sticks.lbm rename to src/bitmaps/sticks.lbm diff --git a/src/sticks_4x1.xbm b/src/bitmaps/sticks_4x1.xbm similarity index 100% rename from src/sticks_4x1.xbm rename to src/bitmaps/sticks_4x1.xbm diff --git a/src/menu_general.cpp b/src/gui/menu_general.cpp similarity index 97% rename from src/menu_general.cpp rename to src/gui/menu_general.cpp index 239113a6f..0fdbe92b6 100644 --- a/src/menu_general.cpp +++ b/src/gui/menu_general.cpp @@ -37,7 +37,7 @@ #include "opentx.h" const pm_uchar sticks[] PROGMEM = { -#include "sticks.lbm" +#include "bitmaps/sticks.lbm" }; enum EnumTabDiag { diff --git a/src/menu_model.cpp b/src/gui/menu_model.cpp similarity index 98% rename from src/menu_model.cpp rename to src/gui/menu_model.cpp index 2976537f2..4923cf07b 100644 --- a/src/menu_model.cpp +++ b/src/gui/menu_model.cpp @@ -853,18 +853,22 @@ enum menuModelSetupItems { ITEM_MODEL_TRAINER_MODE, ITEM_MODEL_TRAINER_CHANNELS, ITEM_MODEL_TRAINER_SETTINGS, +#elif defined(PCBSKY9X) + ITEM_MODEL_PPM1_PROTOCOL, + ITEM_MODEL_PPM1_PARAMS, + ITEM_MODEL_PPM2_PROTOCOL, + ITEM_MODEL_PPM2_PARAMS, #else - ITEM_MODEL_PROTOCOL, - IF_PCBSKY9X(ITEM_MODEL_PPM2_PROTOCOL) - ITEM_MODEL_PROTOCOL_PARAMS, + ITEM_MODEL_PPM1_PROTOCOL, + ITEM_MODEL_PPM1_PARAMS, #endif ITEM_MODEL_SETUP_MAX }; #if defined(PCBSKY9X) -#define FIELD_PROTOCOL_MAX 2 + #define FIELD_PROTOCOL_MAX 2 #else -#define FIELD_PROTOCOL_MAX 1 + #define FIELD_PROTOCOL_MAX 1 #endif #if LCD_W >= 212 @@ -923,11 +927,11 @@ void menuModelSetup(uint8_t event) #elif defined(CPUM64) #define CURSOR_ON_CELL (true) uint8_t protocol = g_model.protocol; - MENU(STR_MENUSETUP, menuTabModel, e_ModelSetup, ((IS_PPM_PROTOCOL(protocol)||IS_DSM2_PROTOCOL(protocol)||IS_PXX_PROTOCOL(protocol)) ? 1+ITEM_MODEL_SETUP_MAX : ITEM_MODEL_SETUP_MAX), { 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1, FIELD_PROTOCOL_MAX, IF_PCBSKY9X(1) 2 }); + MENU(STR_MENUSETUP, menuTabModel, e_ModelSetup, ((IS_PPM_PROTOCOL(protocol)||IS_DSM2_PROTOCOL(protocol)||IS_PXX_PROTOCOL(protocol)) ? 1+ITEM_MODEL_SETUP_MAX : ITEM_MODEL_SETUP_MAX), { 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1, FIELD_PROTOCOL_MAX, 2 }); #else #define CURSOR_ON_CELL (true) uint8_t protocol = g_model.protocol; - MENU(STR_MENUSETUP, menuTabModel, e_ModelSetup, ((IS_PPM_PROTOCOL(protocol)||IS_DSM2_PROTOCOL(protocol)||IS_PXX_PROTOCOL(protocol)) ? 1+ITEM_MODEL_SETUP_MAX : ITEM_MODEL_SETUP_MAX), { 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1, FIELD_PROTOCOL_MAX, IF_PCBSKY9X(1) 2 }); + MENU(STR_MENUSETUP, menuTabModel, e_ModelSetup, ((IS_PPM_PROTOCOL(protocol)||IS_DSM2_PROTOCOL(protocol)||IS_PXX_PROTOCOL(protocol)) ? 1+ITEM_MODEL_SETUP_MAX : ITEM_MODEL_SETUP_MAX), { 0, 0, CASE_PCBTARANIS(0) 2, IF_PERSISTENT_TIMERS(0) 0, 0, 2, IF_PERSISTENT_TIMERS(0) 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, NUM_STICKS+NUM_POTS+NUM_ROTARY_ENCODERS-1, FIELD_PROTOCOL_MAX, 2, IF_PCBSKY9X(1) IF_PCBSKY9X(2) }); #endif uint8_t sub = m_posVert - 1; @@ -1326,7 +1330,7 @@ void menuModelSetup(uint8_t event) #else - case ITEM_MODEL_PROTOCOL: + case ITEM_MODEL_PPM1_PROTOCOL: #if defined(PCBSKY9X) lcd_putsLeft(y, PSTR("Port1")); #else @@ -1361,7 +1365,7 @@ void menuModelSetup(uint8_t event) case 1: #if defined(PCBSKY9X) CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[0].channelsStart, 32-8-g_model.moduleData[0].channelsCount); - g_model.moduleData[0].ppmFrameLength = NUM_PORT1_CHANNELS()>NUM_PORT2_CHANNELS() ? 4*(NUM_PORT1_CHANNELS()-8) : 4*(NUM_PORT2_CHANNELS()-8); + g_model.moduleData[0].ppmFrameLength = 4*(NUM_PORT1_CHANNELS()-8); #else CHECK_INCDEC_MODELVAR(event, g_model.ppmNCH, -2, 4); g_model.ppmFrameLength = g_model.ppmNCH * 8; @@ -1371,7 +1375,7 @@ void menuModelSetup(uint8_t event) case 2: if (IS_PPM_PROTOCOL(protocol)) { CHECK_INCDEC_MODELVAR(event, g_model.moduleData[0].channelsCount, -4, min(8, 32-8-g_model.moduleData[0].channelsStart)); - g_model.moduleData[0].ppmFrameLength = NUM_PORT1_CHANNELS()>NUM_PORT2_CHANNELS() ? 4*(NUM_PORT1_CHANNELS()-8) : 4*(NUM_PORT2_CHANNELS()-8); + g_model.moduleData[0].ppmFrameLength = 4*(NUM_PORT1_CHANNELS()-8); } else REPEAT_LAST_CURSOR_MOVE(); @@ -1393,19 +1397,41 @@ void menuModelSetup(uint8_t event) switch (m_posHorz) { case 0: CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].channelsStart, 32-8-g_model.moduleData[1].channelsCount); - g_model.moduleData[1].ppmFrameLength = NUM_PORT1_CHANNELS()>NUM_PORT2_CHANNELS() ? 4*(NUM_PORT1_CHANNELS()-8) : 4*(NUM_PORT2_CHANNELS()-8); + g_model.moduleData[1].ppmFrameLength = 4*(NUM_PORT2_CHANNELS()-8); break; case 1: - CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].channelsCount, -4, min(8, 32-g_model.moduleData[1].channelsStart)-8); - g_model.moduleData[1].ppmFrameLength = NUM_PORT1_CHANNELS()>NUM_PORT2_CHANNELS() ? 4*(NUM_PORT1_CHANNELS()-8) : 4*(NUM_PORT2_CHANNELS()-8); + CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].channelsCount, -4, min(8, 32-8-g_model.moduleData[1].channelsStart)); + g_model.moduleData[1].ppmFrameLength = 4*(NUM_PORT2_CHANNELS()-8); + break; + } + } + break; + + case ITEM_MODEL_PPM2_PARAMS: + lcd_putsLeft(y, STR_PPMFRAME); + lcd_puts(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS); + lcd_outdezAtt(MODEL_SETUP_2ND_COLUMN, y, (int16_t)g_model.moduleData[1].ppmFrameLength*5 + 225, (m_posHorz<=0 ? attr : 0) | PREC1|LEFT); + lcd_putc(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, 'u'); + lcd_outdezAtt(MODEL_SETUP_2ND_COLUMN+8*FW+2, y, (g_model.moduleData[1].ppmDelay*50)+300, (m_posHorz < 0 || m_posHorz==1) ? attr : 0); + lcd_putcAtt(MODEL_SETUP_2ND_COLUMN+10*FW, y, g_model.moduleData[1].ppmPulsePol ? '+' : '-', (m_posHorz < 0 || m_posHorz==2) ? attr : 0); + if (attr && (editMode>0 || p1valdiff)) { + switch (m_posHorz) { + case 0: + CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmFrameLength, -20, 35); + break; + case 1: + CHECK_INCDEC_MODELVAR(event, g_model.moduleData[1].ppmDelay, -4, 10); + break; + case 2: + CHECK_INCDEC_MODELVAR_ZERO(event, g_model.moduleData[1].ppmPulsePol, 1); break; } } break; #endif + case ITEM_MODEL_PPM1_PARAMS: #if defined(PCBSKY9X) - case ITEM_MODEL_PROTOCOL_PARAMS: if (IS_PPM_PROTOCOL(protocol)) { lcd_putsLeft(y, STR_PPMFRAME); lcd_puts(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS); @@ -1428,7 +1454,6 @@ void menuModelSetup(uint8_t event) } } #else - case ITEM_MODEL_PROTOCOL_PARAMS: if (IS_PPM_PROTOCOL(protocol)) { lcd_putsLeft(y, STR_PPMFRAME); lcd_puts(MODEL_SETUP_2ND_COLUMN+3*FW, y, STR_MS); diff --git a/src/menus.cpp b/src/gui/menus.cpp similarity index 100% rename from src/menus.cpp rename to src/gui/menus.cpp diff --git a/src/menus.h b/src/gui/menus.h similarity index 97% rename from src/menus.h rename to src/gui/menus.h index 175f66c5b..8df43b7b8 100644 --- a/src/menus.h +++ b/src/gui/menus.h @@ -39,15 +39,6 @@ #define NO_HI_LEN 25 -// RESX range is used for internal calculation; The menu says -100.0 to 100.0; internally it is -1024 to 1024 to allow some optimizations -#define RESX_SHIFT 10 -#define RESX 1024 -#define RESXu 1024u -#define RESXul 1024ul -#define RESXl 1024l -#define RESKul 100ul -#define RESX_PLUS_TRIM (RESX+128) - typedef void (*MenuFuncP)(uint8_t event); void displayScreenIndex(uint8_t index, uint8_t count, uint8_t attr); diff --git a/src/view_channels.cpp b/src/gui/view_channels.cpp similarity index 100% rename from src/view_channels.cpp rename to src/gui/view_channels.cpp diff --git a/src/view_main.cpp b/src/gui/view_main.cpp similarity index 96% rename from src/view_main.cpp rename to src/gui/view_main.cpp index 45c1f41eb..5e711e63a 100644 --- a/src/view_main.cpp +++ b/src/gui/view_main.cpp @@ -98,11 +98,11 @@ #if defined(PCBTARANIS) const pm_uchar logo_taranis[] PROGMEM = { - #include "logo_taranis.lbm" + #include "bitmaps/logo_taranis.lbm" }; const pm_uchar icons[] PROGMEM = { - #include "icons.lbm" + #include "bitmaps/icons.lbm" }; #define ICON_RSSI 0, 9 diff --git a/src/view_statistics.cpp b/src/gui/view_statistics.cpp similarity index 100% rename from src/view_statistics.cpp rename to src/gui/view_statistics.cpp diff --git a/src/view_telemetry.cpp b/src/gui/view_telemetry.cpp similarity index 99% rename from src/view_telemetry.cpp rename to src/gui/view_telemetry.cpp index 6a48a85f8..0541192f7 100644 --- a/src/view_telemetry.cpp +++ b/src/gui/view_telemetry.cpp @@ -35,7 +35,6 @@ */ #include "opentx.h" -#include "menus.h" #if defined(FRSKY_HUB) uint8_t barsThresholds[THLD_MAX]; diff --git a/src/opentx.cpp b/src/opentx.cpp index 5b4ce6e3e..e7fc0d766 100644 --- a/src/opentx.cpp +++ b/src/opentx.cpp @@ -73,9 +73,9 @@ OS_MutexID mixerMutex; #if defined(SPLASH) const pm_uchar splashdata[] PROGMEM = { 'S','P','S',0, #if defined(PCBTARANIS) -#include "splash_taranis.lbm" +#include "bitmaps/splash_taranis.lbm" #else -#include "splash_9x.lbm" +#include "bitmaps/splash_9x.lbm" #endif 'S','P','E',0}; const pm_uchar * splash_lbm = splashdata+4; @@ -83,11 +83,11 @@ const pm_uchar * splash_lbm = splashdata+4; #if !defined(CPUM64) || defined(EXTSTD) const pm_uchar asterisk_lbm[] PROGMEM = { -#include "asterisk.lbm" +#include "bitmaps/asterisk.lbm" }; #endif -#include "menus.h" +#include "gui/menus.h" EEGeneral g_eeGeneral; ModelData g_model; @@ -279,7 +279,7 @@ void per10ms() } #endif -#if defined(FRSKY) +#if defined(FRSKY) || defined(JETI) if (!IS_DSM2_SERIAL_PROTOCOL(s_current_protocol)) telemetryInterrupt10ms(); #endif @@ -3586,7 +3586,7 @@ void perMain() checkBacklight(); -#if defined(FRSKY) +#if defined(FRSKY) || defined(MAVLINK) telemetryWakeup(); #endif diff --git a/src/opentx.h b/src/opentx.h index 3e28e93ec..dbd259128 100644 --- a/src/opentx.h +++ b/src/opentx.h @@ -207,14 +207,21 @@ #define CONVERT_PTR(x) ((uint32_t)(x)) #endif +// RESX range is used for internal calculation; The menu says -100.0 to 100.0; internally it is -1024 to 1024 to allow some optimizations +#define RESX_SHIFT 10 +#define RESX 1024 +#define RESXu 1024u +#define RESXul 1024ul +#define RESXl 1024l + #if defined(PCBTARANIS) - #include "taranis/board_taranis.h" + #include "targets/taranis/board_taranis.h" #elif defined(PCBSKY9X) - #include "sky9x/board_sky9x.h" + #include "targets/sky9x/board_sky9x.h" #elif defined(PCBGRUVIN9X) - #include "gruvin9x/board_gruvin9x.h" + #include "targets/gruvin9x/board_gruvin9x.h" #else - #include "stock/board_stock.h" + #include "targets/stock/board_stock.h" #endif #include "debug.h" @@ -409,9 +416,9 @@ enum EnumKeys { #endif #if defined(CPUARM) - #include "pulses_arm.h" + #include "protocols/pulses_arm.h" #else - #include "pulses_avr.h" + #include "protocols/pulses_avr.h" #endif #if defined(PCBTARANIS) @@ -471,7 +478,7 @@ enum EnumKeys { #endif #include "lcd.h" -#include "menus.h" +#include "gui/menus.h" #if defined(TEMPLATES) #include "templates.h" @@ -1155,23 +1162,23 @@ inline bool isFunctionActive(uint8_t func) #if defined(FRSKY_SPORT) // FrSky SPORT Telemetry - #include "telemetry_sport.h" + #include "telemetry/frsky_sport.h" #elif defined (FRSKY) // FrSky Telemetry - #include "telemetry_frsky.h" + #include "telemetry/frsky.h" #elif defined(JETI) // Jeti-DUPLEX Telemetry - #include "telemetry_jeti.h" + #include "telemetry/jeti.h" #elif defined(ARDUPILOT) // ArduPilot Telemetry - #include "telemetry_ardupilot.h" + #include "telemetry/ardupilot.h" #elif defined(NMEA) // NMEA Telemetry - #include "telemetry_nmea.h" + #include "telemetry/nmea.h" #elif defined(MAVLINK) // Mavlink Telemetry #include "rotarysw.h" - #include "telemetry_mavlink.h" + #include "telemetry/mavlink.h" #endif #define PLAY_REPEAT(x) (x) /* Range 0 to 15 */ @@ -1249,11 +1256,11 @@ enum AUDIO_SOUNDS { #endif #if defined(PCBSTD) && defined(VOICE) -#include "stock/voice.h" +#include "targets/stock/voice.h" #endif #if defined(PCBGRUVIN9X) && defined(VOICE) -#include "gruvin9x/somo14d.h" +#include "targets/gruvin9x/somo14d.h" #endif #include "translations.h" diff --git a/src/protocols/dsm2_arm.cpp b/src/protocols/dsm2_arm.cpp new file mode 100644 index 000000000..6bafa6669 --- /dev/null +++ b/src/protocols/dsm2_arm.cpp @@ -0,0 +1,134 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "opentx.h" + +uint8_t Bit_pulses[64] ; // Likely more than we need +uint8_t *Pulses2MHzptr ; +uint8_t Serial_byte ; +uint8_t Serial_bit_count; +uint8_t Serial_byte_count ; + +// DSM2 control bits +#define DSM2_CHANS 6 +#define BIND_BIT 0x80 +#define RANGECHECK_BIT 0x20 +#define FRANCE_BIT 0x10 +#define DSMX_BIT 0x08 +#define BAD_DATA 0x47 + +#define BITLEN_DSM2 (8*2) //125000 Baud => 8uS per bit + +void put_serial_bit(uint8_t bit) +{ + Serial_byte >>= 1 ; + if (bit & 1) + { + Serial_byte |= 0x80 ; + } + if (++Serial_bit_count >= 8) + { + *Pulses2MHzptr++ = Serial_byte ; + Serial_bit_count = 0 ; + Serial_byte_count += 1 ; + } +} + +void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1 +{ + put_serial_bit(0) ; // Start bit + for(uint8_t i=0; i<8; i++) // 8 data Bits + { + put_serial_bit(b & 1) ; + b >>= 1 ; + } + + put_serial_bit(1) ; // Stop bit + put_serial_bit(1) ; // Stop bit +} + +// This is the data stream to send, prepare after 19.5 mS +// Send after 22.5 mS + +//static uint8_t *Dsm2_pulsePtr = pulses2MHz.pbyte ; +void setupPulsesDsm2(uint8_t chns) +{ + static uint8_t dsmDat[2+6*2]={0xFF,0x00, 0x00,0xAA, 0x05,0xFF, 0x09,0xFF, 0x0D,0xFF, 0x13,0x54, 0x14,0xAA}; + uint8_t counter ; + // CSwData &cs = g_model.customSw[NUM_CSW-1]; + + Serial_byte = 0 ; + Serial_bit_count = 0 ; + Serial_byte_count = 0 ; + Pulses2MHzptr = Bit_pulses ; + + // If more channels needed make sure the pulses union/array is large enough + if (dsmDat[0]&BAD_DATA) //first time through, setup header + { + switch(s_current_protocol[0]) + { + case PROTO_DSM2_LP45: + dsmDat[0]= 0x80; + break; + case PROTO_DSM2_DSM2: + dsmDat[0]=0x90; + break; + default: + dsmDat[0]=0x98; //dsmx, bind mode + break; + } + } + if ((dsmDat[0] & BIND_BIT) && (!switchState(SW_TRN))) dsmDat[0] &= ~BIND_BIT; // clear bind bit if trainer not pulled + + // TODO find a way to do that, FUNC SWITCH: if ((!(dsmDat[0] & BIND_BIT)) && getSwitch(MAX_DRSWITCH-1, 0, 0)) dsmDat[0] |= RANGECHECK_BIT; // range check function + // else dsmDat[0] &= ~RANGECHECK_BIT; + dsmDat[1]=g_eeGeneral.currModel+1; //DSM2 Header second byte for model match + for(uint8_t i=0; i>5)+512,1023); + dsmDat[2+2*i] = (i<<2) | ((pulse>>8)&0x03); + dsmDat[3+2*i] = pulse & 0xff; + } + + for (counter = 0 ; counter < 14 ; counter += 1) + { + sendByteDsm2(dsmDat[counter]); + } + for (counter = 0 ; counter < 16 ; counter += 1) + { + put_serial_bit(1) ; // 16 extra stop bits + } +} diff --git a/src/protocols/ppm_arm.cpp b/src/protocols/ppm_arm.cpp new file mode 100644 index 000000000..352f12d57 --- /dev/null +++ b/src/protocols/ppm_arm.cpp @@ -0,0 +1,95 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "opentx.h" + +#if defined(PCBTARANIS) +// TODO internal module doesn't send PPM +uint16_t ppmStream[NUM_MODULES+1][20] = { { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; +#else +uint16_t ppmStream[NUM_MODULES][20] = { MODULES_INIT({ 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) }; +#endif + +void setupPulsesPPM(unsigned int port) // Don't enable interrupts through here +{ + int16_t PPM_range = g_model.extendedLimits ? 640 * 2 : 512 * 2; //range of 0.7..1.7msec + + // Total frame length = 22.5msec + // each pulse is 0.7..1.7ms long with a 0.3ms stop tail + // The pulse ISR is 2mhz that's why everything is multiplied by 2 + + uint32_t firstCh = g_model.moduleData[port].channelsStart; + uint32_t lastCh = min(NUM_CHNOUT, firstCh + 8 + g_model.moduleData[port].channelsCount); + +#if defined(PCBSKY9X) + register Pwm *pwmptr = PWM; + uint32_t pwmCh = (port == 0 ? 3 : 1); + pwmptr->PWM_CH_NUM[pwmCh].PWM_CDTYUPD = (g_model.moduleData[port].ppmDelay * 50 + 300) * 2; //Stoplen *2 + if (g_model.moduleData[port].ppmPulsePol) + pwmptr->PWM_CH_NUM[pwmCh].PWM_CMR |= 0x00000200 ; // CPOL + else + pwmptr->PWM_CH_NUM[pwmCh].PWM_CMR &= ~0x00000200 ; // CPOL +#endif + + uint16_t * ptr = ppmStream[port]; + uint32_t rest = 22500u * 2; //Minimum Framelen=22.5 ms + rest += (int32_t(g_model.moduleData[port].ppmFrameLength)) * 1000; + for (uint32_t i=firstCh; i 65535) ? 65535 : rest; + *ptr = rest; + *(ptr + 1) = 0; + +#if defined(PCBTARANIS) + if (port == TRAINER_MODULE) { + TIM3->CCR2 = rest - 1000 ; // Update time + TIM3->CCR4 = (g_model.moduleData[port].ppmDelay*50+300)*2; + } + else if (port == EXTERNAL_MODULE) { + TIM8->CCR2 = rest - 1000; // Update time + TIM8->CCR1 = (g_model.moduleData[port].ppmDelay*50+300)*2; + } + else { + TIM1->CCR2 = rest - 1000; // Update time + TIM1->CCR3 = (g_model.moduleData[port].ppmDelay*50+300)*2; + } +#endif +} diff --git a/src/protocols/pulses_arm.cpp b/src/protocols/pulses_arm.cpp new file mode 100644 index 000000000..ed3a64b35 --- /dev/null +++ b/src/protocols/pulses_arm.cpp @@ -0,0 +1,154 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "opentx.h" + +uint8_t s_pulses_paused = 0; +uint8_t s_current_protocol[NUM_MODULES] = { MODULES_INIT(255) }; +uint32_t failsafeCounter[NUM_MODULES] = { MODULES_INIT(100) }; + +void setupPulses(unsigned int port) +{ + heartbeat |= (HEART_TIMER_PULSES << port); + +#if defined(PCBTARANIS) + if (port) port = 1; // Ensure is 0 or 1 only + uint8_t required_protocol; + + if (port == INTERNAL_MODULE) { + required_protocol = g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF ? PROTO_NONE : PROTO_PXX; + } + else { + switch (g_model.externalModule) { + case MODULE_TYPE_PPM: + required_protocol = PROTO_PPM; + break; + case MODULE_TYPE_XJT: + case MODULE_TYPE_DJT: + required_protocol = PROTO_PXX; + break; + default: + required_protocol = PROTO_NONE; + break; + } + } +#else + uint8_t required_protocol = g_model.protocol; +#endif + + if (s_pulses_paused) + required_protocol = PROTO_NONE; + + if (s_current_protocol[port] != required_protocol) { + + switch (s_current_protocol[port]) { // stop existing protocol hardware + case PROTO_PXX: +#if defined(PCBTARANIS) + disable_pxx(port); +#else + disable_pxx(); +#endif + break; +#if defined(DSM2) + case PROTO_DSM2_LP45: + case PROTO_DSM2_DSM2: + case PROTO_DSM2_DSMX: + disable_ssc(); + break; +#endif + default: +#if defined(PCBTARANIS) + disable_ppm(port); +#else + disable_main_ppm(); +#endif + break; + } + + s_current_protocol[port] = required_protocol; + +#if defined(PCBTARANIS) + switch (required_protocol) { + case PROTO_PXX: + init_pxx(port); + break; + case PROTO_PPM: + init_ppm(port); + break; + } +#elif defined(PCBSKY9X) + switch (required_protocol) { // Start new protocol hardware here + case PROTO_PXX: + init_main_ppm(5000, 0); // Initial period 2.5 mS, output off + init_ssc(); + break; + case PROTO_DSM2_LP45: + case PROTO_DSM2_DSM2: + case PROTO_DSM2_DSMX: + init_main_ppm(5000, 0); // Initial period 2.5 mS, output off + init_ssc(); + break; + case PROTO_NONE: + init_main_ppm(3000, 0); // Initial period 1.5 mS, output off + break; + default: + init_main_ppm(3000, 1); // Initial period 1.5 mS, output on + break; + } +#endif + } + + // Set up output data here + switch (required_protocol) { + case PROTO_PXX: + setupPulsesPXX(port); + break; +#if defined(DSM2) + case PROTO_DSM2_LP45: + case PROTO_DSM2_DSM2: + case PROTO_DSM2_DSMX: + setupPulsesDsm2(6); + break; +#endif +#if defined(PCBTARANIS) + case PROTO_PPM: +#else + default: +#endif + setupPulsesPPM(port); // Don't enable interrupts through here + break ; + } +} diff --git a/src/pulses_arm.h b/src/protocols/pulses_arm.h similarity index 94% rename from src/pulses_arm.h rename to src/protocols/pulses_arm.h index aa534a04b..2f3959035 100644 --- a/src/pulses_arm.h +++ b/src/protocols/pulses_arm.h @@ -37,6 +37,12 @@ #ifndef pulses_arm_h #define pulses_arm_h +#if NUM_MODULES == 2 + #define MODULES_INIT(...) __VA_ARGS__, __VA_ARGS__ +#else + #define MODULES_INIT(...) __VA_ARGS__ +#endif + extern uint8_t s_current_protocol[NUM_MODULES]; extern uint8_t s_pulses_paused; extern uint32_t failsafeCounter[NUM_MODULES]; diff --git a/src/pulses_avr.cpp b/src/protocols/pulses_avr.cpp similarity index 100% rename from src/pulses_avr.cpp rename to src/protocols/pulses_avr.cpp diff --git a/src/pulses_avr.h b/src/protocols/pulses_avr.h similarity index 100% rename from src/pulses_avr.h rename to src/protocols/pulses_avr.h diff --git a/src/protocols/pxx_arm.cpp b/src/protocols/pxx_arm.cpp new file mode 100644 index 000000000..a011fc182 --- /dev/null +++ b/src/protocols/pxx_arm.cpp @@ -0,0 +1,233 @@ +/* + * Authors (alphabetical order) + * - Andre Bernet + * - Andreas Weitl + * - Bertrand Songis + * - Bryan J. Rentoul (Gruvin) + * - Cameron Weeks + * - Erez Raviv + * - Gabriel Birkus + * - Jean-Pierre Parisy + * - Karl Szmutny + * - Michael Blandford + * - Michal Hlavinka + * - Pat Mackenzie + * - Philip Moss + * - Rob Thomson + * - Romolo Manfredini + * - Thomas Husterer + * + * opentx is based on code named + * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, + * er9x by Erez Raviv: http://code.google.com/p/er9x/, + * and the original (and ongoing) project by + * Thomas Husterer, th9x: http://code.google.com/p/th9x/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +#include "opentx.h" + +uint8_t pxxFlag[NUM_MODULES] = { MODULES_INIT(0) }; +uint16_t pxxStream[NUM_MODULES][400]; // Transitions +uint16_t *pxxStreamPtr[NUM_MODULES]; +uint16_t PxxValue[NUM_MODULES]; +uint16_t PcmCrc[NUM_MODULES]; +uint8_t PcmOnesCount[NUM_MODULES]; + +const uint16_t CRCTable[]= +{ + 0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf, + 0x8c48,0x9dc1,0xaf5a,0xbed3,0xca6c,0xdbe5,0xe97e,0xf8f7, + 0x1081,0x0108,0x3393,0x221a,0x56a5,0x472c,0x75b7,0x643e, + 0x9cc9,0x8d40,0xbfdb,0xae52,0xdaed,0xcb64,0xf9ff,0xe876, + 0x2102,0x308b,0x0210,0x1399,0x6726,0x76af,0x4434,0x55bd, + 0xad4a,0xbcc3,0x8e58,0x9fd1,0xeb6e,0xfae7,0xc87c,0xd9f5, + 0x3183,0x200a,0x1291,0x0318,0x77a7,0x662e,0x54b5,0x453c, + 0xbdcb,0xac42,0x9ed9,0x8f50,0xfbef,0xea66,0xd8fd,0xc974, + 0x4204,0x538d,0x6116,0x709f,0x0420,0x15a9,0x2732,0x36bb, + 0xce4c,0xdfc5,0xed5e,0xfcd7,0x8868,0x99e1,0xab7a,0xbaf3, + 0x5285,0x430c,0x7197,0x601e,0x14a1,0x0528,0x37b3,0x263a, + 0xdecd,0xcf44,0xfddf,0xec56,0x98e9,0x8960,0xbbfb,0xaa72, + 0x6306,0x728f,0x4014,0x519d,0x2522,0x34ab,0x0630,0x17b9, + 0xef4e,0xfec7,0xcc5c,0xddd5,0xa96a,0xb8e3,0x8a78,0x9bf1, + 0x7387,0x620e,0x5095,0x411c,0x35a3,0x242a,0x16b1,0x0738, + 0xffcf,0xee46,0xdcdd,0xcd54,0xb9eb,0xa862,0x9af9,0x8b70, + 0x8408,0x9581,0xa71a,0xb693,0xc22c,0xd3a5,0xe13e,0xf0b7, + 0x0840,0x19c9,0x2b52,0x3adb,0x4e64,0x5fed,0x6d76,0x7cff, + 0x9489,0x8500,0xb79b,0xa612,0xd2ad,0xc324,0xf1bf,0xe036, + 0x18c1,0x0948,0x3bd3,0x2a5a,0x5ee5,0x4f6c,0x7df7,0x6c7e, + 0xa50a,0xb483,0x8618,0x9791,0xe32e,0xf2a7,0xc03c,0xd1b5, + 0x2942,0x38cb,0x0a50,0x1bd9,0x6f66,0x7eef,0x4c74,0x5dfd, + 0xb58b,0xa402,0x9699,0x8710,0xf3af,0xe226,0xd0bd,0xc134, + 0x39c3,0x284a,0x1ad1,0x0b58,0x7fe7,0x6e6e,0x5cf5,0x4d7c, + 0xc60c,0xd785,0xe51e,0xf497,0x8028,0x91a1,0xa33a,0xb2b3, + 0x4a44,0x5bcd,0x6956,0x78df,0x0c60,0x1de9,0x2f72,0x3efb, + 0xd68d,0xc704,0xf59f,0xe416,0x90a9,0x8120,0xb3bb,0xa232, + 0x5ac5,0x4b4c,0x79d7,0x685e,0x1ce1,0x0d68,0x3ff3,0x2e7a, + 0xe70e,0xf687,0xc41c,0xd595,0xa12a,0xb0a3,0x8238,0x93b1, + 0x6b46,0x7acf,0x4854,0x59dd,0x2d62,0x3ceb,0x0e70,0x1ff9, + 0xf78f,0xe606,0xd49d,0xc514,0xb1ab,0xa022,0x92b9,0x8330, + 0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78 +}; + +void crc(uint8_t data, unsigned int port) +{ + PcmCrc[port]=(PcmCrc[port]<<8)^(CRCTable[((PcmCrc[port]>>8)^data) & 0xFF]); +} + +void putPcmPart(uint8_t value, unsigned int port) +{ + PxxValue[port] += 18 ; // Output 1 for this time + *pxxStreamPtr[port]++ = PxxValue[port] ; + PxxValue[port] += 14 ; + if (value) { + PxxValue[port] += 16 ; + } + *pxxStreamPtr[port]++ = PxxValue[port] ; // Output 0 for this time +} + +void putPcmFlush(unsigned int port) +{ + *pxxStreamPtr[port]++ = 18010 ; // Past the 18000 of the ARR +} + +void putPcmBit(uint8_t bit, unsigned int port) +{ + if (bit) { + PcmOnesCount[port] += 1; + putPcmPart(1, port); + } + else { + PcmOnesCount[port] = 0; + putPcmPart(0, port); + } + if (PcmOnesCount[port] >= 5) { + putPcmBit(0, port); // Stuff a 0 bit in + } +} + +void putPcmByte(uint8_t byte, unsigned int port) +{ + crc(byte, port); + + for (uint8_t i=0; i<8; i++) { + putPcmBit(byte & 0x80, port); + byte <<= 1; + } +} + +void putPcmHead(unsigned int port) +{ + // send 7E, do not CRC + // 01111110 + putPcmPart(0, port); + putPcmPart(1, port); + putPcmPart(1, port); + putPcmPart(1, port); + putPcmPart(1, port); + putPcmPart(1, port); + putPcmPart(1, port); + putPcmPart(0, port); +} + +void setupPulsesPXX(unsigned int port) +{ + uint16_t chan=0, chan_low=0; + + pxxStreamPtr[port] = pxxStream[port]; + PxxValue[port] = 0 ; + PcmCrc[port] = 0; + PcmOnesCount[port] = 0; + + /* Sync */ + putPcmHead(port); + + /* Rx Number */ + putPcmByte(g_model.header.modelId, port); + + /* FLAG1 */ + uint8_t flag1; + if (pxxFlag[port] & PXX_SEND_RXNUM) { + flag1 = (g_model.moduleData[port].rfProtocol << 6) | (g_eeGeneral.countryCode << 1) | pxxFlag[port]; + } + else { + flag1 = (g_model.moduleData[port].rfProtocol << 6) | pxxFlag[port]; + + if (g_model.moduleData[port].failsafeMode != FAILSAFE_HOLD) { + if (failsafeCounter[port]-- == 0) { + failsafeCounter[port] = 1000; + flag1 |= PXX_SEND_FAILSAFE; + } + if (failsafeCounter[port] == 0 && g_model.moduleData[port].channelsCount > 0) { + flag1 |= PXX_SEND_FAILSAFE; + } + } + } + + putPcmByte(flag1, port); + + /* FLAG2 */ + putPcmByte(0, port); + + /* PPM */ + static uint32_t pass[NUM_MODULES] = { MODULES_INIT(0) }; + uint32_t sendUpperChannels = 0; + if (pass[port]++ & 0x01) { + sendUpperChannels = g_model.moduleData[port].channelsCount; + } + for (uint32_t i=0; i<8; i++) { + if (flag1 & PXX_SEND_FAILSAFE) { + if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) { + if (i < sendUpperChannels) + chan = 3072; + else + chan = 1024; + } + else { + if (i < sendUpperChannels) { + chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (g_model.moduleData[port].failsafeChannels[8+g_model.moduleData[port].channelsStart+i] * 512 / 682) + 3072, 4095); + if (chan == 3072) chan = 3073; + } + else { + chan = limit(0, PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (g_model.moduleData[port].failsafeChannels[g_model.moduleData[port].channelsStart+i] * 512 / 682) + 1024, 2047); + if (chan == 1024) chan = 1025; + } + } + } + else { + if (i < sendUpperChannels) + chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[8+g_model.moduleData[port].channelsStart+i] * 512 / 682) + 3072, 4095); + else + chan = limit(0, PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[g_model.moduleData[port].channelsStart+i] * 512 / 682) + 1024, 2047); + } + + if (i & 1) { + putPcmByte(chan_low, port); // Low byte of channel + putPcmByte(((chan_low >> 8) & 0x0F) | (chan << 4), port); // 4 bits each from 2 channels + putPcmByte(chan >> 4, port); // High byte of channel + } + else { + chan_low = chan; + } + } + + /* CRC16 */ + putPcmByte(0, port); + chan = PcmCrc[port]; + putPcmByte(chan>>8, port); + putPcmByte(chan, port); + + /* Sync */ + putPcmHead(port); + + putPcmFlush(port); +} diff --git a/src/pulses_arm.cpp b/src/pulses_arm.cpp deleted file mode 100644 index e421bb2d6..000000000 --- a/src/pulses_arm.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* - * Authors (alphabetical order) - * - Andre Bernet - * - Andreas Weitl - * - Bertrand Songis - * - Bryan J. Rentoul (Gruvin) - * - Cameron Weeks - * - Erez Raviv - * - Gabriel Birkus - * - Jean-Pierre Parisy - * - Karl Szmutny - * - Michael Blandford - * - Michal Hlavinka - * - Pat Mackenzie - * - Philip Moss - * - Rob Thomson - * - Romolo Manfredini - * - Thomas Husterer - * - * opentx is based on code named - * gruvin9x by Bryan J. Rentoul: http://code.google.com/p/gruvin9x/, - * er9x by Erez Raviv: http://code.google.com/p/er9x/, - * and the original (and ongoing) project by - * Thomas Husterer, th9x: http://code.google.com/p/th9x/ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include "opentx.h" - -#if NUM_MODULES == 2 - #define MODULES_INIT(x) x, x -#else - #define MODULES_INIT(x) x -#endif - -uint8_t s_pulses_paused = 0; -uint8_t s_current_protocol[NUM_MODULES] = { MODULES_INIT(255) }; -uint32_t failsafeCounter[NUM_MODULES] = { MODULES_INIT(100) }; - -uint8_t pxxFlag[NUM_MODULES] = { MODULES_INIT(0) }; -uint16_t pxxStream[NUM_MODULES][400] ; // Transitions -uint16_t *pxxStreamPtr[NUM_MODULES] ; -uint16_t PxxValue[NUM_MODULES] ; -uint16_t PcmCrc[NUM_MODULES] ; -uint8_t PcmOnesCount[NUM_MODULES] ; - -#if NUM_MODULES == 2 -uint16_t ppmStream[NUM_MODULES][20] = { { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -#else -uint16_t ppmStream[NUM_MODULES][20] = { { 2000, 2200, 2400, 2600, 2800, 3000, 3200, 3400, 9000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -#endif - -#if defined(PCBSKY9X) -volatile uint32_t ppmStreamIndex[NUM_MODULES] = { MODULES_INIT(0) }; // Modified in interrupt routine -uint8_t Bit_pulses[64] ; // Likely more than we need -uint8_t *Pulses2MHzptr ; -#endif - -// DSM2 control bits -#define DSM2_CHANS 6 -#define BIND_BIT 0x80 -#define RANGECHECK_BIT 0x20 -#define FRANCE_BIT 0x10 -#define DSMX_BIT 0x08 -#define BAD_DATA 0x47 - -uint8_t Serial_byte ; -uint8_t Serial_bit_count; -uint8_t Serial_byte_count ; - -void setupPulsesPPM(unsigned int port) // Don't enable interrupts through here -{ -#if defined(PCBSKY9X) - register Pwm *pwmptr = PWM; -#endif - - int16_t PPM_range = g_model.extendedLimits ? 640 * 2 : 512 * 2; //range of 0.7..1.7msec - - // Total frame length = 22.5msec - // each pulse is 0.7..1.7ms long with a 0.3ms stop tail - // The pulse ISR is 2mhz that's why everything is multiplied by 2 - - uint32_t firstCh = g_model.moduleData[port].channelsStart; - uint32_t lastCh = min(NUM_CHNOUT, firstCh + 8 + g_model.moduleData[port].channelsCount); - -#if defined(PCBSKY9X) - uint32_t pwmCh; - if (port == 0) { - pwmCh = 3; - } - else { - pwmCh = 1; - } -#endif - uint16_t * ptr = ppmStream[port]; - -#if defined(PCBSKY9X) - pwmptr->PWM_CH_NUM[pwmCh].PWM_CDTYUPD = (g_model.moduleData[port].ppmDelay * 50 + 300) * 2; //Stoplen *2 - if (g_model.moduleData[port].ppmPulsePol) - pwmptr->PWM_CH_NUM[pwmCh].PWM_CMR |= 0x00000200 ; // CPOL - else - pwmptr->PWM_CH_NUM[pwmCh].PWM_CMR &= ~0x00000200 ; // CPOL -#endif - - uint32_t rest = 22500u * 2; //Minimum Framelen=22.5 ms - rest += (int32_t(g_model.moduleData[port].ppmFrameLength)) * 1000; - for (uint32_t i=firstCh; i 65535) ? 65535 : rest; - *ptr = rest; - *(ptr + 1) = 0; - -#if defined(PCBTARANIS) - if (port == EXTERNAL_MODULE) { - TIM8->CCR2 = rest - 1000; // Update time - TIM8->CCR1 = (g_model.moduleData[port].ppmDelay*50+300)*2; - } - else { - TIM1->CCR2 = rest - 1000; // Update time - TIM1->CCR3 = (g_model.moduleData[port].ppmDelay*50+300)*2; - } -#endif -} - -const uint16_t CRCTable[]= -{ - 0x0000,0x1189,0x2312,0x329b,0x4624,0x57ad,0x6536,0x74bf, - 0x8c48,0x9dc1,0xaf5a,0xbed3,0xca6c,0xdbe5,0xe97e,0xf8f7, - 0x1081,0x0108,0x3393,0x221a,0x56a5,0x472c,0x75b7,0x643e, - 0x9cc9,0x8d40,0xbfdb,0xae52,0xdaed,0xcb64,0xf9ff,0xe876, - 0x2102,0x308b,0x0210,0x1399,0x6726,0x76af,0x4434,0x55bd, - 0xad4a,0xbcc3,0x8e58,0x9fd1,0xeb6e,0xfae7,0xc87c,0xd9f5, - 0x3183,0x200a,0x1291,0x0318,0x77a7,0x662e,0x54b5,0x453c, - 0xbdcb,0xac42,0x9ed9,0x8f50,0xfbef,0xea66,0xd8fd,0xc974, - 0x4204,0x538d,0x6116,0x709f,0x0420,0x15a9,0x2732,0x36bb, - 0xce4c,0xdfc5,0xed5e,0xfcd7,0x8868,0x99e1,0xab7a,0xbaf3, - 0x5285,0x430c,0x7197,0x601e,0x14a1,0x0528,0x37b3,0x263a, - 0xdecd,0xcf44,0xfddf,0xec56,0x98e9,0x8960,0xbbfb,0xaa72, - 0x6306,0x728f,0x4014,0x519d,0x2522,0x34ab,0x0630,0x17b9, - 0xef4e,0xfec7,0xcc5c,0xddd5,0xa96a,0xb8e3,0x8a78,0x9bf1, - 0x7387,0x620e,0x5095,0x411c,0x35a3,0x242a,0x16b1,0x0738, - 0xffcf,0xee46,0xdcdd,0xcd54,0xb9eb,0xa862,0x9af9,0x8b70, - 0x8408,0x9581,0xa71a,0xb693,0xc22c,0xd3a5,0xe13e,0xf0b7, - 0x0840,0x19c9,0x2b52,0x3adb,0x4e64,0x5fed,0x6d76,0x7cff, - 0x9489,0x8500,0xb79b,0xa612,0xd2ad,0xc324,0xf1bf,0xe036, - 0x18c1,0x0948,0x3bd3,0x2a5a,0x5ee5,0x4f6c,0x7df7,0x6c7e, - 0xa50a,0xb483,0x8618,0x9791,0xe32e,0xf2a7,0xc03c,0xd1b5, - 0x2942,0x38cb,0x0a50,0x1bd9,0x6f66,0x7eef,0x4c74,0x5dfd, - 0xb58b,0xa402,0x9699,0x8710,0xf3af,0xe226,0xd0bd,0xc134, - 0x39c3,0x284a,0x1ad1,0x0b58,0x7fe7,0x6e6e,0x5cf5,0x4d7c, - 0xc60c,0xd785,0xe51e,0xf497,0x8028,0x91a1,0xa33a,0xb2b3, - 0x4a44,0x5bcd,0x6956,0x78df,0x0c60,0x1de9,0x2f72,0x3efb, - 0xd68d,0xc704,0xf59f,0xe416,0x90a9,0x8120,0xb3bb,0xa232, - 0x5ac5,0x4b4c,0x79d7,0x685e,0x1ce1,0x0d68,0x3ff3,0x2e7a, - 0xe70e,0xf687,0xc41c,0xd595,0xa12a,0xb0a3,0x8238,0x93b1, - 0x6b46,0x7acf,0x4854,0x59dd,0x2d62,0x3ceb,0x0e70,0x1ff9, - 0xf78f,0xe606,0xd49d,0xc514,0xb1ab,0xa022,0x92b9,0x8330, - 0x7bc7,0x6a4e,0x58d5,0x495c,0x3de3,0x2c6a,0x1ef1,0x0f78 -}; - -void crc(uint8_t data, unsigned int port) -{ - PcmCrc[port]=(PcmCrc[port]<<8)^(CRCTable[((PcmCrc[port]>>8)^data) & 0xFF]); -} - -void putPcmPart(uint8_t value, unsigned int port) -{ - PxxValue[port] += 18 ; // Output 1 for this time - *pxxStreamPtr[port]++ = PxxValue[port] ; - PxxValue[port] += 14 ; - if (value) { - PxxValue[port] += 16 ; - } - *pxxStreamPtr[port]++ = PxxValue[port] ; // Output 0 for this time -} - -void putPcmFlush(unsigned int port) -{ - *pxxStreamPtr[port]++ = 18010 ; // Past the 18000 of the ARR -} - -void putPcmBit(uint8_t bit, unsigned int port) -{ - if (bit) - { - PcmOnesCount[port] += 1 ; - putPcmPart(1, port); - } - else - { - PcmOnesCount[port] = 0 ; - putPcmPart(0, port); - } - if (PcmOnesCount[port] >= 5) - { - putPcmBit(0, port); // Stuff a 0 bit in - } -} - -void putPcmByte(uint8_t byte, unsigned int port) -{ - crc(byte, port); - - for (uint8_t i=0; i<8; i++) { - putPcmBit(byte & 0x80, port); - byte <<= 1; - } -} - -void putPcmHead(unsigned int port) -{ - // send 7E, do not CRC - // 01111110 - putPcmPart(0, port); - putPcmPart(1, port); - putPcmPart(1, port); - putPcmPart(1, port); - putPcmPart(1, port); - putPcmPart(1, port); - putPcmPart(1, port); - putPcmPart(0, port); -} - -#if defined(PCBSKY9X) -void put_serial_bit(uint8_t bit) -{ - Serial_byte >>= 1 ; - if (bit & 1) - { - Serial_byte |= 0x80 ; - } - if (++Serial_bit_count >= 8) - { - *Pulses2MHzptr++ = Serial_byte ; - Serial_bit_count = 0 ; - Serial_byte_count += 1 ; - } -} -#endif - -void setupPulsesPXX(unsigned int port) -{ - uint16_t chan=0, chan_low=0; - -#if defined(PCBTARANIS) - pxxStreamPtr[port] = pxxStream[port]; - PxxValue[port] = 0 ; -#endif - - PcmCrc[port] = 0; - PcmOnesCount[port] = 0; - - /* Sync */ - putPcmHead(port); - - /* Rx Number */ - putPcmByte(g_model.header.modelId, port); - - /* FLAG1 */ - uint8_t flag1; - if (pxxFlag[port] & PXX_SEND_RXNUM) { - flag1 = (g_model.moduleData[port].rfProtocol << 6) | (g_eeGeneral.countryCode << 1) | pxxFlag[port]; - } - else { - flag1 = (g_model.moduleData[port].rfProtocol << 6) | pxxFlag[port]; - - if (g_model.moduleData[port].failsafeMode != FAILSAFE_HOLD) { - if (failsafeCounter[port]-- == 0) { - failsafeCounter[port] = 1000; - flag1 |= PXX_SEND_FAILSAFE; - } - if (failsafeCounter[port] == 0 && g_model.moduleData[port].channelsCount > 0) { - flag1 |= PXX_SEND_FAILSAFE; - } - } - } - - putPcmByte(flag1, port); - - /* FLAG2 */ - putPcmByte(0, port); - - /* PPM */ - static uint32_t pass[NUM_MODULES] = {0}; - uint32_t sendUpperChannels = 0; - if (pass[port]++ & 0x01) { - sendUpperChannels = g_model.moduleData[port].channelsCount; - } - for (uint32_t i=0; i<8; i++) { - if (flag1 & PXX_SEND_FAILSAFE) { - if (g_model.moduleData[port].failsafeMode == FAILSAFE_NOPULSES) { - if (i < sendUpperChannels) - chan = 3072; - else - chan = 1024; - } - else { - if (i < sendUpperChannels) { - chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (g_model.moduleData[port].failsafeChannels[8+g_model.moduleData[port].channelsStart+i] * 512 / 682) + 3072, 4095); - if (chan == 3072) chan = 3073; - } - else { - chan = limit(0, PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (g_model.moduleData[port].failsafeChannels[g_model.moduleData[port].channelsStart+i] * 512 / 682) + 1024, 2047); - if (chan == 1024) chan = 1025; - } - } - } - else { - if (i < sendUpperChannels) - chan = limit(2048, PPM_CH_CENTER(8+g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[8+g_model.moduleData[port].channelsStart+i] * 512 / 682) + 3072, 4095); - else - chan = limit(0, PPM_CH_CENTER(g_model.moduleData[port].channelsStart+i) - PPM_CENTER + (channelOutputs[g_model.moduleData[port].channelsStart+i] * 512 / 682) + 1024, 2047); - } - - if (i & 1) { - putPcmByte(chan_low, port); // Low byte of channel - putPcmByte(((chan_low >> 8) & 0x0F) | (chan << 4), port); // 4 bits each from 2 channels - putPcmByte(chan >> 4, port); // High byte of channel - } - else { - chan_low = chan; - } - } - - /* CRC16 */ - putPcmByte(0, port); - chan = PcmCrc[port]; - putPcmByte(chan>>8, port); - putPcmByte(chan, port); - - /* Sync */ - putPcmHead(port); - - putPcmFlush(port); -} - -#if defined(DSM2) -#define BITLEN_DSM2 (8*2) //125000 Baud => 8uS per bit -void sendByteDsm2(uint8_t b) //max 10changes 0 10 10 10 10 1 -{ - put_serial_bit(0) ; // Start bit - for(uint8_t i=0; i<8; i++) // 8 data Bits - { - put_serial_bit(b & 1) ; - b >>= 1 ; - } - - put_serial_bit(1) ; // Stop bit - put_serial_bit(1) ; // Stop bit -} - -// This is the data stream to send, prepare after 19.5 mS -// Send after 22.5 mS - -//static uint8_t *Dsm2_pulsePtr = pulses2MHz.pbyte ; -void setupPulsesDsm2(uint8_t chns) -{ - static uint8_t dsmDat[2+6*2]={0xFF,0x00, 0x00,0xAA, 0x05,0xFF, 0x09,0xFF, 0x0D,0xFF, 0x13,0x54, 0x14,0xAA}; - uint8_t counter ; - // CSwData &cs = g_model.customSw[NUM_CSW-1]; - - Serial_byte = 0 ; - Serial_bit_count = 0 ; - Serial_byte_count = 0 ; - Pulses2MHzptr = Bit_pulses ; - - // If more channels needed make sure the pulses union/array is large enough - if (dsmDat[0]&BAD_DATA) //first time through, setup header - { - switch(s_current_protocol[0]) - { - case PROTO_DSM2_LP45: - dsmDat[0]= 0x80; - break; - case PROTO_DSM2_DSM2: - dsmDat[0]=0x90; - break; - default: - dsmDat[0]=0x98; //dsmx, bind mode - break; - } - } - if ((dsmDat[0] & BIND_BIT) && (!switchState(SW_TRN))) dsmDat[0] &= ~BIND_BIT; // clear bind bit if trainer not pulled - - // TODO find a way to do that, FUNC SWITCH: if ((!(dsmDat[0] & BIND_BIT)) && getSwitch(MAX_DRSWITCH-1, 0, 0)) dsmDat[0] |= RANGECHECK_BIT; // range check function - // else dsmDat[0] &= ~RANGECHECK_BIT; - dsmDat[1]=g_eeGeneral.currModel+1; //DSM2 Header second byte for model match - for(uint8_t i=0; i>5)+512,1023); - dsmDat[2+2*i] = (i<<2) | ((pulse>>8)&0x03); - dsmDat[3+2*i] = pulse & 0xff; - } - - for (counter = 0 ; counter < 14 ; counter += 1) - { - sendByteDsm2(dsmDat[counter]); - } - for (counter = 0 ; counter < 16 ; counter += 1) - { - put_serial_bit(1) ; // 16 extra stop bits - } -} -#endif - -#if defined(PCBSKY9X) && !defined(SIMU) -extern "C" void PWM_IRQHandler(void) -{ - register Pwm *pwmptr; - register Ssc *sscptr; - uint32_t period; - uint32_t reason; - - pwmptr = PWM; - reason = pwmptr->PWM_ISR1 ; - if (reason & PWM_ISR1_CHID3) { - switch (s_current_protocol[0]) // Use the current, don't switch until set_up_pulses - { - case PROTO_PXX: - // Alternate periods of 15.5mS and 2.5 mS - period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; - if (period == 5000) { // 2.5 mS - period = 15500 * 2; - } - else { - period = 5000; - } - pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS - if (period != 5000) { // 2.5 mS - setupPulses(0); - } - else { - // Kick off serial output here - sscptr = SSC; - sscptr->SSC_TPR = (uint32_t) Bit_pulses; - sscptr->SSC_TCR = Serial_byte_count; - sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers - } - break; - - case PROTO_DSM2_LP45: - case PROTO_DSM2_DSM2: - case PROTO_DSM2_DSMX: - // Alternate periods of 19.5mS and 2.5 mS - period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; - if (period == 5000) // 2.5 mS - { - period = 19500 * 2; - } - else { - period = 5000; - } - pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS - if (period != 5000) // 2.5 mS - { - setupPulses(0); - } - else { - // Kick off serial output here - sscptr = SSC; - sscptr->SSC_TPR = (uint32_t) Bit_pulses; - sscptr->SSC_TCR = Serial_byte_count; - sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers - } - break; - - default: - pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = ppmStream[0][ppmStreamIndex[0]++]; // Period in half uS - if (ppmStream[0][ppmStreamIndex[0]] == 0) { - ppmStreamIndex[0] = 0; - setupPulses(0); - } - break; - - } - } - - if (reason & PWM_ISR1_CHID1) { - pwmptr->PWM_CH_NUM[1].PWM_CPDRUPD = ppmStream[1][ppmStreamIndex[1]++] ; // Period in half uS - if (ppmStream[1][ppmStreamIndex[1]] == 0) { - ppmStreamIndex[1] = 0 ; - setupPulsesPPM(1) ; - } - } -} -#endif - -void setupPulses(unsigned int port) -{ - heartbeat |= (HEART_TIMER_PULSES << port); - -#if defined(PCBTARANIS) - if (port) port = 1; // Ensure is 0 or 1 only - uint8_t required_protocol; - - if (port == INTERNAL_MODULE) - required_protocol = g_model.moduleData[INTERNAL_MODULE].rfProtocol == RF_PROTO_OFF ? PROTO_NONE : PROTO_PXX; - else { - switch (g_model.externalModule) { - case MODULE_TYPE_PPM: - required_protocol = PROTO_PPM; - break; - case MODULE_TYPE_XJT: - case MODULE_TYPE_DJT: - required_protocol = PROTO_PXX; - break; - default: - required_protocol = PROTO_NONE; - } - } -#else - uint8_t required_protocol = g_model.protocol; -#endif - - if (s_pulses_paused) - required_protocol = PROTO_NONE; - - if (s_current_protocol[port] != required_protocol) { - - switch (s_current_protocol[port]) { // stop existing protocol hardware - case PROTO_PXX: -#if defined(PCBTARANIS) - disable_pxx(port); -#else - disable_pxx(); -#endif - break; -#if defined(DSM2) - case PROTO_DSM2_LP45: - case PROTO_DSM2_DSM2: - case PROTO_DSM2_DSMX: - disable_ssc(); - break; -#endif - default: -#if defined(PCBTARANIS) - disable_ppm(port); -#else - disable_main_ppm(); -#endif - break; - } - - s_current_protocol[port] = required_protocol; - -#if defined(PCBTARANIS) - switch (required_protocol) { - case PROTO_PXX: - init_pxx(port); - break; - case PROTO_PPM: - init_ppm(port); - break; - } -#elif defined(PCBSKY9X) - switch (required_protocol) { // Start new protocol hardware here - case PROTO_PXX: - init_main_ppm(5000, 0); // Initial period 2.5 mS, output off - init_ssc(); - break; - case PROTO_DSM2_LP45: - case PROTO_DSM2_DSM2: - case PROTO_DSM2_DSMX: - init_main_ppm(5000, 0); // Initial period 2.5 mS, output off - init_ssc(); - break; - case PROTO_NONE: - init_main_ppm(3000, 0); // Initial period 1.5 mS, output off - break; - default: - init_main_ppm(3000, 1); // Initial period 1.5 mS, output on - break; - } -#endif - } - - // Set up output data here - switch (required_protocol) { - case PROTO_PXX: - setupPulsesPXX(port); - break; -#if defined(DSM2) - case PROTO_DSM2_LP45: - case PROTO_DSM2_DSM2: - case PROTO_DSM2_DSMX: - setupPulsesDsm2(6); - break; -#endif -#if defined(PCBTARANIS) - case PROTO_PPM: -#else - default: -#endif - setupPulsesPPM(port); // Don't enable interrupts through here - break ; - } -} diff --git a/src/rotarysw.cpp b/src/rotarysw.cpp index b4da932cd..68b585b82 100644 --- a/src/rotarysw.cpp +++ b/src/rotarysw.cpp @@ -13,7 +13,6 @@ * */ #include "opentx.h" -#include "menus.h" #define CTIME_ROTARY_ANIM 500 uint16_t rotarySwChanged = 0; diff --git a/src/simu.cpp b/src/simu.cpp index 3afe043b3..278b677bc 100644 --- a/src/simu.cpp +++ b/src/simu.cpp @@ -40,7 +40,6 @@ #include #include "fxkeys.h" #include "opentx.h" -#include "menus.h" #include #include diff --git a/src/gruvin9x/board_gruvin9x.cpp b/src/targets/gruvin9x/board_gruvin9x.cpp similarity index 100% rename from src/gruvin9x/board_gruvin9x.cpp rename to src/targets/gruvin9x/board_gruvin9x.cpp diff --git a/src/gruvin9x/board_gruvin9x.h b/src/targets/gruvin9x/board_gruvin9x.h similarity index 100% rename from src/gruvin9x/board_gruvin9x.h rename to src/targets/gruvin9x/board_gruvin9x.h diff --git a/src/gruvin9x/diskio.cpp b/src/targets/gruvin9x/diskio.cpp similarity index 100% rename from src/gruvin9x/diskio.cpp rename to src/targets/gruvin9x/diskio.cpp diff --git a/src/gruvin9x/rtc_driver.cpp b/src/targets/gruvin9x/rtc_driver.cpp similarity index 100% rename from src/gruvin9x/rtc_driver.cpp rename to src/targets/gruvin9x/rtc_driver.cpp diff --git a/src/gruvin9x/somo14d.cpp b/src/targets/gruvin9x/somo14d.cpp similarity index 100% rename from src/gruvin9x/somo14d.cpp rename to src/targets/gruvin9x/somo14d.cpp diff --git a/src/gruvin9x/somo14d.h b/src/targets/gruvin9x/somo14d.h similarity index 100% rename from src/gruvin9x/somo14d.h rename to src/targets/gruvin9x/somo14d.h diff --git a/src/mega2560/00readme.txt b/src/targets/mega2560/00readme.txt similarity index 100% rename from src/mega2560/00readme.txt rename to src/targets/mega2560/00readme.txt diff --git a/src/mega2560/board_mega2560.cpp b/src/targets/mega2560/board_mega2560.cpp similarity index 100% rename from src/mega2560/board_mega2560.cpp rename to src/targets/mega2560/board_mega2560.cpp diff --git a/src/mega2560/board_mega2560.h b/src/targets/mega2560/board_mega2560.h similarity index 100% rename from src/mega2560/board_mega2560.h rename to src/targets/mega2560/board_mega2560.h diff --git a/src/mega2560/io_mega2560.h b/src/targets/mega2560/io_mega2560.h similarity index 100% rename from src/mega2560/io_mega2560.h rename to src/targets/mega2560/io_mega2560.h diff --git a/src/mega2560/lcd_driver_ST7565R.cpp b/src/targets/mega2560/lcd_driver_ST7565R.cpp similarity index 100% rename from src/mega2560/lcd_driver_ST7565R.cpp rename to src/targets/mega2560/lcd_driver_ST7565R.cpp diff --git a/src/sky9x/AT91SAM3S2.h b/src/targets/sky9x/AT91SAM3S2.h similarity index 100% rename from src/sky9x/AT91SAM3S2.h rename to src/targets/sky9x/AT91SAM3S2.h diff --git a/src/sky9x/AT91SAM3S4.h b/src/targets/sky9x/AT91SAM3S4.h similarity index 100% rename from src/sky9x/AT91SAM3S4.h rename to src/targets/sky9x/AT91SAM3S4.h diff --git a/src/sky9x/MEDSdcard.c b/src/targets/sky9x/MEDSdcard.c similarity index 100% rename from src/sky9x/MEDSdcard.c rename to src/targets/sky9x/MEDSdcard.c diff --git a/src/sky9x/Media.h b/src/targets/sky9x/Media.h similarity index 100% rename from src/sky9x/Media.h rename to src/targets/sky9x/Media.h diff --git a/src/sky9x/adc_driver.cpp b/src/targets/sky9x/adc_driver.cpp similarity index 100% rename from src/sky9x/adc_driver.cpp rename to src/targets/sky9x/adc_driver.cpp diff --git a/src/sky9x/audio_driver.cpp b/src/targets/sky9x/audio_driver.cpp similarity index 100% rename from src/sky9x/audio_driver.cpp rename to src/targets/sky9x/audio_driver.cpp diff --git a/src/sky9x/audio_driver.h b/src/targets/sky9x/audio_driver.h similarity index 100% rename from src/sky9x/audio_driver.h rename to src/targets/sky9x/audio_driver.h diff --git a/src/sky9x/bluetooth.cpp b/src/targets/sky9x/bluetooth.cpp similarity index 100% rename from src/sky9x/bluetooth.cpp rename to src/targets/sky9x/bluetooth.cpp diff --git a/src/sky9x/board.h b/src/targets/sky9x/board.h similarity index 100% rename from src/sky9x/board.h rename to src/targets/sky9x/board.h diff --git a/src/sky9x/board_lowlevel.c b/src/targets/sky9x/board_lowlevel.c similarity index 100% rename from src/sky9x/board_lowlevel.c rename to src/targets/sky9x/board_lowlevel.c diff --git a/src/sky9x/board_sky9x.cpp b/src/targets/sky9x/board_sky9x.cpp similarity index 100% rename from src/sky9x/board_sky9x.cpp rename to src/targets/sky9x/board_sky9x.cpp diff --git a/src/sky9x/board_sky9x.h b/src/targets/sky9x/board_sky9x.h similarity index 100% rename from src/sky9x/board_sky9x.h rename to src/targets/sky9x/board_sky9x.h diff --git a/src/sky9x/buzzer_driver.cpp b/src/targets/sky9x/buzzer_driver.cpp similarity index 100% rename from src/sky9x/buzzer_driver.cpp rename to src/targets/sky9x/buzzer_driver.cpp diff --git a/src/sky9x/chip.h b/src/targets/sky9x/chip.h similarity index 100% rename from src/sky9x/chip.h rename to src/targets/sky9x/chip.h diff --git a/src/sky9x/coproc_driver.cpp b/src/targets/sky9x/coproc_driver.cpp similarity index 100% rename from src/sky9x/coproc_driver.cpp rename to src/targets/sky9x/coproc_driver.cpp diff --git a/src/sky9x/core_cm3.c b/src/targets/sky9x/core_cm3.c similarity index 100% rename from src/sky9x/core_cm3.c rename to src/targets/sky9x/core_cm3.c diff --git a/src/sky9x/core_cm3.h b/src/targets/sky9x/core_cm3.h similarity index 100% rename from src/sky9x/core_cm3.h rename to src/targets/sky9x/core_cm3.h diff --git a/src/sky9x/crt.c b/src/targets/sky9x/crt.c similarity index 100% rename from src/sky9x/crt.c rename to src/targets/sky9x/crt.c diff --git a/src/sky9x/debug_driver.cpp b/src/targets/sky9x/debug_driver.cpp similarity index 100% rename from src/sky9x/debug_driver.cpp rename to src/targets/sky9x/debug_driver.cpp diff --git a/src/sky9x/diskio.cpp b/src/targets/sky9x/diskio.cpp similarity index 100% rename from src/sky9x/diskio.cpp rename to src/targets/sky9x/diskio.cpp diff --git a/src/sky9x/eeprom_driver.cpp b/src/targets/sky9x/eeprom_driver.cpp similarity index 100% rename from src/sky9x/eeprom_driver.cpp rename to src/targets/sky9x/eeprom_driver.cpp diff --git a/src/sky9x/haptic_driver.cpp b/src/targets/sky9x/haptic_driver.cpp similarity index 100% rename from src/sky9x/haptic_driver.cpp rename to src/targets/sky9x/haptic_driver.cpp diff --git a/src/sky9x/keys_driver.cpp b/src/targets/sky9x/keys_driver.cpp similarity index 100% rename from src/sky9x/keys_driver.cpp rename to src/targets/sky9x/keys_driver.cpp diff --git a/src/sky9x/lcd_driver.cpp b/src/targets/sky9x/lcd_driver.cpp similarity index 100% rename from src/sky9x/lcd_driver.cpp rename to src/targets/sky9x/lcd_driver.cpp diff --git a/src/sky9x/massstorage.cpp b/src/targets/sky9x/massstorage.cpp similarity index 100% rename from src/sky9x/massstorage.cpp rename to src/targets/sky9x/massstorage.cpp diff --git a/src/sky9x/pulses_driver.cpp b/src/targets/sky9x/pulses_driver.cpp similarity index 63% rename from src/sky9x/pulses_driver.cpp rename to src/targets/sky9x/pulses_driver.cpp index 820c79c5b..096301c9c 100644 --- a/src/sky9x/pulses_driver.cpp +++ b/src/targets/sky9x/pulses_driver.cpp @@ -36,6 +36,8 @@ #include "../opentx.h" +volatile uint32_t ppmStreamIndex[NUM_MODULES] = { MODULES_INIT(0) }; // Modified in interrupt routine + void init_main_ppm( uint32_t period, uint32_t out_enable ) { register Pio *pioptr ; @@ -133,3 +135,83 @@ void disable_ssc() sscptr = SSC ; sscptr->SSC_CR = SSC_CR_TXDIS ; } + +#if !defined(SIMU) +extern "C" void PWM_IRQHandler(void) +{ + register Pwm *pwmptr; + register Ssc *sscptr; + uint32_t period; + uint32_t reason; + + pwmptr = PWM; + reason = pwmptr->PWM_ISR1 ; + if (reason & PWM_ISR1_CHID3) { + switch (s_current_protocol[0]) // Use the current, don't switch until set_up_pulses + { + case PROTO_PXX: + // Alternate periods of 15.5mS and 2.5 mS + period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; + if (period == 5000) { // 2.5 mS + period = 15500 * 2; + } + else { + period = 5000; + } + pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS + if (period != 5000) { // 2.5 mS + setupPulses(0); + } + else { + // Kick off serial output here + sscptr = SSC; + sscptr->SSC_TPR = CONVERT_PTR(pxxStream[0]); + sscptr->SSC_TCR = (uint8_t *)pxxStreamPtr[0] - (uint8_t *)pxxStream[0]; + sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers + } + break; + + case PROTO_DSM2_LP45: + case PROTO_DSM2_DSM2: + case PROTO_DSM2_DSMX: + // Alternate periods of 19.5mS and 2.5 mS + period = pwmptr->PWM_CH_NUM[3].PWM_CPDR; + if (period == 5000) { // 2.5 mS + period = 19500 * 2; + } + else { + period = 5000; + } + pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = period; // Period in half uS + if (period != 5000) { // 2.5 mS + setupPulses(0); + } + else { + // Kick off serial output here + sscptr = SSC; + sscptr->SSC_TPR = (uint32_t) Bit_pulses; + sscptr->SSC_TCR = Serial_byte_count; + sscptr->SSC_PTCR = SSC_PTCR_TXTEN; // Start transfers + } + break; + + default: + pwmptr->PWM_CH_NUM[3].PWM_CPDRUPD = ppmStream[0][ppmStreamIndex[0]++]; // Period in half uS + if (ppmStream[0][ppmStreamIndex[0]] == 0) { + ppmStreamIndex[0] = 0; + setupPulses(0); + } + break; + + } + } + + if (reason & PWM_ISR1_CHID1) { + pwmptr->PWM_CH_NUM[1].PWM_CPDRUPD = ppmStream[1][ppmStreamIndex[1]++] ; // Period in half uS + if (ppmStream[1][ppmStreamIndex[1]] == 0) { + ppmStreamIndex[1] = 0; + setupPulsesPPM(1); + } + } +} +#endif diff --git a/src/sky9x/pwr_driver.cpp b/src/targets/sky9x/pwr_driver.cpp similarity index 100% rename from src/sky9x/pwr_driver.cpp rename to src/targets/sky9x/pwr_driver.cpp diff --git a/src/sky9x/rotenc_driver.cpp b/src/targets/sky9x/rotenc_driver.cpp similarity index 100% rename from src/sky9x/rotenc_driver.cpp rename to src/targets/sky9x/rotenc_driver.cpp diff --git a/src/sky9x/rtc_driver.cpp b/src/targets/sky9x/rtc_driver.cpp similarity index 100% rename from src/sky9x/rtc_driver.cpp rename to src/targets/sky9x/rtc_driver.cpp diff --git a/src/sky9x/sam3s2c_flash.ld b/src/targets/sky9x/sam3s2c_flash.ld similarity index 100% rename from src/sky9x/sam3s2c_flash.ld rename to src/targets/sky9x/sam3s2c_flash.ld diff --git a/src/sky9x/sam3s4c_flash.ld b/src/targets/sky9x/sam3s4c_flash.ld similarity index 100% rename from src/sky9x/sam3s4c_flash.ld rename to src/targets/sky9x/sam3s4c_flash.ld diff --git a/src/sky9x/sdcard_driver.cpp b/src/targets/sky9x/sdcard_driver.cpp similarity index 100% rename from src/sky9x/sdcard_driver.cpp rename to src/targets/sky9x/sdcard_driver.cpp diff --git a/src/sky9x/syscalls.c b/src/targets/sky9x/syscalls.c similarity index 100% rename from src/sky9x/syscalls.c rename to src/targets/sky9x/syscalls.c diff --git a/src/sky9x/usb/common/core/USBConfigurationDescriptor.c b/src/targets/sky9x/usb/common/core/USBConfigurationDescriptor.c similarity index 100% rename from src/sky9x/usb/common/core/USBConfigurationDescriptor.c rename to src/targets/sky9x/usb/common/core/USBConfigurationDescriptor.c diff --git a/src/sky9x/usb/common/core/USBConfigurationDescriptor.h b/src/targets/sky9x/usb/common/core/USBConfigurationDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBConfigurationDescriptor.h rename to src/targets/sky9x/usb/common/core/USBConfigurationDescriptor.h diff --git a/src/sky9x/usb/common/core/USBDeviceDescriptor.h b/src/targets/sky9x/usb/common/core/USBDeviceDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBDeviceDescriptor.h rename to src/targets/sky9x/usb/common/core/USBDeviceDescriptor.h diff --git a/src/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h b/src/targets/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h rename to src/targets/sky9x/usb/common/core/USBDeviceQualifierDescriptor.h diff --git a/src/sky9x/usb/common/core/USBEndpointDescriptor.c b/src/targets/sky9x/usb/common/core/USBEndpointDescriptor.c similarity index 100% rename from src/sky9x/usb/common/core/USBEndpointDescriptor.c rename to src/targets/sky9x/usb/common/core/USBEndpointDescriptor.c diff --git a/src/sky9x/usb/common/core/USBEndpointDescriptor.h b/src/targets/sky9x/usb/common/core/USBEndpointDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBEndpointDescriptor.h rename to src/targets/sky9x/usb/common/core/USBEndpointDescriptor.h diff --git a/src/sky9x/usb/common/core/USBFeatureRequest.c b/src/targets/sky9x/usb/common/core/USBFeatureRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBFeatureRequest.c rename to src/targets/sky9x/usb/common/core/USBFeatureRequest.c diff --git a/src/sky9x/usb/common/core/USBFeatureRequest.h b/src/targets/sky9x/usb/common/core/USBFeatureRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBFeatureRequest.h rename to src/targets/sky9x/usb/common/core/USBFeatureRequest.h diff --git a/src/sky9x/usb/common/core/USBGenericDescriptor.c b/src/targets/sky9x/usb/common/core/USBGenericDescriptor.c similarity index 100% rename from src/sky9x/usb/common/core/USBGenericDescriptor.c rename to src/targets/sky9x/usb/common/core/USBGenericDescriptor.c diff --git a/src/sky9x/usb/common/core/USBGenericDescriptor.h b/src/targets/sky9x/usb/common/core/USBGenericDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBGenericDescriptor.h rename to src/targets/sky9x/usb/common/core/USBGenericDescriptor.h diff --git a/src/sky9x/usb/common/core/USBGenericRequest.c b/src/targets/sky9x/usb/common/core/USBGenericRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBGenericRequest.c rename to src/targets/sky9x/usb/common/core/USBGenericRequest.c diff --git a/src/sky9x/usb/common/core/USBGenericRequest.h b/src/targets/sky9x/usb/common/core/USBGenericRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBGenericRequest.h rename to src/targets/sky9x/usb/common/core/USBGenericRequest.h diff --git a/src/sky9x/usb/common/core/USBGetDescriptorRequest.c b/src/targets/sky9x/usb/common/core/USBGetDescriptorRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBGetDescriptorRequest.c rename to src/targets/sky9x/usb/common/core/USBGetDescriptorRequest.c diff --git a/src/sky9x/usb/common/core/USBGetDescriptorRequest.h b/src/targets/sky9x/usb/common/core/USBGetDescriptorRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBGetDescriptorRequest.h rename to src/targets/sky9x/usb/common/core/USBGetDescriptorRequest.h diff --git a/src/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h b/src/targets/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h rename to src/targets/sky9x/usb/common/core/USBInterfaceAssociationDescriptor.h diff --git a/src/sky9x/usb/common/core/USBInterfaceDescriptor.h b/src/targets/sky9x/usb/common/core/USBInterfaceDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBInterfaceDescriptor.h rename to src/targets/sky9x/usb/common/core/USBInterfaceDescriptor.h diff --git a/src/sky9x/usb/common/core/USBInterfaceRequest.c b/src/targets/sky9x/usb/common/core/USBInterfaceRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBInterfaceRequest.c rename to src/targets/sky9x/usb/common/core/USBInterfaceRequest.c diff --git a/src/sky9x/usb/common/core/USBInterfaceRequest.h b/src/targets/sky9x/usb/common/core/USBInterfaceRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBInterfaceRequest.h rename to src/targets/sky9x/usb/common/core/USBInterfaceRequest.h diff --git a/src/sky9x/usb/common/core/USBIrqHandler.c b/src/targets/sky9x/usb/common/core/USBIrqHandler.c similarity index 100% rename from src/sky9x/usb/common/core/USBIrqHandler.c rename to src/targets/sky9x/usb/common/core/USBIrqHandler.c diff --git a/src/sky9x/usb/common/core/USBIrqHandler.h b/src/targets/sky9x/usb/common/core/USBIrqHandler.h similarity index 100% rename from src/sky9x/usb/common/core/USBIrqHandler.h rename to src/targets/sky9x/usb/common/core/USBIrqHandler.h diff --git a/src/sky9x/usb/common/core/USBSetAddressRequest.c b/src/targets/sky9x/usb/common/core/USBSetAddressRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBSetAddressRequest.c rename to src/targets/sky9x/usb/common/core/USBSetAddressRequest.c diff --git a/src/sky9x/usb/common/core/USBSetAddressRequest.h b/src/targets/sky9x/usb/common/core/USBSetAddressRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBSetAddressRequest.h rename to src/targets/sky9x/usb/common/core/USBSetAddressRequest.h diff --git a/src/sky9x/usb/common/core/USBSetConfigurationRequest.c b/src/targets/sky9x/usb/common/core/USBSetConfigurationRequest.c similarity index 100% rename from src/sky9x/usb/common/core/USBSetConfigurationRequest.c rename to src/targets/sky9x/usb/common/core/USBSetConfigurationRequest.c diff --git a/src/sky9x/usb/common/core/USBSetConfigurationRequest.h b/src/targets/sky9x/usb/common/core/USBSetConfigurationRequest.h similarity index 100% rename from src/sky9x/usb/common/core/USBSetConfigurationRequest.h rename to src/targets/sky9x/usb/common/core/USBSetConfigurationRequest.h diff --git a/src/sky9x/usb/common/core/USBStringDescriptor.h b/src/targets/sky9x/usb/common/core/USBStringDescriptor.h similarity index 100% rename from src/sky9x/usb/common/core/USBStringDescriptor.h rename to src/targets/sky9x/usb/common/core/USBStringDescriptor.h diff --git a/src/sky9x/usb/common/massstorage/MSDeviceDescriptor.h b/src/targets/sky9x/usb/common/massstorage/MSDeviceDescriptor.h similarity index 100% rename from src/sky9x/usb/common/massstorage/MSDeviceDescriptor.h rename to src/targets/sky9x/usb/common/massstorage/MSDeviceDescriptor.h diff --git a/src/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h b/src/targets/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h similarity index 100% rename from src/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h rename to src/targets/sky9x/usb/common/massstorage/MSInterfaceDescriptor.h diff --git a/src/sky9x/usb/device/core/USBD.h b/src/targets/sky9x/usb/device/core/USBD.h similarity index 100% rename from src/sky9x/usb/device/core/USBD.h rename to src/targets/sky9x/usb/device/core/USBD.h diff --git a/src/sky9x/usb/device/core/USBDDriver.c b/src/targets/sky9x/usb/device/core/USBDDriver.c similarity index 100% rename from src/sky9x/usb/device/core/USBDDriver.c rename to src/targets/sky9x/usb/device/core/USBDDriver.c diff --git a/src/sky9x/usb/device/core/USBDDriver.h b/src/targets/sky9x/usb/device/core/USBDDriver.h similarity index 100% rename from src/sky9x/usb/device/core/USBDDriver.h rename to src/targets/sky9x/usb/device/core/USBDDriver.h diff --git a/src/sky9x/usb/device/core/USBDDriverDescriptors.h b/src/targets/sky9x/usb/device/core/USBDDriverDescriptors.h similarity index 100% rename from src/sky9x/usb/device/core/USBDDriverDescriptors.h rename to src/targets/sky9x/usb/device/core/USBDDriverDescriptors.h diff --git a/src/sky9x/usb/device/core/USBD_UDP.c b/src/targets/sky9x/usb/device/core/USBD_UDP.c similarity index 100% rename from src/sky9x/usb/device/core/USBD_UDP.c rename to src/targets/sky9x/usb/device/core/USBD_UDP.c diff --git a/src/sky9x/usb/device/massstorage/MSD.h b/src/targets/sky9x/usb/device/massstorage/MSD.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSD.h rename to src/targets/sky9x/usb/device/massstorage/MSD.h diff --git a/src/sky9x/usb/device/massstorage/MSDDStateMachine.c b/src/targets/sky9x/usb/device/massstorage/MSDDStateMachine.c similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDStateMachine.c rename to src/targets/sky9x/usb/device/massstorage/MSDDStateMachine.c diff --git a/src/sky9x/usb/device/massstorage/MSDDStateMachine.h b/src/targets/sky9x/usb/device/massstorage/MSDDStateMachine.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDStateMachine.h rename to src/targets/sky9x/usb/device/massstorage/MSDDStateMachine.h diff --git a/src/sky9x/usb/device/massstorage/MSDDriver.c b/src/targets/sky9x/usb/device/massstorage/MSDDriver.c similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDriver.c rename to src/targets/sky9x/usb/device/massstorage/MSDDriver.c diff --git a/src/sky9x/usb/device/massstorage/MSDDriver.h b/src/targets/sky9x/usb/device/massstorage/MSDDriver.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDriver.h rename to src/targets/sky9x/usb/device/massstorage/MSDDriver.h diff --git a/src/sky9x/usb/device/massstorage/MSDDriverDescriptors.c b/src/targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.c similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDriverDescriptors.c rename to src/targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.c diff --git a/src/sky9x/usb/device/massstorage/MSDDriverDescriptors.h b/src/targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDDriverDescriptors.h rename to src/targets/sky9x/usb/device/massstorage/MSDDriverDescriptors.h diff --git a/src/sky9x/usb/device/massstorage/MSDIOFifo.h b/src/targets/sky9x/usb/device/massstorage/MSDIOFifo.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDIOFifo.h rename to src/targets/sky9x/usb/device/massstorage/MSDIOFifo.h diff --git a/src/sky9x/usb/device/massstorage/MSDLun.c b/src/targets/sky9x/usb/device/massstorage/MSDLun.c similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDLun.c rename to src/targets/sky9x/usb/device/massstorage/MSDLun.c diff --git a/src/sky9x/usb/device/massstorage/MSDLun.h b/src/targets/sky9x/usb/device/massstorage/MSDLun.h similarity index 100% rename from src/sky9x/usb/device/massstorage/MSDLun.h rename to src/targets/sky9x/usb/device/massstorage/MSDLun.h diff --git a/src/sky9x/usb/device/massstorage/SBC.h b/src/targets/sky9x/usb/device/massstorage/SBC.h similarity index 100% rename from src/sky9x/usb/device/massstorage/SBC.h rename to src/targets/sky9x/usb/device/massstorage/SBC.h diff --git a/src/sky9x/usb/device/massstorage/SBCMethods.c b/src/targets/sky9x/usb/device/massstorage/SBCMethods.c similarity index 100% rename from src/sky9x/usb/device/massstorage/SBCMethods.c rename to src/targets/sky9x/usb/device/massstorage/SBCMethods.c diff --git a/src/sky9x/usb/device/massstorage/SBCMethods.h b/src/targets/sky9x/usb/device/massstorage/SBCMethods.h similarity index 100% rename from src/sky9x/usb/device/massstorage/SBCMethods.h rename to src/targets/sky9x/usb/device/massstorage/SBCMethods.h diff --git a/src/sky9x/vectors_sam3s.c b/src/targets/sky9x/vectors_sam3s.c similarity index 100% rename from src/sky9x/vectors_sam3s.c rename to src/targets/sky9x/vectors_sam3s.c diff --git a/src/stock/board_stock.cpp b/src/targets/stock/board_stock.cpp similarity index 100% rename from src/stock/board_stock.cpp rename to src/targets/stock/board_stock.cpp diff --git a/src/stock/board_stock.h b/src/targets/stock/board_stock.h similarity index 100% rename from src/stock/board_stock.h rename to src/targets/stock/board_stock.h diff --git a/src/stock/lcd_driver.cpp b/src/targets/stock/lcd_driver.cpp similarity index 100% rename from src/stock/lcd_driver.cpp rename to src/targets/stock/lcd_driver.cpp diff --git a/src/stock/voice.cpp b/src/targets/stock/voice.cpp similarity index 100% rename from src/stock/voice.cpp rename to src/targets/stock/voice.cpp diff --git a/src/stock/voice.h b/src/targets/stock/voice.h similarity index 100% rename from src/stock/voice.h rename to src/targets/stock/voice.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/system_stm32f2xx.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/system_stm32f2xx.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/system_stm32f2xx.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Include/system_stm32f2xx.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/gcc_ride7/startup_stm32f2xx.s diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Device/ST/STM32F2xx/Source/Templates/system_stm32f2xx.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_common_tables.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_common_tables.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_common_tables.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_common_tables.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_math.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_math.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_math.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/arm_math.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm0.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm0.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm0.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm0.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm3.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm3.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm3.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm3.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4_simd.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4_simd.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4_simd.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cm4_simd.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmFunc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmFunc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmFunc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmFunc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmInstr.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmInstr.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmInstr.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/CMSIS/Include/core_cmInstr.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/misc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_adc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_adc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_adc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_adc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_can.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_can.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_can.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_can.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_crc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_crc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_crc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_crc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_cryp.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_cryp.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_cryp.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_cryp.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dac.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dac.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dac.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dac.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dbgmcu.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dcmi.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dcmi.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dcmi.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dcmi.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dma.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dma.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dma.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_dma.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_exti.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_exti.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_exti.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_exti.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_flash.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_flash.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_flash.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_flash.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_fsmc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_fsmc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_fsmc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_fsmc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_gpio.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_hash.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_hash.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_hash.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_hash.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_i2c.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_i2c.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_i2c.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_i2c.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_iwdg.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_iwdg.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_iwdg.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_iwdg.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_pwr.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_pwr.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_pwr.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_pwr.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rcc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rcc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rcc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rcc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rng.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rng.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rng.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rng.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rtc.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rtc.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rtc.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_rtc.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_sdio.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_sdio.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_sdio.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_sdio.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_spi.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_spi.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_spi.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_spi.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_syscfg.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_syscfg.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_syscfg.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_syscfg.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_tim.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_tim.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_tim.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_tim.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_usart.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_usart.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_usart.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_usart.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_wwdg.h b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_wwdg.h similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_wwdg.h rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/inc/stm32f2xx_wwdg.h diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/misc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_adc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_adc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_adc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_adc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_can.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_can.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_can.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_can.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_crc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_crc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_crc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_crc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_aes.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_aes.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_aes.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_aes.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_des.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_des.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_des.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_des.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_tdes.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_tdes.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_tdes.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_cryp_tdes.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dac.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dac.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dac.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dac.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dbgmcu.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dcmi.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dcmi.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dcmi.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dcmi.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_dma.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_exti.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_flash.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_flash.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_flash.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_flash.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_fsmc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_fsmc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_fsmc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_fsmc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_gpio.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_md5.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_md5.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_md5.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_md5.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_sha1.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_sha1.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_sha1.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_hash_sha1.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_i2c.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_iwdg.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_iwdg.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_iwdg.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_iwdg.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_pwr.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rcc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rng.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rng.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rng.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rng.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_rtc.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_sdio.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_sdio.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_sdio.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_sdio.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_spi.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_syscfg.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_tim.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_tim.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_tim.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_tim.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_usart.c diff --git a/src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_wwdg.c b/src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_wwdg.c similarity index 100% rename from src/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_wwdg.c rename to src/targets/taranis/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries/STM32F2xx_StdPeriph_Driver/src/stm32f2xx_wwdg.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_out_if.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_out_if.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_out_if.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/inc/usbd_audio_out_if.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_out_if.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_out_if.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_out_if.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/audio/src/usbd_audio_out_if.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/inc/usbd_cdc_if_template.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_if_template.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_if_template.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_if_template.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_if_template.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_mal.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_mal.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_mal.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_dfu_mal.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_flash_if.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_flash_if.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_flash_if.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_flash_if.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_mem_if_template.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_mem_if_template.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_mem_if_template.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_mem_if_template.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/inc/usbd_otp_if.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_mal.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_mal.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_mal.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_dfu_mal.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_flash_if.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_flash_if.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_flash_if.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_flash_if.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_mem_if_template.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_mem_if_template.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_mem_if_template.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_mem_if_template.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_otp_if.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_otp_if.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_otp_if.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/dfu/src/usbd_otp_if.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/inc/usbd_hid_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/hid/src/usbd_hid_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_bot.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_bot.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_bot.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_bot.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_data.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_data.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_data.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_data.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_mem.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_mem.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_mem.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_mem.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_scsi.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_scsi.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_scsi.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/inc/usbd_msc_scsi.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf_template.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf_template.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf_template.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_conf_template.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_def.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_def.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_def.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_def.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_ioreq.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_req.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/inc/usbd_usr.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_ioreq.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Core/src/usbd_req.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Release_Notes.html b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Release_Notes.html similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Release_Notes.html rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_Device_Library/Release_Notes.html diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/Release_Notes.html b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/Release_Notes.html similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/Release_Notes.html rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/Release_Notes.html diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_bsp.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_conf_template.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_conf_template.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_conf_template.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_conf_template.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_core.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_core.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_core.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_core.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_dcd_int.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_defines.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd_int.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd_int.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd_int.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_hcd_int.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_otg.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_otg.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_otg.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_otg.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/inc/usb_regs.h diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_core.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_dcd_int.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd_int.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd_int.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd_int.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_hcd_int.c diff --git a/src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_otg.c b/src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_otg.c similarity index 100% rename from src/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_otg.c rename to src/targets/taranis/STM32_USB-Host-Device_Lib_V2.1.0/Libraries/STM32_USB_OTG_Driver/src/usb_otg.c diff --git a/src/taranis/adc_driver.cpp b/src/targets/taranis/adc_driver.cpp similarity index 100% rename from src/taranis/adc_driver.cpp rename to src/targets/taranis/adc_driver.cpp diff --git a/src/taranis/aspi.cpp b/src/targets/taranis/aspi.cpp similarity index 100% rename from src/taranis/aspi.cpp rename to src/targets/taranis/aspi.cpp diff --git a/src/taranis/aspi.h b/src/targets/taranis/aspi.h similarity index 100% rename from src/taranis/aspi.h rename to src/targets/taranis/aspi.h diff --git a/src/taranis/audio_driver.cpp b/src/targets/taranis/audio_driver.cpp similarity index 100% rename from src/taranis/audio_driver.cpp rename to src/targets/taranis/audio_driver.cpp diff --git a/src/taranis/audio_driver.h b/src/targets/taranis/audio_driver.h similarity index 100% rename from src/taranis/audio_driver.h rename to src/targets/taranis/audio_driver.h diff --git a/src/taranis/board_taranis.cpp b/src/targets/taranis/board_taranis.cpp similarity index 100% rename from src/taranis/board_taranis.cpp rename to src/targets/taranis/board_taranis.cpp diff --git a/src/taranis/board_taranis.h b/src/targets/taranis/board_taranis.h similarity index 96% rename from src/taranis/board_taranis.h rename to src/targets/taranis/board_taranis.h index 909aeaf67..6df9353e1 100644 --- a/src/taranis/board_taranis.h +++ b/src/targets/taranis/board_taranis.h @@ -58,6 +58,7 @@ extern "C" { #include "aspi.h" #include "i2c.h" #include "audio_driver.h" +#include "a7105_driver.h" #define PERI1_FREQUENCY 30000000 #define PERI2_FREQUENCY 60000000 diff --git a/src/taranis/delays.cpp b/src/targets/taranis/delays.cpp similarity index 100% rename from src/taranis/delays.cpp rename to src/targets/taranis/delays.cpp diff --git a/src/taranis/diskio.cpp b/src/targets/taranis/diskio.cpp similarity index 100% rename from src/taranis/diskio.cpp rename to src/targets/taranis/diskio.cpp diff --git a/src/taranis/hal.h b/src/targets/taranis/hal.h similarity index 100% rename from src/taranis/hal.h rename to src/targets/taranis/hal.h diff --git a/src/taranis/i2c.c b/src/targets/taranis/i2c.c similarity index 100% rename from src/taranis/i2c.c rename to src/targets/taranis/i2c.c diff --git a/src/taranis/i2c.h b/src/targets/taranis/i2c.h similarity index 100% rename from src/taranis/i2c.h rename to src/targets/taranis/i2c.h diff --git a/src/taranis/keys_driver.cpp b/src/targets/taranis/keys_driver.cpp similarity index 100% rename from src/taranis/keys_driver.cpp rename to src/targets/taranis/keys_driver.cpp diff --git a/src/taranis/lcd_driver.cpp b/src/targets/taranis/lcd_driver.cpp similarity index 100% rename from src/taranis/lcd_driver.cpp rename to src/targets/taranis/lcd_driver.cpp diff --git a/src/taranis/pulses_driver.cpp b/src/targets/taranis/pulses_driver.cpp similarity index 96% rename from src/taranis/pulses_driver.cpp rename to src/targets/taranis/pulses_driver.cpp index c16751485..aa07622e9 100644 --- a/src/taranis/pulses_driver.cpp +++ b/src/targets/taranis/pulses_driver.cpp @@ -41,7 +41,7 @@ void setupPulsesPPM(unsigned int port); void setupPulsesPXX(unsigned int port); uint16_t *ppmStreamPtr[NUM_MODULES]; -extern uint16_t ppmStream[NUM_MODULES][20]; +extern uint16_t ppmStream[NUM_MODULES+1][20]; extern uint16_t pxxStream[NUM_MODULES][400] ; static void init_pa10_pxx( void ) ; @@ -220,7 +220,6 @@ extern "C" void TIM1_CC_IRQHandler() } else { ppmStreamPtr[INTERNAL_MODULE] = ppmStream[INTERNAL_MODULE]; - TIM1->DIER |= TIM_DIER_UDE ; TIM1->SR &= ~TIM_SR_UIF ; // Clear this flag TIM1->DIER |= TIM_DIER_UIE ; // Enable this interrupt @@ -284,7 +283,7 @@ static void init_pa7_pxx() TIM8->DCR = 13 ; // DMA to CC1 // TIM8->CR1 = TIM_CR1_OPM ; // Just run once - // Enable the DMA channel here, DMA2 stream 2, channel 7 + // Enable the DMA channel here, DMA2 stream 2, channel 7 DMA2_Stream2->CR &= ~DMA_SxCR_EN ; // Disable DMA DMA2->LIFCR = DMA_LIFCR_CTCIF2 | DMA_LIFCR_CHTIF2 | DMA_LIFCR_CTEIF2 | DMA_LIFCR_CDMEIF2 | DMA_LIFCR_CFEIF2 ; // Write ones to clear bits DMA2_Stream2->CR = DMA_SxCR_CHSEL_0 | DMA_SxCR_CHSEL_1 | DMA_SxCR_CHSEL_2 | DMA_SxCR_PL_0 | DMA_SxCR_MSIZE_0 diff --git a/src/taranis/pwr_driver.cpp b/src/targets/taranis/pwr_driver.cpp similarity index 100% rename from src/taranis/pwr_driver.cpp rename to src/targets/taranis/pwr_driver.cpp diff --git a/src/taranis/rtc_driver.cpp b/src/targets/taranis/rtc_driver.cpp similarity index 100% rename from src/taranis/rtc_driver.cpp rename to src/targets/taranis/rtc_driver.cpp diff --git a/src/taranis/sport_driver.cpp b/src/targets/taranis/sport_driver.cpp similarity index 100% rename from src/taranis/sport_driver.cpp rename to src/targets/taranis/sport_driver.cpp diff --git a/src/taranis/stm32_flash.ld b/src/targets/taranis/stm32_flash.ld similarity index 100% rename from src/taranis/stm32_flash.ld rename to src/targets/taranis/stm32_flash.ld diff --git a/src/taranis/trainer_driver.cpp b/src/targets/taranis/trainer_driver.cpp similarity index 72% rename from src/taranis/trainer_driver.cpp rename to src/targets/taranis/trainer_driver.cpp index 984a4e73e..0bc63d392 100644 --- a/src/taranis/trainer_driver.cpp +++ b/src/targets/taranis/trainer_driver.cpp @@ -36,56 +36,16 @@ #include "../opentx.h" -uint16_t TrainerPpmStream[20] = -{ - 2000, - 2200, - 2400, - 2600, - 2800, - 3000, - 3200, - 3400, - 45000-21600, - 0,0,0,0,0,0,0,0,0,0,0 -}; - uint8_t currentTrainerMode; uint16_t * TrainerPulsePtr; -// TODO remove duplicated code -void setupTrainerPulses() -{ - int16_t PPM_range = g_model.extendedLimits ? 640 * 2 : 512 * 2; //range of 0.7..1.7msec - - uint16_t *ptr ; - uint32_t firstCh = g_model.moduleData[TRAINER_MODULE].channelsStart; - uint32_t lastCh = min(NUM_CHNOUT, firstCh + 8 + g_model.moduleData[TRAINER_MODULE].channelsCount); - - ptr = TrainerPpmStream ; - - uint32_t rest = 22500u * 2; //Minimum Framelen=22.5 ms - rest += int32_t(g_model.moduleData[TRAINER_MODULE].ppmFrameLength) * 1000; - - for (uint32_t i=firstCh; i 65535) ? 65535 : rest; - *ptr++ = rest ; - *ptr = 0 ; - - TIM3->CCR2 = rest - 1000 ; // Update time - TIM3->CCR4 = (g_model.moduleData[TRAINER_MODULE].ppmDelay*50+300)*2 ; -} +#define setupTrainerPulses() setupPulsesPPM(TRAINER_MODULE) // Trainer PPM oputput PC9, Timer 3 channel 4, (Alternate Function 2) void init_trainer_ppm() { setupTrainerPulses() ; - TrainerPulsePtr = TrainerPpmStream ; + TrainerPulsePtr = ppmStream[TRAINER_MODULE]; RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN ; // Enable portC clock configure_pins( PIN_TR_PPM_OUT, PIN_PERIPHERAL | PIN_PORTC | PIN_PER_3 | PIN_OS25 | PIN_PUSHPULL ) ; @@ -152,7 +112,7 @@ extern "C" void TIM3_IRQHandler() static uint16_t lastCapt ; uint16_t val ; - // What mode? in or out? + // What mode? in or out? if ( (TIM3->DIER & TIM_DIER_CC3IE ) && ( TIM3->SR & TIM_SR_CC3IF ) ) { // capture mode capture = TIM3->CCR3 ; @@ -166,7 +126,7 @@ extern "C" void TIM3_IRQHandler() ppmInState = 1; // triggered } else { - if(ppmInState && (ppmInState<=8)) { + if (ppmInState && (ppmInState<=8)) { if ((val>800) && (val<2200)) { g_ppmIns[ppmInState++ - 1] = (int16_t)(val - 1500)*(g_eeGeneral.PPM_Multiplier+10)/10; //+-500 != 512, but close enough. } @@ -178,23 +138,23 @@ extern "C" void TIM3_IRQHandler() } // PPM out compare interrupt - if ( ( TIM3->DIER & TIM_DIER_CC2IE ) && ( TIM3->SR & TIM_SR_CC2IF ) ) - { // compare interrupt - TIM3->SR &= ~TIM_SR_CC2IF ; // Clear flag - TIM3->DIER &= ~TIM_DIER_CC2IE ; // stop this interrupt - TIM3->SR &= ~TIM_SR_CC2IF ; // Clear flag + if ( ( TIM3->DIER & TIM_DIER_CC2IE ) && ( TIM3->SR & TIM_SR_CC2IF ) ) { + // compare interrupt + TIM3->SR &= ~TIM_SR_CC2IF ; // Clear flag + TIM3->DIER &= ~TIM_DIER_CC2IE ; // stop this interrupt + TIM3->SR &= ~TIM_SR_CC2IF ; // Clear flag - setupTrainerPulses() ; + setupTrainerPulses() ; - TrainerPulsePtr = TrainerPpmStream ; - TIM3->DIER |= TIM_DIER_UDE ; + TrainerPulsePtr = ppmStream[TRAINER_MODULE]; + TIM3->DIER |= TIM_DIER_UDE ; - TIM3->SR &= ~TIM_SR_UIF ; // Clear this flag - TIM3->DIER |= TIM_DIER_UIE ; // Enable this interrupt + TIM3->SR &= ~TIM_SR_UIF ; // Clear this flag + TIM3->DIER |= TIM_DIER_UIE ; // Enable this interrupt } // PPM out update interrupt - if ( (TIM3->DIER & TIM_DIER_UIE) && ( TIM3->SR & TIM_SR_UIF ) ) { + if ( (TIM3->DIER & TIM_DIER_UIE) && ( TIM3->SR & TIM_SR_UIF ) ) { TIM3->SR &= ~TIM_SR_UIF ; // Clear flag TIM3->ARR = *TrainerPulsePtr++ ; if ( *TrainerPulsePtr == 0 ) { diff --git a/src/taranis/uart_driver.cpp b/src/targets/taranis/uart_driver.cpp similarity index 100% rename from src/taranis/uart_driver.cpp rename to src/targets/taranis/uart_driver.cpp diff --git a/src/taranis/usb_bsp.c b/src/targets/taranis/usb_bsp.c similarity index 100% rename from src/taranis/usb_bsp.c rename to src/targets/taranis/usb_bsp.c diff --git a/src/taranis/usb_conf.h b/src/targets/taranis/usb_conf.h similarity index 100% rename from src/taranis/usb_conf.h rename to src/targets/taranis/usb_conf.h diff --git a/src/taranis/usbd_conf.h b/src/targets/taranis/usbd_conf.h similarity index 100% rename from src/taranis/usbd_conf.h rename to src/targets/taranis/usbd_conf.h diff --git a/src/taranis/usbd_desc.c b/src/targets/taranis/usbd_desc.c similarity index 100% rename from src/taranis/usbd_desc.c rename to src/targets/taranis/usbd_desc.c diff --git a/src/taranis/usbd_desc.h b/src/targets/taranis/usbd_desc.h similarity index 100% rename from src/taranis/usbd_desc.h rename to src/targets/taranis/usbd_desc.h diff --git a/src/taranis/usbd_storage_msd.cpp b/src/targets/taranis/usbd_storage_msd.cpp similarity index 100% rename from src/taranis/usbd_storage_msd.cpp rename to src/targets/taranis/usbd_storage_msd.cpp diff --git a/src/taranis/usbd_usr.cpp b/src/targets/taranis/usbd_usr.cpp similarity index 100% rename from src/taranis/usbd_usr.cpp rename to src/targets/taranis/usbd_usr.cpp diff --git a/src/telemetry_ardupilot.cpp b/src/telemetry/ardupilot.cpp similarity index 96% rename from src/telemetry_ardupilot.cpp rename to src/telemetry/ardupilot.cpp index a82108c56..256553b75 100644 --- a/src/telemetry_ardupilot.cpp +++ b/src/telemetry/ardupilot.cpp @@ -35,7 +35,6 @@ */ #include "opentx.h" -#include "menus.h" #define NB_BUF 2 #define LG_BUF 11 diff --git a/src/telemetry_ardupilot.h b/src/telemetry/ardupilot.h similarity index 100% rename from src/telemetry_ardupilot.h rename to src/telemetry/ardupilot.h diff --git a/src/telemetry_frsky.cpp b/src/telemetry/frsky.cpp similarity index 99% rename from src/telemetry_frsky.cpp rename to src/telemetry/frsky.cpp index 94aa4315e..b8d14c0fb 100644 --- a/src/telemetry_frsky.cpp +++ b/src/telemetry/frsky.cpp @@ -35,7 +35,6 @@ */ #include "opentx.h" -#include "menus.h" // Enumerate FrSky packet codes #define LINKPKT 0xfe diff --git a/src/telemetry_frsky.h b/src/telemetry/frsky.h similarity index 100% rename from src/telemetry_frsky.h rename to src/telemetry/frsky.h diff --git a/src/telemetry_jeti.cpp b/src/telemetry/jeti.cpp similarity index 99% rename from src/telemetry_jeti.cpp rename to src/telemetry/jeti.cpp index 1dc8c6f28..4a56eb644 100644 --- a/src/telemetry_jeti.cpp +++ b/src/telemetry/jeti.cpp @@ -40,7 +40,7 @@ uint8_t jetiRxBuffer[32]; uint8_t jetiReady; uint16_t jetiKeys; -void telemetryWakeup() +void telemetryInterrupt10ms() { if (jetiReady) { jetiKeys = JETI_KEY_NOCHANGE; diff --git a/src/telemetry_jeti.h b/src/telemetry/jeti.h similarity index 98% rename from src/telemetry_jeti.h rename to src/telemetry/jeti.h index ac8de2805..ff2291b05 100644 --- a/src/telemetry_jeti.h +++ b/src/telemetry/jeti.h @@ -49,7 +49,7 @@ void JETI_DisableRXD (void); void JETI_EnableTXD (void); void JETI_DisableTXD (void); -void telemetryWakeup(); +void telemetryInterrupt10ms(); void menuTelemetryJeti(uint8_t event); #endif diff --git a/src/telemetry_mavlink.cpp b/src/telemetry/mavlink.cpp similarity index 100% rename from src/telemetry_mavlink.cpp rename to src/telemetry/mavlink.cpp diff --git a/src/telemetry_mavlink.h b/src/telemetry/mavlink.h similarity index 100% rename from src/telemetry_mavlink.h rename to src/telemetry/mavlink.h diff --git a/src/telemetry_nmea.cpp b/src/telemetry/nmea.cpp similarity index 96% rename from src/telemetry_nmea.cpp rename to src/telemetry/nmea.cpp index aa7964f08..e803a6b74 100644 --- a/src/telemetry_nmea.cpp +++ b/src/telemetry/nmea.cpp @@ -35,7 +35,6 @@ */ #include "opentx.h" -#include "menus.h" #define LG_BUF 14 #define NB_LONG_BUF 3 diff --git a/src/telemetry_nmea.h b/src/telemetry/nmea.h similarity index 100% rename from src/telemetry_nmea.h rename to src/telemetry/nmea.h diff --git a/src/translations.cpp b/src/translations.cpp index ad2a35012..6fb0720c3 100644 --- a/src/translations.cpp +++ b/src/translations.cpp @@ -446,56 +446,56 @@ const pm_char STR_TRAINER[] PROGMEM = "Trainer"; #endif const pm_uchar font_5x7[] PROGMEM = { -#include "font.lbm" +#include "bitmaps/font.lbm" #if defined(TRANSLATIONS_SE) -#include "font_se.lbm" +#include "bitmaps/font_se.lbm" #elif defined(TRANSLATIONS_DE) -#include "font_de.lbm" +#include "bitmaps/font_de.lbm" #elif defined(TRANSLATIONS_IT) -#include "font_it.lbm" +#include "bitmaps/font_it.lbm" #elif defined(TRANSLATIONS_CZ) -#include "font_cz.lbm" +#include "bitmaps/font_cz.lbm" #elif defined(TRANSLATIONS_FR) -#include "font_fr.lbm" +#include "bitmaps/font_fr.lbm" #elif defined(TRANSLATIONS_ES) -#include "font_es.lbm" +#include "bitmaps/font_es.lbm" #endif }; const pm_uchar font_10x14[] PROGMEM = { -#include "font_dblsize.lbm" +#include "bitmaps/font_dblsize.lbm" #if defined(TRANSLATIONS_SE) -#include "font_dblsize_se.lbm" +#include "bitmaps/font_dblsize_se.lbm" #elif defined(TRANSLATIONS_DE) -#include "font_dblsize_de.lbm" +#include "bitmaps/font_dblsize_de.lbm" #elif defined(TRANSLATIONS_IT) -#include "font_dblsize_it.lbm" +#include "bitmaps/font_dblsize_it.lbm" #elif defined(TRANSLATIONS_FR) -#include "font_dblsize_fr.lbm" +#include "bitmaps/font_dblsize_fr.lbm" #elif defined(TRANSLATIONS_ES) -#include "font_dblsize_es.lbm" +#include "bitmaps/font_dblsize_es.lbm" #endif }; #if defined(CPUARM) const pm_uchar font_3x5[] PROGMEM = { -#include "font_tiny.lbm" +#include "bitmaps/font_tiny.lbm" }; const pm_uchar font_4x6[] PROGMEM = { -#include "font_small.lbm" +#include "bitmaps/font_small.lbm" }; const pm_uchar font_8x10[] PROGMEM = { -#include "font_midsize.lbm" +#include "bitmaps/font_midsize.lbm" }; const pm_uchar font_5x7_extra[] PROGMEM = { -#include "font_extra.lbm" +#include "bitmaps/font_extra.lbm" }; const pm_uchar font_10x14_extra[] PROGMEM = { -#include "font_dblsize_extra.lbm" +#include "bitmaps/font_dblsize_extra.lbm" }; #endif