Skip to content

Commit

Permalink
Merge pull request #7 from iNavFlight/master
Browse files Browse the repository at this point in the history
Merge from master
  • Loading branch information
MrD-RC authored Feb 6, 2021
2 parents 7d0f987 + c892036 commit 1dd3297
Show file tree
Hide file tree
Showing 668 changed files with 773,500 additions and 4,495 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Make sure docs are updated
on:
pull_request:
paths:
- src/main/fc/settings.yaml
- docs/Settings.md
push:
paths:
- src/main/fc/settings.yaml
Expand Down
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else()
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TOOLCHAIN}-checks.cmake")
endif()

project(INAV VERSION 2.6.0)
project(INAV VERSION 2.7.0)

enable_language(ASM)

Expand Down Expand Up @@ -58,6 +58,12 @@ set(FIRMWARE_VERSION ${PROJECT_VERSION})
option(WARNINGS_AS_ERRORS "Make all warnings into errors")
message("-- toolchain: ${TOOLCHAIN}, WARNINGS_AS_ERRORS: ${WARNINGS_AS_ERRORS}")

set(COMMON_COMPILE_DEFINITIONS
FC_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR}
FC_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR}
FC_VERSION_PATCH_LEVEL=${CMAKE_PROJECT_VERSION_PATCH}
)

include(settings)
include(openocd)
include(svd)
Expand Down
18 changes: 9 additions & 9 deletions cmake/arm-none-eabi-checks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ include(gcc)
set(arm_none_eabi_triplet "arm-none-eabi")

# Keep version in sync with the distribution files below
set(arm_none_eabi_gcc_version "9.2.1")
set(arm_none_eabi_base_url "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major")
# suffix and sha1
set(arm_none_eabi_win32 "win32.zip" 60f364ecf2e8717a58d352db95b388eee508b727)
set(arm_none_eabi_linux_amd64 "x86_64-linux.tar.bz2" 3829ff61b2601c6cf061a5a275c2538a96a8d521)
set(arm_none_eabi_linux_aarch64 "aarch64-linux.tar.bz2" fdb6fe7058927ad897f63d2d245f825a9587a1c5)
set(arm_none_eabi_gcc_macos "mac.tar.bz2" 26fe33e0c25d9a2947c0373ea48c00ef46eacd58)
set(arm_none_eabi_gcc_version "9.3.1")
set(arm_none_eabi_base_url "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update")
# suffix and checksum
set(arm_none_eabi_win32 "win32.zip" 184b3397414485f224e7ba950989aab6)
set(arm_none_eabi_linux_amd64 "x86_64-linux.tar.bz2" 2b9eeccc33470f9d3cda26983b9d2dc6)
set(arm_none_eabi_linux_aarch64 "aarch64-linux.tar.bz2" 000b0888cbe7b171e2225b29be1c327c)
set(arm_none_eabi_gcc_macos "mac.tar.bz2" 75a171beac35453fd2f0f48b3cb239c3)

function(arm_none_eabi_gcc_distname var)
string(REPLACE "/" ";" url_parts ${arm_none_eabi_base_url})
Expand Down Expand Up @@ -54,7 +54,7 @@ function(arm_none_eabi_gcc_install)
message(FATAL_ERROR "could not install ${arm_none_eabi_triplet}-gcc automatically")
endif()
list(GET dist 0 dist_suffix)
list(GET dist 1 dist_sha1)
list(GET dist 1 dist_checksum)
set(dist_url "${arm_none_eabi_base_url}-${dist_suffix}")
string(REPLACE "/" ";" url_parts ${dist_url})
list(LENGTH url_parts n)
Expand All @@ -66,7 +66,7 @@ function(arm_none_eabi_gcc_install)
INACTIVITY_TIMEOUT 30
STATUS status
SHOW_PROGRESS
EXPECTED_HASH SHA1=${dist_sha1}
EXPECTED_HASH MD5=${dist_checksum}
TLS_VERIFY ON
)
list(GET status 0 status_code)
Expand Down
3 changes: 2 additions & 1 deletion cmake/stm32.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ include(stm32-bootloader)
include(stm32f3)
include(stm32f4)
include(stm32f7)
include(stm32h7)

include(CMakeParseArguments)

Expand Down Expand Up @@ -303,7 +304,7 @@ function(target_stm32)

set(target_include_directories ${args_INCLUDE_DIRECTORIES})

set(target_definitions ${STM32_DEFINITIONS})
set(target_definitions ${STM32_DEFINITIONS} ${COMMON_COMPILE_DEFINITIONS})

get_stm32_target_features(features "${CMAKE_CURRENT_SOURCE_DIR}" ${name})
set_property(TARGET ${elf_target} PROPERTY FEATURES ${features})
Expand Down
5 changes: 4 additions & 1 deletion cmake/stm32f3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ glob_except(STM32F3_STDPERIPH_SRC "${STM32F3_STDPERIPH_SRC_DIR}/*.c" "${STM32F3_

main_sources(STM32F3_SRC
target/system_stm32f30x.c

config/config_streamer_stm32f3.c

drivers/adc_stm32f30x.c
drivers/bus_i2c_stm32f30x.c
drivers/dma_stm32f3xx.c
Expand Down Expand Up @@ -55,7 +58,7 @@ set(STM32F3_DEFINITIONS
set(STM32F303CC_DEFINITIONS
STM32F303
STM32F303xC
FLASH_SIZE=256
MCU_FLASH_SIZE=256
)

function(target_stm32f3xx)
Expand Down
9 changes: 6 additions & 3 deletions cmake/stm32f4.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ glob_except(STM32F4_STDPERIPH_SRC "${STM32F4_STDPERIPH_SRC_DIR}/*.c" "${STM32F4_

main_sources(STM32F4_SRC
target/system_stm32f4xx.c

config/config_streamer_stm32f4.c

drivers/adc_stm32f4xx.c
drivers/adc_stm32f4xx.c
drivers/bus_i2c_stm32f40x.c
Expand Down Expand Up @@ -98,7 +101,7 @@ endfunction()
set(STM32F405_COMPILE_DEFINITIONS
STM32F40_41xxx
STM32F405xx
FLASH_SIZE=1024
MCU_FLASH_SIZE=1024
)

function(target_stm32f405xg name)
Expand All @@ -120,7 +123,7 @@ exclude_basenames(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F411_OR_F427_STDPERIPH_

set(STM32F411_COMPILE_DEFINITIONS
STM32F411xE
FLASH_SIZE=512
MCU_FLASH_SIZE=512
)

function(target_stm32f411xe name)
Expand All @@ -137,7 +140,7 @@ endfunction()

set(STM32F427_COMPILE_DEFINITIONS
STM32F427_437xx
FLASH_SIZE=1024
MCU_FLASH_SIZE=1024
)
function(target_stm32f427xg name)
target_stm32f4xx(
Expand Down
18 changes: 13 additions & 5 deletions cmake/stm32f7.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ set(STM32F7_VCP_DIR "${MAIN_SRC_DIR}/vcp_hal")

set(STM32F7_VCP_SRC
usbd_desc.c
usbd_conf.c
usbd_conf_stm32f7xx.c
usbd_cdc_interface.c
)
list(TRANSFORM STM32F7_VCP_SRC PREPEND "${STM32F7_VCP_DIR}/")
Expand All @@ -59,10 +59,13 @@ set(STM32F7_INCLUDE_DIRS

main_sources(STM32F7_SRC
target/system_stm32f7xx.c

config/config_streamer_stm32f7.c

drivers/adc_stm32f7xx.c
drivers/bus_i2c_hal.c
drivers/dma_stm32f7xx.c
drivers/bus_spi_hal.c
drivers/bus_spi_hal_ll.c
drivers/timer.c
drivers/timer_impl_hal.c
drivers/timer_stm32f7xx.c
Expand Down Expand Up @@ -94,8 +97,6 @@ function(target_stm32f7xx)
VCP_SOURCES ${STM32F7_USB_SRC} ${STM32F7_VCP_SRC}
VCP_INCLUDE_DIRECTORIES ${STM32F7_USB_INCLUDE_DIRS} ${STM32F7_VCP_DIR}

OPTIMIZATION -O2

OPENOCD_TARGET stm32f7x

BOOTLOADER
Expand All @@ -109,17 +110,24 @@ macro(define_target_stm32f7 subfamily size)
set(func_ARGV ARGV)
string(TOUPPER ${size} upper_size)
get_stm32_flash_size(flash_size ${size})
if(flash_size GREATER 512)
set(opt -O2)
else()
set(opt -Os)
endif()
set(definitions
STM32F7
STM32F7${subfamily}xx
STM32F7${subfamily}x${upper_size}
FLASH_SIZE=${flash_size}
MCU_FLASH_SIZE=${flash_size}
)
target_stm32f7xx(
NAME ${name}
STARTUP startup_stm32f7${subfamily}xx.s
COMPILE_DEFINITIONS ${definitions}
LINKER_SCRIPT stm32_flash_f7${subfamily}x${size}
OPTIMIZATION ${opt}

${${func_ARGV}}
)
endfunction()
Expand Down
41 changes: 41 additions & 0 deletions cmake/stm32h7-usb.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
set(STM32H7_USBCORE_DIR "${MAIN_LIB_DIR}/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Core")
set(STM32H7_USBCORE_SRC
usbd_core.c
usbd_ctlreq.c
usbd_ioreq.c
)
list(TRANSFORM STM32H7_USBCORE_SRC PREPEND "${STM32H7_USBCORE_DIR}/Src/")

set(STM32H7_USBCDC_DIR "${MAIN_LIB_DIR}/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC")
set(STM32H7_USBCDC_SRC
usbd_cdc.c
)
list(TRANSFORM STM32H7_USBCDC_SRC PREPEND "${STM32H7_USBCDC_DIR}/Src/")

set(STM32H7_USBHID_DIR "${MAIN_LIB_DIR}/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/HID")
set(STM32H7_USBHID_SRC
usbd_hid.c
)
list(TRANSFORM STM32H7_USBHID_SRC PREPEND "${STM32H7_USBHID_DIR}/Src/")

set(STM32H7_USBMSC_DIR "${MAIN_LIB_DIR}/main/STM32H7/Middlewares/ST/STM32_USB_Device_Library/Class/MSC")
set(STM32H7_USBMSC_SRC
usbd_msc.c
usbd_msc_bot.c
usbd_msc_data.c
usbd_msc_scsi.c
)
list(TRANSFORM STM32H7_USBMSC_SRC PREPEND "${STM32H7_USBMSC_DIR}/Src/")

set(STM32H7_USB_INCLUDE_DIRS
"${STM32H7_USBCORE_DIR}/Inc"
"${STM32H7_USBCDC_DIR}/Inc"
"${STM32H7_USBHID_DIR}/Inc"
"${STM32H7_USBMSC_DIR}/Inc"
)

list(APPEND STM32H7_USB_SRC ${STM32H7_USBCORE_SRC})
list(APPEND STM32H7_USB_SRC ${STM32H7_USBCDC_SRC})
list(APPEND STM32H7_USB_SRC ${STM32H7_USBHID_SRC})
#XXX: Not working yet
#list(APPEND STM32H7_USB_SRC ${STM32H7_USBMSC_SRC})
Loading

0 comments on commit 1dd3297

Please sign in to comment.