Fix doc path
[opentx.git] / radio / src / targets / common / arm / stm32 / CMakeLists.txt
blob3c7c046bfbfa93f824a52c09fa1be57e4988c047
1 set(LUA "NO" CACHE STRING "Lua scripts (YES/NO/NO_MODEL_SCRIPTS)")
2 set_property(CACHE LUA PROPERTY STRINGS YES NO NO_MODEL_SCRIPTS)
3 set(LUA_SCRIPT_LOAD_MODE "" CACHE STRING "Script loading mode and compilation flags [btTxcd] (see loadScript() API docs). Blank for default ('bt' on radio, 'T' on SIMU/DEBUG builds)")
4 option(LUA_COMPILER "Pre-compile and save Lua scripts" OFF)
5 option(LUA_ALLOCATOR_TRACER "Trace Lua memory (de)allocations to debug port (also needs DEBUG=YES NANO=NO)" OFF)
7 set(ARCH ARM)
8 set(STM32USB_DIR ${THIRDPARTY_DIR}/STM32_USB-Host-Device_Lib_V2.2.0/Libraries)
9 add_definitions(-DSTM32 -DLUA_INPUTS -DVARIO -DCROSSFIRE)
10 include_directories(${RADIO_SRC_DIRECTORY}/targets/common/arm/stm32)
11 include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
12 include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc)
13 include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/msc/inc)
14 include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/hid/inc)
15 include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Class/cdc/inc)
16 include_directories(${STM32USB_DIR}/STM32_USB_Device_Library/Core/inc/)
17 include_directories(${STM32USB_DIR}/STM32_USB_OTG_Driver/inc)
18 set(STM32USB_SRC
19   STM32_USB_OTG_Driver/src/usb_core.c
20   STM32_USB_OTG_Driver/src/usb_dcd.c
21   STM32_USB_OTG_Driver/src/usb_dcd_int.c
22   STM32_USB_Device_Library/Core/src/usbd_core.c
23   STM32_USB_Device_Library/Core/src/usbd_ioreq.c
24   STM32_USB_Device_Library/Core/src/usbd_req.c
25   )
26 set(TARGET_SRC
27   ${TARGET_SRC}
28   ../common/arm/stm32/rtc_driver.cpp
29   ../common/arm/stm32/cpu_id.cpp
30   ${SERIAL2_DRIVER}
31   )
32 set(FIRMWARE_TARGET_SRC
33   ${FIRMWARE_TARGET_SRC}
34   ../common/arm/stm32/delays.cpp
35   ../common/arm/stm32/usb_bsp.c
36   ../common/arm/stm32/usbd_desc.c
37   ../common/arm/stm32/usbd_usr.cpp
38   ../common/arm/stm32/usb_driver.cpp
39   ../common/arm/stm32/flash_driver.cpp
40   )
42 if(DEBUG OR CLI)
43   set(STM32USB_SRC
44     ${STM32USB_SRC}
45     STM32_USB_Device_Library/Class/cdc/src/usbd_cdc_core.c
46   )
47   set(FIRMWARE_TARGET_SRC
48     ${FIRMWARE_TARGET_SRC}
49     ../common/arm/stm32/usbd_cdc.cpp
50   )
51   add_definitions(-DUSB_SERIAL)
52 endif()
53 set(STM32USB_SRC
54   ${STM32USB_SRC}
55   STM32_USB_Device_Library/Class/msc/src/usbd_msc_data.c
56   STM32_USB_Device_Library/Class/msc/src/usbd_msc_scsi.c
57   STM32_USB_Device_Library/Class/msc/src/usbd_msc_bot.c
58   STM32_USB_Device_Library/Class/msc/src/usbd_msc_core.c
59   )
60 set(FIRMWARE_TARGET_SRC
61   ${FIRMWARE_TARGET_SRC}
62   ../common/arm/stm32/usbd_storage_msd.cpp
63   )
64 set(FIRMWARE_TARGET_SRC
65   ${FIRMWARE_TARGET_SRC}
66   ../common/arm/stm32/usbd_hid_joystick.c
67   )
68 if(GVARS)
69   set(GUI_SRC
70     ${GUI_SRC}
71     ${GVAR_SCREEN}
72     )
73 endif()
74 set(FIRMWARE_SRC
75   ${FIRMWARE_SRC}
76   serial.cpp
77   syscalls.c
78   )
79 foreach(FILE ${STM32LIB_SRC})
80   set(FIRMWARE_SRC
81     ${FIRMWARE_SRC}
82     ${STM32LIB_DIR}/${FILE}
83     )
84 endforeach()
85 foreach(FILE ${STM32USB_SRC})
86   set(FIRMWARE_SRC
87     ${FIRMWARE_SRC}
88     ${STM32USB_DIR}/${FILE}
89     )
90 endforeach()
91 set(SRC
92   ${SRC}
93   telemetry/crossfire.cpp
94   io/bootloader_flash.cpp
95   )
96 set(PULSES_SRC
97   ${PULSES_SRC}
98   crossfire.cpp
99   )