Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/tinyusb/master' into rx_fb
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFiPhile committed May 8, 2024
2 parents 0e907b4 + 74e5749 commit 8133af4
Show file tree
Hide file tree
Showing 268 changed files with 10,490 additions and 3,946 deletions.
66 changes: 66 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Generated from CLion C/C++ Code Style settings
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: None
AlignOperands: Align
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Always
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ColumnLimit: 0
CompactNamespaces: false
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 2
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 0
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 2
UseTab: Never
9 changes: 1 addition & 8 deletions .github/workflows/build_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@ jobs:
matrix:
family:
# Alphabetical order
- 'broadcom_32bit'
- 'kinetis_k32l2'
- 'lpc11 lpc13 lpc15'
- 'lpc51'
- 'mm32 msp432e4'
- 'samd11 same5x saml2x'
- 'stm32l0 stm32wb'
- 'tm4c123 xmc4000'
- 'mm32'
steps:
- name: Setup Python
uses: actions/setup-python@v5
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ jobs:
matrix:
family:
# Alphabetical order
- 'broadcom_32bit'
- 'imxrt'
- 'kinetis_k kinetis_kl'
- 'kinetis_k kinetis_kl kinetis_k32l2'
- 'lpc11 lpc13 lpc15'
- 'lpc17 lpc18 lpc40 lpc43'
- 'lpc54 lpc55'
- 'lpc51 lpc54 lpc55'
- 'mcx'
- 'msp432e4'
- 'mm32'
- 'nrf'
- 'ra'
- 'rp2040'
- 'samd21'
- 'samd51'
- 'samd11 samd21 saml2x samd5x_e5x samg'
- 'stm32f0'
- 'stm32f1'
- 'stm32f2'
Expand All @@ -59,6 +62,9 @@ jobs:
- 'stm32h7'
- 'stm32l4'
- 'stm32u5'
- 'stm32wb'
- 'tm4c'
- 'xmc4000'
steps:
- name: Setup Python
uses: actions/setup-python@v5
Expand Down Expand Up @@ -87,28 +93,28 @@ jobs:
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
run: python tools/build_cmake.py ${{ matrix.family }}
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

- name: Upload Artifacts for Hardware Testing (rp2040)
if: matrix.family == 'rp2040' && github.repository_owner == 'hathach'
if: contains(matrix.family, 'rp2040') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v4
with:
name: raspberry_pi_pico
path: |
cmake-build/cmake-build-raspberry_pi_pico/*/*/*.elf
- name: Upload Artifacts for Hardware Testing (nRF)
if: matrix.family == 'nrf' && github.repository_owner == 'hathach'
if: contains(matrix.family, 'nrf') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v4
with:
name: feather_nrf52840_express
path: |
cmake-build/cmake-build-feather_nrf52840_express/*/*/*.elf
- name: Upload Artifacts for Hardware Testing (samd51)
if: matrix.family == 'samd51' && github.repository_owner == 'hathach'
if: contains(matrix.family, 'samd5x_e5x') && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v4
with:
name: itsybitsy_m4
Expand All @@ -134,7 +140,7 @@ jobs:
#- 'ra' port later
#- 'rp2040' port later
- 'samd21'
- 'samd51'
- 'samd5x_e5x'
- 'stm32f0'
- 'stm32f1'
- 'stm32f2'
Expand Down Expand Up @@ -188,7 +194,7 @@ jobs:
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang -DCMAKE_BUILD_TYPE=MinSizeRel
run: python tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=clang
env:
PICO_SDK_PATH: ${{ github.workspace }}/pico-sdk

Expand Down Expand Up @@ -236,7 +242,7 @@ jobs:
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python tools/build_cmake.py ${{ matrix.family }} -DCMAKE_BUILD_TYPE=MinSizeRel
run: python tools/build_cmake.py ${{ matrix.family }}

# ---------------------------------------
# Hardware in the loop (HIL)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_iar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: python3 tools/get_deps.py ${{ matrix.family }}

- name: Build
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar -DCMAKE_BUILD_TYPE=MinSizeRel
run: python3 tools/build_cmake.py ${{ matrix.family }} -DTOOLCHAIN=iar

- name: Test on actual hardware (hardware in the loop)
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ hw/mcu/st/cmsis_device_f4
hw/mcu/st/cmsis_device_f7
hw/mcu/st/cmsis_device_g0
hw/mcu/st/cmsis_device_g4
hw/mcu/st/cmsis_device_h5
hw/mcu/st/cmsis_device_h7
hw/mcu/st/cmsis_device_l0
hw/mcu/st/cmsis_device_l1
Expand All @@ -72,6 +73,7 @@ hw/mcu/st/stm32f4xx_hal_driver
hw/mcu/st/stm32f7xx_hal_driver
hw/mcu/st/stm32g0xx_hal_driver
hw/mcu/st/stm32g4xx_hal_driver
hw/mcu/st/stm32h5xx_hal_driver
hw/mcu/st/stm32h7xx_hal_driver
hw/mcu/st/stm32l0xx_hal_driver
hw/mcu/st/stm32l1xx_hal_driver
Expand Down
41 changes: 39 additions & 2 deletions .idea/cmake.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/runConfigurations/rp2040.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions examples/build_system/cmake/cpu/arm1176jzf-s.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
-mcpu=arm1176jzf-s
-ffreestanding
)
# set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "clang")
set(TOOLCHAIN_COMMON_FLAGS
--target=arm-none-eabi
-mcpu=arm1176jzf-s
-mfpu=none
-mfloat-abi=soft
-ffreestanding
)
#set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "iar")
message(FATAL_ERROR "IAR not supported")

endif ()
21 changes: 21 additions & 0 deletions examples/build_system/cmake/cpu/arm926ej-s.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
-mcpu=arm926ej-s
-ffreestanding
)
# set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "clang")
set(TOOLCHAIN_COMMON_FLAGS
--target=arm-none-eabi
-mcpu=arm926ej-s
-mfpu=none
-mfloat-abi=soft
-ffreestanding
)
#set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "iar")
message(FATAL_ERROR "IAR not supported")

endif ()
17 changes: 17 additions & 0 deletions examples/build_system/cmake/cpu/cortex-a53.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
-mcpu=cortex-a53
)
# set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "clang")
set(TOOLCHAIN_COMMON_FLAGS
--target=arm-none-eabi
-mcpu=cortex-a53
)
#set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "iar")
message(FATAL_ERROR "IAR not supported")

endif ()
17 changes: 17 additions & 0 deletions examples/build_system/cmake/cpu/cortex-a72.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
-mcpu=cortex-a72
)
# set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "clang")
set(TOOLCHAIN_COMMON_FLAGS
--target=arm-none-eabi
-mcpu=cortex-a72
)
#set(FREERTOS_PORT GCC_ARM_CM0 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "iar")
message(FATAL_ERROR "IAR not supported")

endif ()
25 changes: 25 additions & 0 deletions examples/build_system/cmake/cpu/cortex-m7-fpsp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if (TOOLCHAIN STREQUAL "gcc")
set(TOOLCHAIN_COMMON_FLAGS
-mthumb
-mcpu=cortex-m7
-mfloat-abi=hard
-mfpu=fpv5-sp-d16
)
set(FREERTOS_PORT GCC_ARM_CM7 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "clang")
set(TOOLCHAIN_COMMON_FLAGS
--target=arm-none-eabi
-mcpu=cortex-m7
-mfpu=fpv5-sp-d16
)
set(FREERTOS_PORT GCC_ARM_CM7 CACHE INTERNAL "")

elseif (TOOLCHAIN STREQUAL "iar")
set(TOOLCHAIN_COMMON_FLAGS
--cpu cortex-m7
--fpu VFPv5_sp
)
set(FREERTOS_PORT IAR_ARM_CM7 CACHE INTERNAL "")

endif ()
21 changes: 21 additions & 0 deletions examples/build_system/cmake/toolchain/aarch64_gcc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
if (NOT DEFINED CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER "aarch64-none-elf-gcc")
endif ()

if (NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "aarch64-none-elf-g++")
endif ()

set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
set(CMAKE_SIZE "aarch64-none-elf-size" CACHE FILEPATH "")
set(CMAKE_OBJCOPY "aarch64-none-elf-objcopy" CACHE FILEPATH "")
set(CMAKE_OBJDUMP "aarch64-none-elf-objdump" CACHE FILEPATH "")

include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)

get_property(IS_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
if (IS_IN_TRY_COMPILE)
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -nostdlib")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -nostdlib")
cmake_print_variables(CMAKE_C_LINK_FLAGS)
endif ()
File renamed without changes.
Loading

0 comments on commit 8133af4

Please sign in to comment.