mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-26 09:45:33 +03:00
Merge remote-tracking branch 'origin/master' into Add-target-MicoAir743AIO-and-MicoAir743v2
This commit is contained in:
commit
303a8113fd
19 changed files with 569 additions and 266 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
@ -13,6 +13,15 @@ on:
|
||||||
- 'CMakeLists.txt'
|
- 'CMakeLists.txt'
|
||||||
- '*.sh'
|
- '*.sh'
|
||||||
|
|
||||||
|
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:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -37,7 +46,7 @@ jobs:
|
||||||
# why we try github.event.pull_request.head.sha first
|
# why we try github.event.pull_request.head.sha first
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||||
|
@ -72,7 +81,7 @@ jobs:
|
||||||
# why we try github.event.pull_request.head.sha first
|
# why we try github.event.pull_request.head.sha first
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||||
|
@ -115,7 +124,7 @@ jobs:
|
||||||
# why we try github.event.pull_request.head.sha first
|
# why we try github.event.pull_request.head.sha first
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||||
|
@ -148,7 +157,7 @@ jobs:
|
||||||
# why we try github.event.pull_request.head.sha first
|
# why we try github.event.pull_request.head.sha first
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }')
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
||||||
|
@ -188,7 +197,7 @@ jobs:
|
||||||
# why we try github.event.pull_request.head.sha first
|
# why we try github.event.pull_request.head.sha first
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
||||||
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
BUILD_SUFFIX=ci-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
VERSION=$( grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }' )
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
245
.github/workflows/dev-builds.yml
vendored
245
.github/workflows/dev-builds.yml
vendored
|
@ -1,245 +0,0 @@
|
||||||
name: Build pre-release
|
|
||||||
# Don't enable CI on push, just on PR. If you
|
|
||||||
# are working on the main repo and want to trigger
|
|
||||||
# a CI build submit a draft PR.
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'src/**'
|
|
||||||
- '.github/**'
|
|
||||||
- 'cmake/**'
|
|
||||||
- 'lib/**'
|
|
||||||
- 'docs/Settings.md'
|
|
||||||
- 'CMakeLists.txt'
|
|
||||||
- '*.sh'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
id: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
|
||||||
- name: Setup environment
|
|
||||||
env:
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
run: |
|
|
||||||
# This is the hash of the commit for the PR
|
|
||||||
# when the action is triggered by PR, empty otherwise
|
|
||||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
|
||||||
# This is the hash of the commit when triggered by push
|
|
||||||
# but the hash of refs/pull/<n>/merge, which is different
|
|
||||||
# from the hash of the latest commit in the PR, that's
|
|
||||||
# why we try github.event.pull_request.head.sha first
|
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
|
||||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/^[ \t]+|[ \t\)]+$/, "", $2); print $2 }')
|
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: downloads
|
|
||||||
key: ${{ runner.os }}-downloads-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('**/cmake/*')}}
|
|
||||||
- name: Build targets (${{ matrix.id }})
|
|
||||||
run: mkdir -p build && cd build && cmake -DWARNINGS_AS_ERRORS=ON -DCI_JOB_INDEX=${{ matrix.id }} -DCI_JOB_COUNT=${{ strategy.job-total }} -DBUILD_SUFFIX=${{ env.BUILD_SUFFIX }} -DVERSION_TYPE=dev -G Ninja .. && ninja -j${{ env.NUM_CORES }} ci
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{ env.BUILD_NAME }}.${{ matrix.id }}
|
|
||||||
path: ./build/*.hex
|
|
||||||
|
|
||||||
build-SITL-Linux:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
|
||||||
- name: Setup environment
|
|
||||||
env:
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
run: |
|
|
||||||
# This is the hash of the commit for the PR
|
|
||||||
# when the action is triggered by PR, empty otherwise
|
|
||||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
|
||||||
# This is the hash of the commit when triggered by push
|
|
||||||
# but the hash of refs/pull/<n>/merge, which is different
|
|
||||||
# from the hash of the latest commit in the PR, that's
|
|
||||||
# why we try github.event.pull_request.head.sha first
|
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
|
||||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "NUM_CORES=$(grep processor /proc/cpuinfo | wc -l)" >> $GITHUB_ENV
|
|
||||||
- name: Build SITL
|
|
||||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja -DVERSION_TYPE=dev .. && ninja -j${{ env.NUM_CORES }}
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sitl-${{ env.BUILD_NAME }}-Linux
|
|
||||||
path: ./build_SITL/*_SITL
|
|
||||||
|
|
||||||
build-SITL-Mac:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
brew install cmake ninja ruby
|
|
||||||
|
|
||||||
- name: Setup environment
|
|
||||||
env:
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
run: |
|
|
||||||
# This is the hash of the commit for the PR
|
|
||||||
# when the action is triggered by PR, empty otherwise
|
|
||||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
|
||||||
# This is the hash of the commit when triggered by push
|
|
||||||
# but the hash of refs/pull/<n>/merge, which is different
|
|
||||||
# from the hash of the latest commit in the PR, that's
|
|
||||||
# why we try github.event.pull_request.head.sha first
|
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
|
||||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
|
||||||
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
- name: Build SITL
|
|
||||||
run: |
|
|
||||||
mkdir -p build_SITL && cd build_SITL
|
|
||||||
cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DVERSION_TYPE=dev -G Ninja ..
|
|
||||||
ninja -j4
|
|
||||||
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sitl-${{ env.BUILD_NAME }}-MacOS
|
|
||||||
path: ./build_SITL/*_SITL
|
|
||||||
|
|
||||||
build-SITL-Windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: C:\tools\cygwin\bin\bash.exe -o igncr '{0}'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Setup Cygwin
|
|
||||||
uses: egor-tensin/setup-cygwin@v4
|
|
||||||
with:
|
|
||||||
packages: cmake ruby ninja gcc-g++
|
|
||||||
- name: Setup environment
|
|
||||||
env:
|
|
||||||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
|
|
||||||
run: |
|
|
||||||
# This is the hash of the commit for the PR
|
|
||||||
# when the action is triggered by PR, empty otherwise
|
|
||||||
COMMIT_ID=${{ github.event.pull_request.head.sha }}
|
|
||||||
# This is the hash of the commit when triggered by push
|
|
||||||
# but the hash of refs/pull/<n>/merge, which is different
|
|
||||||
# from the hash of the latest commit in the PR, that's
|
|
||||||
# why we try github.event.pull_request.head.sha first
|
|
||||||
COMMIT_ID=${COMMIT_ID:-${{ github.sha }}}
|
|
||||||
BUILD_SUFFIX=dev-$(date '+%Y%m%d')-$(git rev-parse --short ${COMMIT_ID})
|
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
|
||||||
#echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
#echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
|
|
||||||
#echo "VERSION_TAG=-$(date '+%Y%m%d')" >> $GITHUB_ENV
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
- name: Build SITL
|
|
||||||
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -DVERSION_TYPE=dev -G Ninja .. && ninja -j4
|
|
||||||
- name: Upload artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: sitl-${{ env.BUILD_NAME }}-WIN
|
|
||||||
path: ./build_SITL/*.exe
|
|
||||||
|
|
||||||
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get update && sudo apt-get -y install ninja-build
|
|
||||||
- name: Run Tests
|
|
||||||
run: mkdir -p build && cd build && cmake -DTOOLCHAIN=none -G Ninja .. && ninja check
|
|
||||||
|
|
||||||
release:
|
|
||||||
needs: [build, build-SITL-Linux, build-SITL-Mac, build-SITL-Windows, test]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: Get version
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]+/, "", $2); print $2 }')
|
|
||||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
|
||||||
- name: Get current date
|
|
||||||
id: date
|
|
||||||
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
|
|
||||||
- name: download artifacts
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: hexes
|
|
||||||
pattern: inav-*
|
|
||||||
merge-multiple: true
|
|
||||||
- name: download sitl linux
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: resources/sitl/linux
|
|
||||||
pattern: sitl-*-Linux
|
|
||||||
merge-multiple: true
|
|
||||||
- name: download sitl windows
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: resources/sitl/windows
|
|
||||||
pattern: sitl-*-WIN
|
|
||||||
merge-multiple: true
|
|
||||||
- name: download sitl mac
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: resources/sitl/macos
|
|
||||||
pattern: sitl-*-MacOS
|
|
||||||
merge-multiple: true
|
|
||||||
- name: Consolidate sitl files
|
|
||||||
run: |
|
|
||||||
zip -r -9 sitl-resources.zip resources/
|
|
||||||
- name: Upload release artifacts
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
|
|
||||||
tag_name: v${{ steps.version.outputs.version }}-${{ steps.date.outputs.today }}.${{ github.run_number }}
|
|
||||||
# To create release on a different repo, we need a token setup
|
|
||||||
token: ${{ secrets.NIGHTLY_TOKEN }}
|
|
||||||
repository: iNavFlight/inav-nightly
|
|
||||||
prerelease: true
|
|
||||||
draft: false
|
|
||||||
#generate_release_notes: true
|
|
||||||
make_latest: false
|
|
||||||
files: |
|
|
||||||
hexes/*.hex
|
|
||||||
sitl-resources.zip
|
|
||||||
body: |
|
|
||||||
${{ steps.notes.outputs.notes }}
|
|
||||||
|
|
||||||
### Flashing
|
|
||||||
These are nightly builds and configuration settings can be added and removed often. Flashing with Full chip erase is strongly recommended to avoid issues.
|
|
||||||
Firmware related issues should be opened in the iNavflight/inav repository, not in inav-nightly.
|
|
||||||
|
|
||||||
### Repository:
|
|
||||||
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
|
|
||||||
|
|
||||||
### Branch:
|
|
||||||
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
|
|
||||||
|
|
||||||
### Latest changeset:
|
|
||||||
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
|
|
||||||
|
|
||||||
### Changes:
|
|
||||||
${{ github.event.head_commit.message }}
|
|
||||||
|
|
97
.github/workflows/nightly-build.yml
vendored
Normal file
97
.github/workflows/nightly-build.yml
vendored
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
name: Build pre-release
|
||||||
|
# Don't enable CI on push, just on PR. If you
|
||||||
|
# are working on the main repo and want to trigger
|
||||||
|
# a CI build submit a draft PR.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'src/**'
|
||||||
|
- '.github/**'
|
||||||
|
- 'cmake/**'
|
||||||
|
- 'lib/**'
|
||||||
|
- 'docs/Settings.md'
|
||||||
|
- 'CMakeLists.txt'
|
||||||
|
- '*.sh'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build
|
||||||
|
uses: ./.github/workflows/ci.yml
|
||||||
|
|
||||||
|
release:
|
||||||
|
name: Release
|
||||||
|
needs: [build]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Get version
|
||||||
|
id: version
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t\)]/, "", $2); print $2 }')
|
||||||
|
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
- name: Get current date
|
||||||
|
id: date
|
||||||
|
run: echo "today=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
|
||||||
|
- name: download artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: hexes
|
||||||
|
pattern: matrix-inav-*
|
||||||
|
merge-multiple: true
|
||||||
|
- name: download sitl linux
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: resources/sitl/linux
|
||||||
|
pattern: inav-*SITIL-Linux
|
||||||
|
merge-multiple: true
|
||||||
|
- name: download sitl windows
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: resources/sitl/windows
|
||||||
|
pattern: inav-*SITL-WIN
|
||||||
|
merge-multiple: true
|
||||||
|
- name: download sitl mac
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: resources/sitl/macos
|
||||||
|
pattern: inav-*SITL-MacOS
|
||||||
|
merge-multiple: true
|
||||||
|
- name: Consolidate sitl files
|
||||||
|
run: |
|
||||||
|
zip -r -9 sitl-resources.zip resources/
|
||||||
|
- name: Upload release artifacts
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
name: inav-${{ steps.version.outputs.version }}-dev-${{ steps.date.outputs.today }}-${{ github.run_number }}-${{ github.sha }}
|
||||||
|
tag_name: v${{ steps.version.outputs.version }}-${{ steps.date.outputs.today }}.${{ github.run_number }}
|
||||||
|
# To create release on a different repo, we need a token setup
|
||||||
|
token: ${{ secrets.NIGHTLY_TOKEN }}
|
||||||
|
repository: iNavFlight/inav-nightly
|
||||||
|
prerelease: true
|
||||||
|
draft: false
|
||||||
|
#generate_release_notes: true
|
||||||
|
make_latest: false
|
||||||
|
files: |
|
||||||
|
hexes/*.hex
|
||||||
|
sitl-resources.zip
|
||||||
|
body: |
|
||||||
|
${{ steps.notes.outputs.notes }}
|
||||||
|
|
||||||
|
### Flashing
|
||||||
|
These are nightly builds and configuration settings can be added and removed often. Flashing with Full chip erase is strongly recommended to avoid issues.
|
||||||
|
Firmware related issues should be opened in the iNavflight/inav repository, not in inav-nightly.
|
||||||
|
|
||||||
|
### Repository:
|
||||||
|
${{ github.repository }} ([link](${{ github.event.repository.html_url }}))
|
||||||
|
|
||||||
|
### Branch:
|
||||||
|
${{ github.ref_name }} ([link](${{ github.event.repository.html_url }}/tree/${{ github.ref_name }}))
|
||||||
|
|
||||||
|
### Latest changeset:
|
||||||
|
${{ github.event.head_commit.id }} ([link](${{ github.event.head_commit.url }}))
|
||||||
|
|
||||||
|
### Changes:
|
||||||
|
${{ github.event.head_commit.message }}
|
||||||
|
|
|
@ -3,13 +3,20 @@ if(DEFINED CI_JOB_INDEX AND DEFINED CI_JOB_COUNT)
|
||||||
message("-- configuring CI job ${job_name}/${CI_JOB_COUNT}")
|
message("-- configuring CI job ${job_name}/${CI_JOB_COUNT}")
|
||||||
get_property(targets GLOBAL PROPERTY RELEASE_TARGETS)
|
get_property(targets GLOBAL PROPERTY RELEASE_TARGETS)
|
||||||
list(LENGTH targets count)
|
list(LENGTH targets count)
|
||||||
|
message("-- ${count} total targets")
|
||||||
math(EXPR per_job "(${count}+${CI_JOB_COUNT}-1)/${CI_JOB_COUNT}")
|
math(EXPR per_job "(${count}+${CI_JOB_COUNT}-1)/${CI_JOB_COUNT}")
|
||||||
message("-- ${per_job} targets per job")
|
|
||||||
math(EXPR start "${CI_JOB_INDEX}*${per_job}")
|
math(EXPR start "${CI_JOB_INDEX}*${per_job}")
|
||||||
list(SUBLIST targets ${start} ${per_job} ci_targets)
|
message("-- ${per_job} targets per job, starting at ${start}")
|
||||||
message("-- will build targets: ${ci_targets}")
|
if(${start} LESS ${count})
|
||||||
add_custom_target(ci
|
list(SUBLIST targets ${start} ${per_job} ci_targets)
|
||||||
${CMAKE_COMMAND} -E true
|
message("-- will build targets: ${ci_targets}")
|
||||||
DEPENDS ${ci_targets}
|
add_custom_target(ci
|
||||||
)
|
${CMAKE_COMMAND} -E true
|
||||||
|
DEPENDS ${ci_targets}
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
add_custom_target(ci
|
||||||
|
${CMAKE_COMMAND} -E true
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -62,7 +62,7 @@ All other interfaces (I2C, SPI, etc.) are not emulated.
|
||||||
## Remote control
|
## Remote control
|
||||||
Multiple methods for connecting RC Controllers are available:
|
Multiple methods for connecting RC Controllers are available:
|
||||||
- MSP_RX (TCP/IP)
|
- MSP_RX (TCP/IP)
|
||||||
- joystick (via simulator)
|
- joystick / radio attached via USB (via simulator)
|
||||||
- serial receiver via USB to serial converter
|
- serial receiver via USB to serial converter
|
||||||
- any receiver with proxy flight controller
|
- any receiver with proxy flight controller
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ MSP_RX is the default, 18 channels are supported over TCP/IP connection.
|
||||||
Only 8 channels are supported.
|
Only 8 channels are supported.
|
||||||
|
|
||||||
Select "SIM (SITL)" as the receiver and set up a joystick in the simulator.
|
Select "SIM (SITL)" as the receiver and set up a joystick in the simulator.
|
||||||
|
Many RC transmittters (radios) can function as a joystick by plugging them in to the computer via USB, making this the simplest option in many cases.
|
||||||
|
|
||||||
*Not available with INAV-X-Plane-HITL plugin.*
|
*Not available with INAV-X-Plane-HITL plugin.*
|
||||||
|
|
||||||
|
|
|
@ -3018,7 +3018,7 @@ If enabled, motor will stop when throttle is low on this mixer_profile
|
||||||
|
|
||||||
| Default | Min | Max |
|
| Default | Min | Max |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| OFF | OFF | ON |
|
| ON | OFF | ON |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
|
|
||||||
#if defined(USE_BARO_BMP085)
|
#if defined(USE_BARO_BMP085)
|
||||||
|
|
||||||
|
#if !defined(BMP085_I2C_ADDR)
|
||||||
#define BMP085_I2C_ADDR 0x77
|
#define BMP085_I2C_ADDR 0x77
|
||||||
|
#endif
|
||||||
#define BMP085_CHIP_ID 0x55
|
#define BMP085_CHIP_ID 0x55
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -39,7 +39,9 @@
|
||||||
|
|
||||||
#if defined(USE_BARO) && (defined(USE_BARO_BMP388) || defined(USE_BARO_SPI_BMP388) || defined(USE_BARO_BMP390) || defined(USE_BARO_SPI_BMP390))
|
#if defined(USE_BARO) && (defined(USE_BARO_BMP388) || defined(USE_BARO_SPI_BMP388) || defined(USE_BARO_BMP390) || defined(USE_BARO_SPI_BMP390))
|
||||||
|
|
||||||
|
#if !defined(BMP388_I2C_ADDR)
|
||||||
#define BMP388_I2C_ADDR (0x76) // same as BMP280/BMP180
|
#define BMP388_I2C_ADDR (0x76) // same as BMP280/BMP180
|
||||||
|
#endif
|
||||||
#define BMP388_DEFAULT_CHIP_ID (0x50) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L130
|
#define BMP388_DEFAULT_CHIP_ID (0x50) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L130
|
||||||
#define BMP390_DEFAULT_CHIP_ID (0x60) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L133
|
#define BMP390_DEFAULT_CHIP_ID (0x60) // from https://github.com/BoschSensortec/BMP3-Sensor-API/blob/master/bmp3_defs.h#L133
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#if !defined(SPL06_I2C_ADDR)
|
||||||
#define SPL06_I2C_ADDR 0x76
|
#define SPL06_I2C_ADDR 0x76
|
||||||
|
#endif
|
||||||
#define SPL06_DEFAULT_CHIP_ID 0x10
|
#define SPL06_DEFAULT_CHIP_ID 0x10
|
||||||
|
|
||||||
#define SPL06_PRESSURE_START_REG 0x00
|
#define SPL06_PRESSURE_START_REG 0x00
|
||||||
|
|
|
@ -62,9 +62,9 @@ typedef struct gimbalConfig_s {
|
||||||
uint8_t tiltChannel;
|
uint8_t tiltChannel;
|
||||||
uint8_t rollChannel;
|
uint8_t rollChannel;
|
||||||
int8_t sensitivity;
|
int8_t sensitivity;
|
||||||
uint16_t panTrim;
|
int16_t panTrim;
|
||||||
uint16_t tiltTrim;
|
int16_t tiltTrim;
|
||||||
uint16_t rollTrim;
|
int16_t rollTrim;
|
||||||
} gimbalConfig_t;
|
} gimbalConfig_t;
|
||||||
|
|
||||||
PG_DECLARE(gimbalConfig_t, gimbalConfig);
|
PG_DECLARE(gimbalConfig_t, gimbalConfig);
|
||||||
|
|
|
@ -162,9 +162,9 @@
|
||||||
|
|
||||||
#define SYM_MAX 0xCE // 206 MAX symbol
|
#define SYM_MAX 0xCE // 206 MAX symbol
|
||||||
#define SYM_PROFILE 0xCF // 207 Profile symbol
|
#define SYM_PROFILE 0xCF // 207 Profile symbol
|
||||||
#define SYM_SWITCH_INDICATOR_LOW 0xD0 // 208 Switch High
|
#define SYM_SWITCH_INDICATOR_LOW 0xD0 // 208 Switch Indicator Down/Low - Note: Some systems have HIGH us values for a switch in the down position
|
||||||
#define SYM_SWITCH_INDICATOR_MID 0xD1 // 209 Switch Mid
|
#define SYM_SWITCH_INDICATOR_MID 0xD1 // 209 Switch Indicator Mid
|
||||||
#define SYM_SWITCH_INDICATOR_HIGH 0xD2 // 210 Switch Low
|
#define SYM_SWITCH_INDICATOR_HIGH 0xD2 // 210 Switch Indicator Up/High - Note: Some systems have LOW us values for a switch in the up position
|
||||||
#define SYM_AH 0xD3 // 211 Amphours symbol
|
#define SYM_AH 0xD3 // 211 Amphours symbol
|
||||||
#define SYM_GLIDE_DIST 0xD4 // 212 Glide Distance
|
#define SYM_GLIDE_DIST 0xD4 // 212 Glide Distance
|
||||||
#define SYM_GLIDE_MINS 0xD5 // 213 Glide Minutes
|
#define SYM_GLIDE_MINS 0xD5 // 213 Glide Minutes
|
||||||
|
|
|
@ -1231,7 +1231,7 @@ groups:
|
||||||
max: INT16_MAX
|
max: INT16_MAX
|
||||||
- name: motorstop_on_low
|
- name: motorstop_on_low
|
||||||
description: "If enabled, motor will stop when throttle is low on this mixer_profile"
|
description: "If enabled, motor will stop when throttle is low on this mixer_profile"
|
||||||
default_value: OFF
|
default_value: ON
|
||||||
field: mixer_config.motorstopOnLow
|
field: mixer_config.motorstopOnLow
|
||||||
type: bool
|
type: bool
|
||||||
- name: mixer_pid_profile_linking
|
- name: mixer_pid_profile_linking
|
||||||
|
|
1
src/main/target/HGLRCF405V2/CMakeLists.txt
Normal file
1
src/main/target/HGLRCF405V2/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
target_stm32f405xg(HGLRCF405V2)
|
39
src/main/target/HGLRCF405V2/target.c
Normal file
39
src/main/target/HGLRCF405V2/target.c
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* This file is part of INAV.
|
||||||
|
*
|
||||||
|
* INAV is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* INAV is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <platform.h>
|
||||||
|
|
||||||
|
#include "drivers/io.h"
|
||||||
|
#include "drivers/timer.h"
|
||||||
|
|
||||||
|
timerHardware_t timerHardware[] = {
|
||||||
|
DEF_TIM(TIM5, CH4, PA3, TIM_USE_PPM , 0, 1), // PPM IN
|
||||||
|
|
||||||
|
DEF_TIM(TIM8, CH1, PC6, TIM_USE_OUTPUT_AUTO, 0, 1), // S1
|
||||||
|
DEF_TIM(TIM8, CH2, PC7, TIM_USE_OUTPUT_AUTO, 0, 1), // S2
|
||||||
|
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 1), // S3
|
||||||
|
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // S4
|
||||||
|
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // S5
|
||||||
|
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 1), // S6
|
||||||
|
DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 0, 0), // S7
|
||||||
|
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 0), // S8
|
||||||
|
|
||||||
|
DEF_TIM(TIM3, CH4, PB1, TIM_USE_LED, 0, 0), // LED_STRIP
|
||||||
|
};
|
||||||
|
|
||||||
|
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
|
157
src/main/target/HGLRCF405V2/target.h
Normal file
157
src/main/target/HGLRCF405V2/target.h
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
/*
|
||||||
|
* This file is part of INAV.
|
||||||
|
*
|
||||||
|
* INAV is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* INAV is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define TARGET_BOARD_IDENTIFIER "HGF4V2"
|
||||||
|
#define USBD_PRODUCT_STRING "HGLRCF405V2"
|
||||||
|
|
||||||
|
#define USE_TARGET_CONFIG
|
||||||
|
|
||||||
|
/*** Indicators ***/
|
||||||
|
#define LED0 PC13
|
||||||
|
#define BEEPER PB8
|
||||||
|
#define BEEPER_INVERTED
|
||||||
|
|
||||||
|
/*** SPI/I2C bus ***/
|
||||||
|
#define USE_SPI
|
||||||
|
#define USE_SPI_DEVICE_1
|
||||||
|
#define SPI1_NSS_PIN PA4
|
||||||
|
#define SPI1_SCK_PIN PA5
|
||||||
|
#define SPI1_MISO_PIN PA6
|
||||||
|
#define SPI1_MOSI_PIN PA7
|
||||||
|
|
||||||
|
#define USE_SPI_DEVICE_2
|
||||||
|
#define SPI2_NSS_PIN PA13
|
||||||
|
#define SPI2_SCK_PIN PB13
|
||||||
|
#define SPI2_MISO_PIN PB14
|
||||||
|
#define SPI2_MOSI_PIN PB15
|
||||||
|
|
||||||
|
#define USE_SPI_DEVICE_3
|
||||||
|
#define SPI3_NSS_PIN PC0
|
||||||
|
#define SPI3_SCK_PIN PB3
|
||||||
|
#define SPI3_MISO_PIN PB4
|
||||||
|
#define SPI3_MOSI_PIN PB5
|
||||||
|
|
||||||
|
#define USE_I2C
|
||||||
|
#define USE_I2C_DEVICE_1
|
||||||
|
#define I2C1_SCL PB6
|
||||||
|
#define I2C1_SDA PB7
|
||||||
|
|
||||||
|
|
||||||
|
/*** IMU sensors ***/
|
||||||
|
|
||||||
|
// MPU6000
|
||||||
|
#define USE_IMU_MPU6000
|
||||||
|
#define IMU_MPU6000_ALIGN CW270_DEG
|
||||||
|
#define MPU6000_SPI_BUS BUS_SPI1
|
||||||
|
#define MPU6000_CS_PIN SPI1_NSS_PIN
|
||||||
|
|
||||||
|
// ICM42605/ICM42688P
|
||||||
|
#define USE_IMU_ICM42605
|
||||||
|
#define IMU_ICM42605_ALIGN CW270_DEG
|
||||||
|
#define ICM42605_SPI_BUS BUS_SPI1
|
||||||
|
#define ICM42605_CS_PIN SPI1_NSS_PIN
|
||||||
|
|
||||||
|
/*** OSD ***/
|
||||||
|
#define USE_MAX7456
|
||||||
|
#define MAX7456_SPI_BUS BUS_SPI2
|
||||||
|
#define MAX7456_CS_PIN SPI2_NSS_PIN
|
||||||
|
|
||||||
|
/*** Onboard flash ***/
|
||||||
|
#define USE_FLASHFS
|
||||||
|
#define USE_FLASH_M25P16
|
||||||
|
#define M25P16_CS_PIN SPI3_NSS_PIN
|
||||||
|
#define M25P16_SPI_BUS BUS_SPI3
|
||||||
|
|
||||||
|
|
||||||
|
/*** Serial ports ***/
|
||||||
|
#define USE_VCP
|
||||||
|
// #define USE_UART_INVERTER
|
||||||
|
|
||||||
|
#define USE_UART1
|
||||||
|
#define UART1_TX_PIN PA9
|
||||||
|
#define UART1_RX_PIN PA10
|
||||||
|
|
||||||
|
#define USE_UART2
|
||||||
|
#define UART2_TX_PIN PA2
|
||||||
|
#define UART2_RX_PIN PA3
|
||||||
|
|
||||||
|
#define USE_UART3
|
||||||
|
#define UART3_TX_PIN PC10
|
||||||
|
#define UART3_RX_PIN PC11
|
||||||
|
|
||||||
|
#define USE_UART4
|
||||||
|
#define UART4_TX_PIN PA0
|
||||||
|
#define UART4_RX_PIN PA1
|
||||||
|
|
||||||
|
#define USE_UART5
|
||||||
|
#define UART5_TX_PIN PC12
|
||||||
|
#define UART5_RX_PIN PD2
|
||||||
|
|
||||||
|
|
||||||
|
#define SERIAL_PORT_COUNT 6
|
||||||
|
|
||||||
|
/*** BARO & MAG ***/
|
||||||
|
#define USE_BARO
|
||||||
|
#define BARO_I2C_BUS BUS_I2C1
|
||||||
|
#define USE_BARO_BMP280
|
||||||
|
#define USE_BARO_SPL06
|
||||||
|
#define USE_BARO_DPS310
|
||||||
|
|
||||||
|
#define USE_MAG
|
||||||
|
#define MAG_I2C_BUS BUS_I2C1
|
||||||
|
#define USE_MAG_ALL
|
||||||
|
|
||||||
|
/*** ADC ***/
|
||||||
|
#define USE_ADC
|
||||||
|
#define ADC_CHANNEL_1_PIN PC2
|
||||||
|
#define ADC_CHANNEL_2_PIN PC1
|
||||||
|
#define ADC_CHANNEL_3_PIN PC3
|
||||||
|
|
||||||
|
#define VBAT_ADC_CHANNEL ADC_CHN_1 //PC2
|
||||||
|
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2 //PC1
|
||||||
|
#define RSSI_ADC_CHANNEL ADC_CHN_3 //PC3
|
||||||
|
|
||||||
|
#define VBAT_SCALE_DEFAULT 1100
|
||||||
|
#define CURRENT_METER_SCALE 206
|
||||||
|
|
||||||
|
/*** LED STRIP ***/
|
||||||
|
#define USE_LED_STRIP
|
||||||
|
#define WS2811_PIN PB1
|
||||||
|
|
||||||
|
/*** Default settings ***/
|
||||||
|
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
|
||||||
|
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_SBUS
|
||||||
|
#define SERIALRX_UART SERIAL_PORT_USART2
|
||||||
|
|
||||||
|
|
||||||
|
#define DEFAULT_FEATURES (FEATURE_TX_PROF_SEL | FEATURE_OSD | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TELEMETRY | FEATURE_SOFTSERIAL )
|
||||||
|
|
||||||
|
/*** Timer/PWM output ***/
|
||||||
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
#define MAX_PWM_OUTPUT_PORTS 8
|
||||||
|
#define USE_DSHOT
|
||||||
|
#define USE_ESC_SENSOR
|
||||||
|
|
||||||
|
|
||||||
|
/*** Used pins ***/
|
||||||
|
#define TARGET_IO_PORTA 0xffff
|
||||||
|
#define TARGET_IO_PORTB 0xffff
|
||||||
|
#define TARGET_IO_PORTC 0xffff
|
||||||
|
#define TARGET_IO_PORTD (BIT(2))
|
1
src/main/target/SKYSTARSF405WING/CMakeLists.txt
Normal file
1
src/main/target/SKYSTARSF405WING/CMakeLists.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
target_stm32f405xg(SKYSTARSF405WING)
|
29
src/main/target/SKYSTARSF405WING/config.c
Normal file
29
src/main/target/SKYSTARSF405WING/config.c
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
/*
|
||||||
|
* This file is part of INAV.
|
||||||
|
*
|
||||||
|
* INAV is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* INAV is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include "platform.h"
|
||||||
|
#include "fc/fc_msp_box.h"
|
||||||
|
#include "fc/config.h"
|
||||||
|
#include "io/piniobox.h"
|
||||||
|
|
||||||
|
void targetConfiguration(void)
|
||||||
|
{
|
||||||
|
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
|
||||||
|
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
|
||||||
|
beeperConfigMutable()->pwmMode = true;
|
||||||
|
}
|
48
src/main/target/SKYSTARSF405WING/target.c
Normal file
48
src/main/target/SKYSTARSF405WING/target.c
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* This file is part of INAV.
|
||||||
|
*
|
||||||
|
* INAV is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* INAV is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <platform.h>
|
||||||
|
#include "drivers/bus.h"
|
||||||
|
#include "drivers/io.h"
|
||||||
|
#include "drivers/pwm_mapping.h"
|
||||||
|
#include "drivers/timer.h"
|
||||||
|
#include "drivers/sensor.h"
|
||||||
|
#include "drivers/timer_def_stm32f4xx.h"
|
||||||
|
|
||||||
|
timerHardware_t timerHardware[] = {
|
||||||
|
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 1), // S1 D(2,1,6) UP256
|
||||||
|
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0), // S2 D(2,7,7) UP217
|
||||||
|
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 0), // S3 D(2,2,0) UP217
|
||||||
|
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_OUTPUT_AUTO, 0, 0), // S4 D(2,6,0) UP256
|
||||||
|
|
||||||
|
DEF_TIM(TIM1, CH3N, PB15, TIM_USE_OUTPUT_AUTO, 0, 0), // S5 D(2,6,0) UP256
|
||||||
|
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 0), // S6 D(1,7,3) UP173
|
||||||
|
DEF_TIM(TIM2, CH2, PB3, TIM_USE_OUTPUT_AUTO, 0, 0), // S7 D(1,6,3) UP173
|
||||||
|
DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0), // S8 D(1,5,3) UP173
|
||||||
|
|
||||||
|
DEF_TIM(TIM12, CH1, PB14, TIM_USE_OUTPUT_AUTO, 0, 0), // S9 DMA NONE
|
||||||
|
DEF_TIM(TIM13, CH1, PA6, TIM_USE_OUTPUT_AUTO, 0, 0), // S10 DMA NONE
|
||||||
|
DEF_TIM(TIM4, CH1, PB6, TIM_USE_OUTPUT_AUTO, 0, 0), // S11 D(1,0,2)
|
||||||
|
|
||||||
|
DEF_TIM(TIM3, CH4, PB1, TIM_USE_LED, 0, 0), // 2812LED D(1,2,5)
|
||||||
|
DEF_TIM(TIM11, CH1, PB9, TIM_USE_BEEPER, 0, 0), // BEEPER PWM
|
||||||
|
|
||||||
|
DEF_TIM(TIM5, CH3, PA2, TIM_USE_ANY, 0, 0), //TX2 softserial1_Tx
|
||||||
|
};
|
||||||
|
|
||||||
|
const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
|
153
src/main/target/SKYSTARSF405WING/target.h
Normal file
153
src/main/target/SKYSTARSF405WING/target.h
Normal file
|
@ -0,0 +1,153 @@
|
||||||
|
/*
|
||||||
|
* This file is part of INAV.
|
||||||
|
*
|
||||||
|
* INAV is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* INAV is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with INAV. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#define USE_TARGET_CONFIG
|
||||||
|
|
||||||
|
|
||||||
|
#define TARGET_BOARD_IDENTIFIER "SK4W"
|
||||||
|
#define USBD_PRODUCT_STRING "SKYSTARSF405WING"
|
||||||
|
|
||||||
|
#define LED0 PC0
|
||||||
|
#define LED1 PC1
|
||||||
|
|
||||||
|
#define BEEPER PB9
|
||||||
|
#define BEEPER_INVERTED
|
||||||
|
#define BEEPER_PWM_FREQUENCY 2500
|
||||||
|
|
||||||
|
// *************** SPI1 IMU & OSD *******************
|
||||||
|
#define USE_SPI
|
||||||
|
#define USE_SPI_DEVICE_1
|
||||||
|
|
||||||
|
#define SPI1_SCK_PIN PA5
|
||||||
|
#define SPI1_MISO_PIN PB4
|
||||||
|
#define SPI1_MOSI_PIN PA7
|
||||||
|
|
||||||
|
#define USE_IMU_ICM42605
|
||||||
|
#define IMU_ICM42605_ALIGN CW180_DEG
|
||||||
|
#define ICM42605_SPI_BUS BUS_SPI1
|
||||||
|
#define ICM42605_CS_PIN PC14
|
||||||
|
|
||||||
|
#define USE_MAX7456
|
||||||
|
#define MAX7456_SPI_BUS BUS_SPI1
|
||||||
|
#define MAX7456_CS_PIN PB12
|
||||||
|
|
||||||
|
// *************** SPI2 Flash/SD Card ****************
|
||||||
|
#define USE_SPI_DEVICE_2
|
||||||
|
#define SPI2_SCK_PIN PB13
|
||||||
|
#define SPI2_MISO_PIN PC2
|
||||||
|
#define SPI2_MOSI_PIN PC3
|
||||||
|
|
||||||
|
#define USE_FLASHFS
|
||||||
|
#define USE_FLASH_M25P16
|
||||||
|
#define M25P16_SPI_BUS BUS_SPI2
|
||||||
|
#define M25P16_CS_PIN PC13
|
||||||
|
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
|
||||||
|
|
||||||
|
// *************** I2C /Baro/Mag *********************
|
||||||
|
#define USE_I2C
|
||||||
|
#define USE_I2C_DEVICE_1
|
||||||
|
#define I2C1_SCL PB8
|
||||||
|
#define I2C1_SDA PB7
|
||||||
|
|
||||||
|
#define USE_BARO
|
||||||
|
#define BARO_I2C_BUS BUS_I2C1
|
||||||
|
#define USE_BARO_SPL06
|
||||||
|
|
||||||
|
#define USE_MAG
|
||||||
|
#define MAG_I2C_BUS BUS_I2C1
|
||||||
|
#define USE_MAG_ALL
|
||||||
|
|
||||||
|
#define USE_RANGEFINDER
|
||||||
|
#define RANGEFINDER_I2C_BUS BUS_I2C1
|
||||||
|
#define PITOT_I2C_BUS BUS_I2C1
|
||||||
|
#define TEMPERATURE_I2C_BUS BUS_I2C1
|
||||||
|
|
||||||
|
// *************** UART *****************************
|
||||||
|
#define USE_VCP
|
||||||
|
|
||||||
|
#define USE_UART1
|
||||||
|
#define UART1_TX_PIN PA9
|
||||||
|
#define UART1_RX_PIN PA10
|
||||||
|
|
||||||
|
#define USE_UART2
|
||||||
|
#define UART2_TX_PIN PA2
|
||||||
|
#define UART2_RX_PIN PA3
|
||||||
|
|
||||||
|
#define USE_UART3
|
||||||
|
#define UART3_TX_PIN PC10
|
||||||
|
#define UART3_RX_PIN PC11
|
||||||
|
|
||||||
|
#define USE_UART4
|
||||||
|
#define UART4_TX_PIN PA0
|
||||||
|
#define UART4_RX_PIN PA1
|
||||||
|
|
||||||
|
#define USE_UART5
|
||||||
|
#define UART5_TX_PIN PC12
|
||||||
|
#define UART5_RX_PIN PD2
|
||||||
|
|
||||||
|
#define USE_UART6
|
||||||
|
#define UART6_TX_PIN PC6
|
||||||
|
#define UART6_RX_PIN PC7
|
||||||
|
|
||||||
|
#define USE_SOFTSERIAL1
|
||||||
|
#define SOFTSERIAL_1_TX_PIN PA2
|
||||||
|
#define SOFTSERIAL_1_RX_PIN PA2
|
||||||
|
|
||||||
|
#define SERIAL_PORT_COUNT 8
|
||||||
|
|
||||||
|
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
|
||||||
|
#define SERIALRX_PROVIDER SERIALRX_CRSF
|
||||||
|
#define SERIALRX_UART SERIAL_PORT_USART2
|
||||||
|
|
||||||
|
// *************** ADC ***************************
|
||||||
|
#define USE_ADC
|
||||||
|
#define ADC_INSTANCE ADC1
|
||||||
|
#define ADC1_DMA_STREAM DMA2_Stream4
|
||||||
|
#define ADC_CHANNEL_1_PIN PC4
|
||||||
|
#define ADC_CHANNEL_2_PIN PC5
|
||||||
|
#define ADC_CHANNEL_3_PIN PB0
|
||||||
|
#define VBAT_ADC_CHANNEL ADC_CHN_1
|
||||||
|
#define CURRENT_METER_ADC_CHANNEL ADC_CHN_2
|
||||||
|
#define RSSI_ADC_CHANNEL ADC_CHN_3
|
||||||
|
|
||||||
|
// *************** PINIO ***************************
|
||||||
|
#define USE_PINIO
|
||||||
|
#define USE_PINIOBOX
|
||||||
|
#define PINIO1_PIN PA4
|
||||||
|
#define PINIO2_PIN PB5
|
||||||
|
|
||||||
|
// *************** LEDSTRIP ************************
|
||||||
|
#define USE_LED_STRIP
|
||||||
|
#define WS2811_PIN PB1
|
||||||
|
|
||||||
|
// *************** others ************************
|
||||||
|
#define DEFAULT_FEATURES (FEATURE_OSD | FEATURE_TELEMETRY | FEATURE_CURRENT_METER | FEATURE_VBAT | FEATURE_TX_PROF_SEL | FEATURE_BLACKBOX)
|
||||||
|
#define VBAT_SCALE_DEFAULT 1100
|
||||||
|
#define CURRENT_METER_SCALE 150
|
||||||
|
|
||||||
|
#define TARGET_IO_PORTA 0xffff
|
||||||
|
#define TARGET_IO_PORTB 0xffff
|
||||||
|
#define TARGET_IO_PORTC 0xffff
|
||||||
|
#define TARGET_IO_PORTD (BIT(2))
|
||||||
|
|
||||||
|
#define MAX_PWM_OUTPUT_PORTS 11
|
||||||
|
|
||||||
|
#define USE_SERIAL_4WAY_BLHELI_INTERFACE
|
||||||
|
#define USE_DSHOT
|
||||||
|
#define USE_DSHOT_DMAR
|
||||||
|
#define USE_ESC_SENSOR
|
Loading…
Add table
Add a link
Reference in a new issue