Skip to content

Commit dc083e4

Browse files
committed
Merge remote-tracking branch 'tinyusb/master' into n6_build
Signed-off-by: Zixun LI <[email protected]>
2 parents e59b2c4 + fee2d2a commit dc083e4

File tree

721 files changed

+26366
-13297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+26366
-13297
lines changed

.PVS-Studio/.pvsconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//V_EXCLUDE_PATH */iar/cxarm*
2+
//V_EXCLUDE_PATH */pico-sdk/*
3+
//V_EXCLUDE_PATH */esp-idf/*
4+
//V_EXCLUDE_PATH */hw/mcu/*
5+
//V_EXCLUDE_PATH */hw/bsp/espressif/components/*
6+
//V_EXCLUDE_PATH */lib/*
7+
8+
//-V::2506 MISRA. A function should have a single point of exit at the end.
9+
//-V::2514 MISRA. Unions should not be used.
10+
//-V::2520 [MISRA-C-16.3] Every switch-clause should be terminated by an unconditional 'break' statement
11+
//-V:memcpy:2547 [MISRA-C-17.7] The return value of non-void function 'memcpy' should be used.
12+
//-V:memmove:2547 [MISRA-C-17.7] The return value of non-void function 'memmove' should be used.
13+
//-V:printf:2547 [MISRA-C-17.7]
14+
//-V::2584::{gintsts} dwc2 interrupt handler
15+
//-V::2584::{hcint} dwc2 interrupt handler
16+
//-V::2600 [MISRA-C-21.6] The function with the 'printf' name should not be used.
17+
//+V2614 DISABLE_LENGHT_LIMIT_CHECK:YES
18+
//-V:memcpy:2628 Pointer arguments to the 'memcpy' function should be pointers to qualified or unqualified versions of compatible types.
19+
//-V::2659 [MISRA-C-16.1] Switch statements should be well-formed. Every switch-clause should be terminated by an unconditional 'break' statement

.circleci/config.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232
BUILDSYSTEM_TOOLCHAIN+=("cmake arm-iar")
3333
fi
3434
35-
RESOURCE_LARGE='["nrf", "imxrt", "stm32f4", "stm32h7 stm32h7rs"]'
36-
3735
gen_build_entry() {
3836
local build_system="$1"
3937
local toolchain="$2"
@@ -61,21 +59,7 @@ jobs:
6159
FAMILY=$(echo $MATRIX_JSON | jq -r ".\"$toolchain\"")
6260
echo "FAMILY_${toolchain}=$FAMILY"
6361
64-
# FAMILY_LARGE = FAMILY - RESOURCE_LARGE
65-
# Separate large from medium+ resources
66-
FAMILY_LARGE=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[])))')
67-
FAMILY=$(jq -n --argjson family "$FAMILY" --argjson resource "$RESOURCE_LARGE" '$family | map(select(IN($resource[]) | not))')
68-
69-
if [[ $toolchain == esp-idf || $toolchain == arm-iar ]]; then
70-
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large"
71-
else
72-
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "medium+"
73-
74-
# add large resources if available
75-
if [ "$(echo $FAMILY_LARGE | jq 'length')" -gt 0 ]; then
76-
gen_build_entry "$build_system" "$toolchain" "$FAMILY_LARGE" "large"
77-
fi
78-
fi
62+
gen_build_entry "$build_system" "$toolchain" "$FAMILY" "large"
7963
done
8064
8165
- continuation/continue:

.circleci/config2.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ commands:
3434
chmod +x toolchain.run
3535
./toolchain.run -p ~/cache/<< parameters.toolchain >>/gnurx -y
3636
elif [[ << parameters.toolchain >> == arm-iar ]]; then
37+
wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/<< parameters.toolchain >>/iar-lmsc-tools.deb
3738
wget --progress=dot:giga $toolchain_url -O ~/cache/<< parameters.toolchain >>/toolchain.deb
3839
else
3940
wget --progress=dot:giga $toolchain_url -O toolchain.tar.gz
@@ -44,6 +45,7 @@ commands:
4445
# Add toolchain to PATH
4546
if [[ << parameters.toolchain >> == arm-iar ]]; then
4647
# Install IAR since we only cache deb file
48+
sudo dpkg -i ~/cache/<< parameters.toolchain >>/iar-lmsc-tools.deb
4749
sudo dpkg --ignore-depends=libusb-1.0-0 -i ~/cache/<< parameters.toolchain >>/toolchain.deb
4850
echo "export PATH=$PATH:/opt/iar/cxarm/arm/bin" >> $BASH_ENV
4951
else
@@ -102,6 +104,7 @@ commands:
102104

103105
- run:
104106
name: Build
107+
no_output_timeout: 20m
105108
command: |
106109
if [ << parameters.toolchain >> == esp-idf ]; then
107110
docker run --rm -v $PWD:/project -w /project espressif/idf:v5.3.2 python tools/build.py << parameters.family >>
@@ -125,7 +128,7 @@ jobs:
125128
parameters:
126129
resource_class:
127130
type: string
128-
default: medium+
131+
default: large
129132
build-system:
130133
type: string
131134
toolchain:

.clang-format

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,99 @@
1-
# Generated from CLion C/C++ Code Style settings
1+
---
2+
Language: Cpp
23
BasedOnStyle: LLVM
3-
AccessModifierOffset: -2
44
AlignAfterOpenBracket: Align
5-
AlignConsecutiveAssignments: None
6-
AlignOperands: Align
5+
AlignConsecutiveAssignments:
6+
Enabled: true
7+
AcrossEmptyLines: false
8+
AcrossComments: false
9+
AlignConsecutiveBitFields:
10+
Enabled: true
11+
AcrossEmptyLines: false
12+
AcrossComments: false
13+
AlignConsecutiveDeclarations:
14+
Enabled: true
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignConsecutiveMacros:
18+
Enabled: true
19+
AcrossEmptyLines: true
20+
AcrossComments: false
21+
AlignConsecutiveShortCaseStatements:
22+
Enabled: true
23+
AcrossEmptyLines: true
24+
AcrossComments: true
25+
AlignCaseColons: false
26+
AlignEscapedNewlines: LeftWithLastLine
27+
AlignOperands: true
28+
AlignTrailingComments:
29+
Kind: Always
30+
OverEmptyLines: 2
731
AllowAllArgumentsOnNextLine: false
832
AllowAllConstructorInitializersOnNextLine: false
933
AllowAllParametersOfDeclarationOnNextLine: false
10-
AllowShortBlocksOnASingleLine: Always
34+
AllowShortBlocksOnASingleLine: Empty
35+
AllowShortCaseExpressionOnASingleLine: true
1136
AllowShortCaseLabelsOnASingleLine: false
12-
AllowShortFunctionsOnASingleLine: All
13-
AllowShortIfStatementsOnASingleLine: Always
14-
AllowShortLambdasOnASingleLine: All
15-
AllowShortLoopsOnASingleLine: true
16-
AlwaysBreakAfterReturnType: None
37+
AllowShortEnumsOnASingleLine: false
38+
AllowShortFunctionsOnASingleLine: None
39+
AllowShortIfStatementsOnASingleLine: Never
1740
AlwaysBreakTemplateDeclarations: Yes
41+
BinPackArguments: true
1842
BreakBeforeBraces: Custom
1943
BraceWrapping:
2044
AfterCaseLabel: false
2145
AfterClass: false
22-
AfterControlStatement: Never
46+
AfterControlStatement: false
2347
AfterEnum: false
2448
AfterFunction: false
2549
AfterNamespace: false
50+
AfterStruct: false
2651
AfterUnion: false
27-
BeforeCatch: false
52+
AfterExternBlock: false
53+
BeforeCatch: true
2854
BeforeElse: false
29-
IndentBraces: false
30-
SplitEmptyFunction: false
55+
BeforeLambdaBody: false
56+
BeforeWhile: false
57+
SplitEmptyFunction: true
3158
SplitEmptyRecord: true
59+
SplitEmptyNamespace: true
60+
BracedInitializerIndentWidth: 2
3261
BreakBeforeBinaryOperators: None
33-
BreakBeforeTernaryOperators: true
34-
BreakConstructorInitializers: BeforeColon
35-
BreakInheritanceList: BeforeColon
36-
ColumnLimit: 0
37-
CompactNamespaces: false
38-
ContinuationIndentWidth: 4
39-
IndentCaseLabels: true
62+
BreakConstructorInitializers: AfterColon
63+
BreakConstructorInitializersBeforeComma: false
64+
ContinuationIndentWidth: 2
65+
ColumnLimit: 120
66+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
67+
Cpp11BracedListStyle: true
68+
IncludeBlocks: Preserve
69+
IncludeCategories:
70+
- Regex: '^<.*'
71+
Priority: 1
72+
- Regex: '^".*'
73+
Priority: 2
74+
- Regex: '.*'
75+
Priority: 3
76+
IncludeIsMainRegex: '([-_](test|unittest))?$'
4077
IndentPPDirectives: BeforeHash
41-
IndentWidth: 2
42-
KeepEmptyLinesAtTheStartOfBlocks: true
78+
InsertBraces: true
79+
IndentCaseLabels: true
80+
InsertNewlineAtEOF: true
81+
MacroBlockBegin: ''
82+
MacroBlockEnd: ''
4383
MaxEmptyLinesToKeep: 2
4484
NamespaceIndentation: All
45-
ObjCSpaceAfterProperty: false
46-
ObjCSpaceBeforeProtocolList: true
47-
PointerAlignment: Right
85+
PenaltyBreakBeforeFirstCallParameter: 1000000
86+
PenaltyBreakOpenParenthesis: 1000000
87+
QualifierAlignment: Custom
88+
QualifierOrder: ['static', 'const', 'volatile', 'restrict', 'type']
4889
ReflowComments: false
49-
SpaceAfterCStyleCast: true
50-
SpaceAfterLogicalNot: false
5190
SpaceAfterTemplateKeyword: false
52-
SpaceBeforeAssignmentOperators: true
53-
SpaceBeforeCpp11BracedList: false
54-
SpaceBeforeCtorInitializerColon: true
55-
SpaceBeforeInheritanceColon: true
56-
SpaceBeforeParens: ControlStatements
5791
SpaceBeforeRangeBasedForLoopColon: false
5892
SpaceInEmptyParentheses: false
59-
SpacesBeforeTrailingComments: 0
6093
SpacesInAngles: false
94+
SpacesInConditionalStatement: false
6195
SpacesInCStyleCastParentheses: false
62-
SpacesInContainerLiterals: true
6396
SpacesInParentheses: false
64-
SpacesInSquareBrackets: false
97+
SortIncludes: false
6598
TabWidth: 2
66-
UseTab: Never
99+
...

.github/actions/get_deps/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ runs:
1919
- name: Linux dependencies
2020
if: runner.os == 'Linux'
2121
run: |
22-
sudo apt install -y ninja-build
22+
NINJA_URL=https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-linux.zip
23+
wget $NINJA_URL -O ninja-linux.zip
24+
unzip ninja-linux.zip -d ninja-bin
25+
echo >> $GITHUB_PATH "${{ github.workspace }}/ninja-bin"
2326
shell: bash
2427

2528
- name: Get Dependencies
29+
env:
30+
ARG: ${{ inputs.arg }}
2631
run: |
27-
python3 tools/get_deps.py ${{ inputs.arg }}
32+
python3 tools/get_deps.py ${ARG}
2833
echo "PICO_SDK_PATH=${{ github.workspace }}/pico-sdk" >> $GITHUB_ENV
2934
shell: bash

.github/actions/setup_toolchain/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ runs:
3030
inputs.toolchain != 'arm-gcc' &&
3131
inputs.toolchain != 'esp-idf'
3232
id: set-toolchain-url
33+
env:
34+
TOOLCHAIN: ${{ inputs.toolchain }}
3335
run: |
34-
TOOLCHAIN_URL=$(jq -r '."${{ inputs.toolchain }}"' .github/actions/setup_toolchain/toolchain.json)
36+
TOOLCHAIN_URL=$(jq -r --arg tc "$TOOLCHAIN" '.[$tc]' .github/actions/setup_toolchain/toolchain.json)
3537
echo "toolchain_url=$TOOLCHAIN_URL"
3638
echo "toolchain_url=$TOOLCHAIN_URL" >> $GITHUB_OUTPUT
3739
shell: bash
@@ -47,11 +49,13 @@ runs:
4749

4850
- name: Set toolchain option
4951
id: set-toolchain-option
52+
env:
53+
TOOLCHAIN: ${{ inputs.toolchain }}
5054
run: |
5155
BUILD_OPTION=""
52-
if [[ "${{ inputs.toolchain }}" == *"clang"* ]]; then
56+
if [[ "$TOOLCHAIN" == *"clang"* ]]; then
5357
BUILD_OPTION="--toolchain clang"
54-
elif [[ "${{ inputs.toolchain }}" == "arm-iar" ]]; then
58+
elif [[ "$TOOLCHAIN" == "arm-iar" ]]; then
5559
BUILD_OPTION="--toolchain iar"
5660
fi
5761
echo "build_option=$BUILD_OPTION"

.github/actions/setup_toolchain/download/action.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,34 @@ runs:
2121

2222
- name: Install Toolchain
2323
if: steps.cache-toolchain-download.outputs.cache-hit != 'true'
24+
env:
25+
TOOLCHAIN: ${{ inputs.toolchain }}
26+
TOOLCHAIN_URL: ${{ inputs.toolchain_url }}
2427
run: |
25-
mkdir -p ~/cache/${{ inputs.toolchain }}
28+
mkdir -p ~/cache/${TOOLCHAIN}
2629
27-
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
28-
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.run
30+
if [[ ${TOOLCHAIN} == rx-gcc ]]; then
31+
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.run
2932
chmod +x toolchain.run
30-
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
31-
elif [[ ${{ inputs.toolchain }} == arm-iar ]]; then
32-
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O ~/cache/${{ inputs.toolchain }}/cxarm.deb
33+
./toolchain.run -p ~/cache/${TOOLCHAIN}/gnurx -y
34+
elif [[ ${TOOLCHAIN} == arm-iar ]]; then
35+
wget --progress=dot:giga https://netstorage.iar.com/FileStore/STANDARD/001/003/926/iar-lmsc-tools_1.8_amd64.deb -O ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
36+
wget --progress=dot:giga ${TOOLCHAIN_URL} -O ~/cache/${TOOLCHAIN}/cxarm.deb
3337
else
34-
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
35-
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
38+
wget --progress=dot:giga ${TOOLCHAIN_URL} -O toolchain.tar.gz
39+
tar -C ~/cache/${TOOLCHAIN} -xaf toolchain.tar.gz
3640
fi
3741
shell: bash
3842

3943
- name: Setup Toolchain
44+
env:
45+
TOOLCHAIN: ${{ inputs.toolchain }}
4046
run: |
41-
if [[ ${{ inputs.toolchain }} == arm-iar ]]; then
42-
sudo apt-get install -y ~/cache/${{ inputs.toolchain }}/cxarm.deb
47+
if [[ ${TOOLCHAIN} == arm-iar ]]; then
48+
sudo dpkg -i ~/cache/${TOOLCHAIN}/iar-lmsc-tools.deb
49+
sudo apt install -y ~/cache/${TOOLCHAIN}/cxarm.deb
4350
echo >> $GITHUB_PATH "/opt/iar/cxarm/arm/bin"
4451
else
45-
echo >> $GITHUB_PATH `echo ~/cache/${{ inputs.toolchain }}/*/bin`
52+
echo >> $GITHUB_PATH `echo ~/cache/${TOOLCHAIN}/*/bin`
4653
fi
4754
shell: bash

.github/actions/setup_toolchain/espressif/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ runs:
1313
using: "composite"
1414
steps:
1515
- name: Set DOCKER_ESP_IDF
16+
env:
17+
TOOLCHAIN: ${{ inputs.toolchain }}
1618
run: |
17-
DOCKER_ESP_IDF=$HOME/cache/${{ inputs.toolchain }}/docker_image.tar
19+
DOCKER_ESP_IDF=$HOME/cache/${TOOLCHAIN}/docker_image.tar
1820
echo "DOCKER_ESP_IDF=$DOCKER_ESP_IDF" >> $GITHUB_ENV
1921
shell: bash
2022

@@ -27,10 +29,12 @@ runs:
2729

2830
- name: Pull and Save Docker Image
2931
if: steps.cache-toolchain-espressif.outputs.cache-hit != 'true'
32+
env:
33+
TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
3034
run: |
31-
docker pull espressif/idf:${{ inputs.toolchain_version }}
35+
docker pull espressif/idf:${TOOLCHAIN_VERSION}
3236
mkdir -p $(dirname $DOCKER_ESP_IDF)
33-
docker save -o $DOCKER_ESP_IDF espressif/idf:${{ inputs.toolchain_version }}
37+
docker save -o $DOCKER_ESP_IDF espressif/idf:${TOOLCHAIN_VERSION}
3438
du -sh $DOCKER_ESP_IDF
3539
shell: bash
3640

@@ -42,7 +46,9 @@ runs:
4246
shell: bash
4347

4448
- name: Tag Local Image
49+
env:
50+
TOOLCHAIN_VERSION: ${{ inputs.toolchain_version }}
4551
run: |
46-
docker tag espressif/idf:${{ inputs.toolchain_version }} espressif/idf:tinyusb
52+
docker tag espressif/idf:${TOOLCHAIN_VERSION} espressif/idf:tinyusb
4753
docker images
4854
shell: bash

.github/actions/setup_toolchain/toolchain.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"msp430-gcc": "http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2",
66
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
77
"rx-gcc": "https://github.com/hathach/rx_device/releases/download/0.0.1/gcc-8.3.0.202411-GNURX-ELF.run",
8-
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/583/cxarm-9.60.4.deb"
8+
"arm-iar": "https://netstorage.iar.com/FileStore/STANDARD/001/003/723/cxarm-9.70.1.deb"
99
}

0 commit comments

Comments
 (0)