Sync betaflight to Gitea

This commit is contained in:
2026-08-03 16:37:10 +08:00
commit ad3163cf91
4712 changed files with 3301380 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
custom: https://paypal.me/betaflight
patreon: betaflight
+8
View File
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Configuration and other support questions
url: https://github.com/betaflight/betaflight#support-and-developers-channel
about: Official Slack chat channel and Facebook group about Betaflight
- name: Hardware Issues
url: https://github.com/betaflight/betaflight#hardware-issues
about: What to do in the case of hardware issues
@@ -0,0 +1,36 @@
name: Feature Request
description: Suggest an idea for for a new feature for Betaflight.
labels: ["Template: Feature Request"]
body:
- type: markdown
attributes:
value: |
**Please note that feature requests are not 'fire and forget'.**
It is a lot more likely that the feature you would like to have will be implemented if you keep watching your feature request, and provide more details to developers looking into implementing your feature, and help them with testing.
- type: textarea
attributes:
label: Is your feature request related to a problem? Please describe
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...].
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
- type: textarea
attributes:
label: Other information
description: Add any other context or screenshots about the feature request that you think might be relevant here.
@@ -0,0 +1,83 @@
name: Firmware Bug Report
description: Create a report to help us fix bugs in the Betaflight firmware.
labels: ["Template: Bug"]
body:
- type: markdown
attributes:
value: |
# Please fill all the fields with the required information
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
attributes:
label: To Reproduce
description: Steps to reproduce the behavior.
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: markdown
attributes:
value: |
# Flight controller configuration
- type: textarea
attributes:
label: Support ID
description: |
If missing any drivers for GYRO, ACC, MAG, BARO, FLASH or OSD it's required to flash a `Core Only` build for your board.
Go to CLI tab and use the `Submit Support Data` button to get an `Support ID`. Please post the `Support ID` here.
Don't add three backticks or any other format symbol at the start or end of the block, they will be added automatically.
placeholder: |
# PASTE HERE THE OUTPUT OF `Support ID` IN THE CLI TAB
render: txt
validations:
required: true
- type: markdown
attributes:
value: |
# Setup / Versions
- type: input
attributes:
label: Flight controller
description: Specify your flight controller model (what type is it, where was it bought from, ...).
validations:
required: true
- type: textarea
attributes:
label: Other components
description: Specify other components attached to the flight controller (RX, VTX, brand / model for all of them, firmware version where applicable...).
- type: textarea
attributes:
label: How are the different components wired up (including port information)
description: Details about how all is wired.
- type: markdown
attributes:
value: |
# Other information
- type: textarea
attributes:
label: Add any other context about the problem that you think might be relevant here
+23
View File
@@ -0,0 +1,23 @@
## Important considerations when opening a pull request:
1. Make sure you do not make the changes you want to open a pull request for on the `master` branch of your fork, or open the pull request from the `master` branch of your fork. Some of our integrations will fail if you do this, resulting in your pull request not being accepted. If this is your first pull request, it is probably a good idea to first read up on how opening pull requests work (https://opensource.com/article/19/7/create-pull-request-github is a good introduction);
2. Pull requests will only be accepted if they are opened against the `master` branch of our repository. Pull requests opened against other branches without prior consent from the maintainers will be closed;
3. Please follow the coding style guidelines: https://www.betaflight.com/docs/development/CodingStyle
4. Keep your pull requests as small and concise as possible. One pull request should only ever add / update one feature. If the change that you are proposing has a wider scope, consider splitting it over multiple pull requests. In particular, pull requests that combine changes to features and one or more new targets are not acceptable.
5. Ideally, a pull request should contain only one commit, with a descriptive message. If your changes use more than one commit, rebase / squash them into one commit before submitting a pull request. If you need to amend your pull request, make sure that the additional commit has a descriptive message, or - even better - use `git commit --amend` to amend your original commit.
6. All pull requests are reviewed. Be ready to receive constructive criticism, and to learn and improve your coding style. Also, be ready to clarify anything that isn't already sufficiently explained in the code and text of the pull request, and to defend your ideas.
7. If your pull request is for a new target or an update to an existing target, please be aware that all targets have to be submitted as Unified Target configurations if a Unified Target for the MCU type is available. Read and follow [these instructions](https://github.com/betaflight/betaflight/blob/master/docs/TargetMaintenance/CreatingAUnifiedTarget.md).
8. We use continuous integration (CI) with [Azure Pipelines](https://dev.azure.com/Betaflight/Betaflight%20Nightlies/_build) to build all targets and run the test suite for every pull request. Pull requests that fail any of the builds or fail tests will most likely not be reviewed before they are fixed to build successfully and pass the tests. In order to get a quick idea if there are things that need fixing **before** opening a pull request or pushing an update into an existing pull request, run `make pre-push` to run a representative subset of the CI build. _Note: This is not an exhaustive test (which will take hours to run on any desktop type system), so even if this passes the CI build might still fail._
9. If your pull request is a fix for one or more issues that are open in GitHub, add a comment to your pull request, and add the issue numbers of the issues that are fixed in the form `Fixes #<issue number>`. This will cause the issues to be closed when the pull request is merged;
10. If your pull request contains a change that can be tested by other users, please build a set of test firmware files for all Unified Targets and attach them to the pull request. The required firmware files can be built in zipped form ready for upload to GitHub with `make unified_zip`. When attaching test firmware files, you can point users to this video for instructions on how to install the test firmware: https://youtu.be/I1uN9CN30gw
11. Remove this Text :).
+24
View File
@@ -0,0 +1,24 @@
changelog:
exclude:
labels:
- "cleanup"
categories:
- title: Features
labels:
- "RN: MAJOR FEATURE"
- "RN: MINOR FEATURE"
- title: Improvements
labels:
- "RN: IMPROVEMENT"
- "RN: SAFETY IMPROVEMENT"
- "RN: REFACTORING"
- title: Fixes
labels:
- "RN: BUGFIX"
- title: Targets
labels:
- "RN: NEW TARGET"
- "RN: TARGET UPDATE"
- title: Known Issues
labels:
- BUG
+22
View File
@@ -0,0 +1,22 @@
name: Auto close bad PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
pull_request_target:
permissions:
pull-requests: write
issues: write
jobs:
close-pr:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v5
- name: autoclose
shell: bash
if: github.head_ref == 'master'
run: gh pr close ${{github.event.pull_request.number}} --comment "Auto-closing pull request because the source branch is named 'master'. Please create a feature branch instead. https://betaflight.com/docs/development#using-git-and-github"
+38
View File
@@ -0,0 +1,38 @@
name: Release
on:
release:
types: [published]
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
release_build: true
release:
name: Release
needs: ci
runs-on: ubuntu-latest
steps:
- name: Fetch build artifacts
uses: actions/download-artifact@v5
- name: List downloaded artifacts
run: ls -al
- name: Attach assets to release
run: |
set -x
ASSETS=()
for asset in ./*/*.hex ./*/*.uf2; do
if [ -f "$asset" ]; then
ASSETS+=("$asset")
echo "$asset"
fi
done
TAG_NAME="${GITHUB_REF##*/}"
gh release upload "${TAG_NAME}" "${ASSETS[@]}" -R "${GITHUB_REPOSITORY}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+157
View File
@@ -0,0 +1,157 @@
# Per-SDK CI Pipeline
#
# Reusable workflow that caches an SDK toolchain and builds all
# targets belonging to that SDK.
name: SDK Pipeline
on:
workflow_call:
inputs:
sdk:
description: 'SDK name (arm, pico_sdk, stm32h5, stm32n6, esp_idf, none)'
required: true
type: string
targets:
description: 'JSON array of build targets for this SDK'
required: true
type: string
tools-cache-key:
description: 'Base cache key for toolchain'
required: true
type: string
release_build:
description: 'Whether to build without commit hash in filenames'
default: false
required: false
type: boolean
jobs:
cache:
name: Cache (${{ inputs.sdk == 'none' && 'Generic' || inputs.sdk }})
runs-on: ubuntu-latest
steps:
- name: Checkout code
if: inputs.sdk != 'none'
uses: actions/checkout@v5
- name: Cache tools
if: inputs.sdk != 'none'
uses: actions/cache@v5
id: cache-tools
with:
path: tools
key: ${{ inputs.tools-cache-key }}-${{ inputs.sdk }}
- name: Restore ARM tools as base
if: inputs.sdk != 'none' && inputs.sdk != 'arm' && steps.cache-tools.outputs.cache-hit != 'true'
uses: actions/cache/restore@v5
with:
path: tools
key: ${{ inputs.tools-cache-key }}-arm
- name: Get SDK cache info
if: inputs.sdk != 'arm' && inputs.sdk != 'none'
id: sdk-info
run: |
SUBMODULE=$(make SDK=${{ inputs.sdk }} platform-sdk-cache-paths-print 2>/dev/null | head -1)
if [ "$SUBMODULE" != "tools" ]; then
echo "has-submodule=true" >> $GITHUB_OUTPUT
echo "paths<<EOF" >> $GITHUB_OUTPUT
make SDK=${{ inputs.sdk }} platform-sdk-cache-paths-print >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "key=${{ runner.os }}-sdk-${{ inputs.sdk }}-$(make SDK=${{ inputs.sdk }} platform-sdk-cache-key-print)" >> $GITHUB_OUTPUT
fi
- name: Cache platform SDK
if: steps.sdk-info.outputs.has-submodule == 'true'
uses: actions/cache@v5
id: cache-sdk
with:
path: ${{ steps.sdk-info.outputs.paths }}
key: ${{ steps.sdk-info.outputs.key }}
- name: Hydrate SDK
if: steps.sdk-info.outputs.has-submodule == 'true' && steps.cache-sdk.outputs.cache-hit != 'true'
run: make SDK=${{ inputs.sdk }} platform-sdk-hydrate
- name: Install tools
if: inputs.sdk != 'none' && steps.cache-tools.outputs.cache-hit != 'true'
run: make SDK=${{ inputs.sdk }} platform-tools-install
build:
name: Build (${{ matrix.target }})
needs: cache
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(inputs.targets) }}
steps:
- name: Checkout code
if: matrix.target != 'None'
uses: actions/checkout@v5
- name: Init config submodule
if: matrix.target != 'None'
run: git submodule update --init -- src/config
- name: Get SDK cache info
if: matrix.target != 'None' && inputs.sdk != 'arm' && inputs.sdk != 'none'
id: sdk-info
run: |
SUBMODULE=$(make SDK=${{ inputs.sdk }} platform-sdk-cache-paths-print 2>/dev/null | head -1)
if [ "$SUBMODULE" != "tools" ]; then
echo "has-submodule=true" >> $GITHUB_OUTPUT
echo "paths<<EOF" >> $GITHUB_OUTPUT
make SDK=${{ inputs.sdk }} platform-sdk-cache-paths-print >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "key=${{ runner.os }}-sdk-${{ inputs.sdk }}-$(make SDK=${{ inputs.sdk }} platform-sdk-cache-key-print)" >> $GITHUB_OUTPUT
fi
- name: Restore platform SDK from cache
if: matrix.target != 'None' && steps.sdk-info.outputs.has-submodule == 'true'
uses: actions/cache/restore@v5
id: cache-sdk
with:
path: ${{ steps.sdk-info.outputs.paths }}
key: ${{ steps.sdk-info.outputs.key }}
- name: Hydrate platform SDK (fallback)
if: matrix.target != 'None' && steps.sdk-info.outputs.has-submodule == 'true' && steps.cache-sdk.outputs.cache-hit != 'true'
run: make SDK=${{ inputs.sdk }} platform-sdk-hydrate
- name: Restore toolchain from cache
if: matrix.target != 'None' && inputs.sdk != 'none'
uses: actions/cache/restore@v5
id: cache-tools
with:
path: tools
key: ${{ inputs.tools-cache-key }}-${{ inputs.sdk }}
- name: Install tools (fallback)
if: matrix.target != 'None' && inputs.sdk != 'none' && steps.cache-tools.outputs.cache-hit != 'true'
run: make SDK=${{ inputs.sdk }} platform-tools-install
- name: Hydrate configuration
if: matrix.target != 'None'
run: make configs
- name: Build target (without revision)
if: matrix.target != 'None' && inputs.release_build == true
run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}
- name: Build target (with revision)
if: matrix.target != 'None' && inputs.release_build == false
run: make EXTRA_FLAGS=-Werror ${{ matrix.target }}_rev
- name: Publish build artifacts
if: matrix.target != 'None'
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.target }}
path: |
obj/*.hex
obj/*.uf2
obj/*_${{ matrix.target }}*
retention-days: 60
+102
View File
@@ -0,0 +1,102 @@
# Builds Betaflight Firmware.
#
name: CI
on:
workflow_call:
inputs:
release_build:
description: 'Specifies if it is a build that should include commit hash in hex file names or not'
default: false
required: false
type: boolean
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
sdk-config: ${{ steps.sdk-config.outputs.matrix }}
tools-cache-key: ${{ steps.tools-key.outputs.key }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Init config submodule
run: git submodule update --init -- src/config
- name: Compute tools cache key
id: tools-key
run: echo "key=${{ runner.os }}-tools-v2-${{ hashFiles('mk/tools.mk', 'src/platform/*/mk/*.mk') }}" >> $GITHUB_OUTPUT
- name: Hydrate configuration
run: make configs
- name: Build SDK pipeline config
id: sdk-config
run: |
# Get grouped targets (sdk:target1 target2 ...)
grouped=$(make targets-ci-grouped-print)
declare -A sdk_targets
while IFS=: read -r sdk targets; do
sdk_targets[$sdk]=$(echo "$targets" | jq -R -c 'split(" ")')
done <<< "$grouped"
# Get all registered SDKs + none
all_sdks="$(make platform-sdk-list-print) none"
# Build matrix include array
json="["
first=true
for sdk in $all_sdks; do
targets=${sdk_targets[$sdk]:-'["None"]'}
$first || json="$json,"
json="$json{\"sdk\":\"$sdk\",\"targets\":$(echo "$targets" | jq -R -c .)}"
first=false
done
json="$json]"
echo "matrix=$json" >> "$GITHUB_OUTPUT"
sdk-pipeline:
name: ${{ matrix.sdk }}
needs: setup
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.setup.outputs.sdk-config) }}
uses: ./.github/workflows/ci-sdk.yml
with:
sdk: ${{ matrix.sdk }}
targets: ${{ matrix.targets }}
tools-cache-key: ${{ needs.setup.outputs.tools-cache-key }}
release_build: ${{ inputs.release_build }}
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: sudo apt-get install -y libblocksruntime-dev clang-18
- name: Run sanity checks
run: make EXTRA_FLAGS=-Werror checks
- name: Run all unit tests
run: make EXTRA_FLAGS=-Werror test-all
result:
name: Complete
needs: [sdk-pipeline, test]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check SDK pipeline result
if: ${{ needs.sdk-pipeline.result != 'success' }}
run: exit 1
- name: Check test result
if: ${{ needs.test.result != 'success' }}
run: exit 1
+17
View File
@@ -0,0 +1,17 @@
name: No Response
on:
issue_comment:
types: [created]
schedule:
- cron: 0 4 * * *
jobs:
no-response:
runs-on: ubuntu-latest
steps:
- uses: lee-dohm/no-response@9bb0a4b5e6a45046f00353d5de7d90fb8bd773bb # v0.5.0
with:
daysUntilClose: 1
responseRequiredLabel: Missing Information
token: ${{ github.token }}
+24
View File
@@ -0,0 +1,24 @@
name: PR cloud build comment
on:
pull_request_target:
types: [opened]
branches:
- master
- '*-maintenance'
permissions:
pull-requests: write
jobs:
comment-pr:
runs-on: ubuntu-latest
steps:
- name: Add comment about cloud build
uses: thollander/actions-comment-pull-request@v2
with:
message: |
**Do you want to test this code? You can flash it directly from the Betaflight App:**
- Simply put `#${{ github.event.number }}` (this pull request number) in the `Select commit` field in the Firmware Flasher tab (you need to `Enable expert mode`, `Show release candidates` and `Development`).
_**WARNING:** It may be unstable. Use only for testing!_
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+12
View File
@@ -0,0 +1,12 @@
name: PR
on:
pull_request:
branches:
- master
- '*-maintenance'
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
+12
View File
@@ -0,0 +1,12 @@
name: Push
on:
push:
branches:
- master
- '*-maintenance'
jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
+31
View File
@@ -0,0 +1,31 @@
name: Stale Issues and PRs
on:
schedule:
- cron: 30 4 * * *
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
exempt-all-milestones: true
days-before-stale: 30
days-before-close: 7
stale-issue-message: >
This issue has been automatically marked as stale because it
has not had recent activity. It will be closed if no further activity occurs
within a week.
close-issue-message: Issue closed automatically as inactive.
stale-issue-label: Inactive
exempt-issue-labels: BUG,Feature Request,Pinned
stale-pr-message: >
This pull request has been automatically marked as stale because it
has not had recent activity. It will be closed if no further activity occurs
within a week.
close-pr-message: Pull request closed automatically as inactive.
stale-pr-label: Inactive
exempt-pr-labels: Pinned