Skip to content

Commit 904e16d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into custom_24
2 parents 0d2e950 + 68546a2 commit 904e16d

521 files changed

Lines changed: 67870 additions & 5046 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build firmware
22
# Don't enable CI on push, just on PR. If you
33
# are working on the main repo and want to trigger
44
# a CI build submit a draft PR.
5-
on:
5+
on:
66
push:
77
branches:
88
- '!maintenance-8.x.x'
@@ -186,7 +186,7 @@ jobs:
186186
- uses: actions/checkout@v4
187187
- name: Install dependencies
188188
run: |
189-
brew install cmake ninja ruby
189+
brew install ruby
190190
191191
- name: Setup environment
192192
env:
@@ -231,7 +231,7 @@ jobs:
231231
- name: Setup Cygwin
232232
uses: egor-tensin/setup-cygwin@v4
233233
with:
234-
packages: cmake ruby ninja gcc-g++
234+
packages: cmake ruby ninja gcc-g++ rubygems
235235
- name: Setup environment
236236
env:
237237
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
@@ -248,9 +248,9 @@ jobs:
248248
VERSION=$( grep project CMakeLists.txt|awk -F VERSION '{ gsub(/[ \t)]/, "", $2); print $2 }' )
249249
echo "BUILD_SUFFIX=${BUILD_SUFFIX}" >> $GITHUB_ENV
250250
echo "BUILD_NAME=inav-${VERSION}-${BUILD_SUFFIX}" >> $GITHUB_ENV
251-
251+
252252
- name: Build SITL
253-
run: mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j4
253+
run: gem install getoptlong && mkdir -p build_SITL && cd build_SITL && cmake -DSITL=ON -DWARNINGS_AS_ERRORS=ON -G Ninja .. && ninja -j4
254254
- name: Strip version number
255255
run: |
256256
for f in ./build_SITL/*_SITL.exe; do
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: PR Branch Suggestion
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- master
8+
9+
jobs:
10+
suggest-branch:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
pull-requests: write
14+
steps:
15+
- name: Suggest maintenance branch
16+
uses: actions/github-script@v7
17+
with:
18+
script: |
19+
const comment = `### Branch Targeting Suggestion
20+
21+
You've targeted the \`master\` branch with this PR. Please consider if a version branch might be more appropriate:
22+
23+
- **\`maintenance-9.x\`** - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.
24+
25+
- **\`maintenance-10.x\`** - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x
26+
27+
If \`master\` is the correct target for this change, no action is needed.
28+
29+
---
30+
*This is an automated suggestion to help route contributions to the appropriate branch.*`;
31+
32+
try {
33+
await github.rest.issues.createComment({
34+
issue_number: context.issue.number,
35+
owner: context.repo.owner,
36+
repo: context.repo.repo,
37+
body: comment
38+
});
39+
} catch (err) {
40+
core.setFailed(`Failed to post suggestion comment: ${err}`);
41+
}

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"rth_trackback.h": "c",
88
"platform.h": "c",
99
"timer.h": "c",
10-
"bus.h": "c"
10+
"bus.h": "c",
11+
"io.h": "c",
12+
"fc_core.h": "c"
1113
},
1214
"editor.tabSize": 4,
1315
"editor.insertSpaces": true,

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,22 @@ FROM ubuntu:jammy
22

33
ARG USER_ID
44
ARG GROUP_ID
5-
ENV DEBIAN_FRONTEND noninteractive
5+
ARG GDB
66

7-
RUN apt-get update && apt-get install -y git cmake make ruby gcc python3 python3-pip gcc-arm-none-eabi ninja-build
7+
ENV DEBIAN_FRONTEND=noninteractive
88

9-
RUN if [ "$GDB" = "yes" ]; then apt-get install -y gdb; fi
9+
RUN apt-get update && apt-get install -y git cmake make ruby gcc python3 python3-yaml ninja-build gcc-arm-none-eabi
1010

11-
RUN pip install pyyaml
11+
RUN if [ "$GDB" = "yes" ]; then apt-get install -y gdb; fi
1212

13-
# if either of these are already set the same as the user's machine, leave them be and ignore the error
14-
RUN addgroup --gid $GROUP_ID inav; exit 0;
15-
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID inav; exit 0;
13+
# If a group and user with the same IDs already exist, rename the group and recreate the user after deleting the existing one.
14+
RUN GROUP="$(id -n -g $GROUP_ID)"; if [ -n "$GROUP" ]; then groupmod -n inav "$GROUP"; else groupadd --gid $GROUP_ID inav; fi
15+
RUN USER="$(id -n -u $USER_ID)"; if [ -n "$USER" ]; then userdel -r "$USER"; fi && useradd -m --uid $USER_ID --gid $GROUP_ID inav
1616

1717
USER inav
1818

1919
RUN git config --global --add safe.directory /src
2020

21-
VOLUME /src
22-
2321
WORKDIR /src/build
22+
2423
ENTRYPOINT ["/src/cmake/docker.sh"]

build.sh

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
set -e
2+
set -euo pipefail
33

44
if [[ $# == 0 ]]; then
55
echo -e "\
@@ -8,6 +8,10 @@ Usage syntax: ./build.sh <TARGET>
88
Notes:
99
* You can specify multiple targets.
1010
./build.sh <TARGET_1> <TARGET_2> <TARGET_N>
11+
* To get a list of release targets use \"release_targets\"
12+
./build.sh release_targets
13+
* To get a list of valid targets use \"valid_targets\"
14+
./build.sh valid_targets
1115
* To get a list of all targets use \"help\". Hint: pipe the output through a pager.
1216
./build.sh help | less
1317
* To build all targets use \"all\"
@@ -19,10 +23,20 @@ Notes:
1923
exit 1
2024
fi
2125

26+
run_docker() {
27+
docker run --rm -it -v "$(pwd)":/src inav-build "$@"
28+
}
29+
2230
if [ -z "$(docker images -q inav-build)" ]; then
23-
echo -e "*** Building image\n"
24-
docker build -t inav-build --build-arg USER_ID="$(id -u)" --build-arg GROUP_ID="$(id -g)" .
25-
echo -ne "\n"
31+
echo "*** Building Docker image"
32+
docker build -t inav-build \
33+
--build-arg USER_ID="$(id -u)" \
34+
--build-arg GROUP_ID="$(id -g)" .
35+
else
36+
docker build -q -t inav-build \
37+
--build-arg USER_ID="$(id -u)" \
38+
--build-arg GROUP_ID="$(id -g)" . >/dev/null ||
39+
{ echo "*** Building Docker image: ERROR"; exit 1; }
2640
fi
2741

2842
if [ ! -d ./build ]; then
@@ -40,10 +54,20 @@ if [ ! -d ./tools ]; then
4054
mkdir ./tools && chmod 777 ./tools
4155
fi
4256

43-
echo -e "*** Building targets [$@]\n"
44-
docker run --rm -it -v "$(pwd)":/src inav-build $@
57+
case "$1" in
58+
release_targets)
59+
run_docker targets | sed -n 's/^Release targets: \(.*\)/\1/p'|tr ' ' '\n'
60+
;;
61+
valid_targets)
62+
run_docker targets | sed -n 's/^Valid targets: \(.*\)/\1/p'|tr ' ' '\n'
63+
;;
64+
*)
65+
echo -e "*** Building targets [$@]\n"
66+
run_docker "$@"
67+
if ls ./build/*.hex &> /dev/null; then
68+
echo -e "\n*** Built targets in ./build:"
69+
stat -c "%n (%.19y)" ./build/*.hex
70+
fi
71+
;;
72+
esac
4573

46-
if [ -z "$(ls ./build/*.hex &> /dev/null)" ]; then
47-
echo -e "\n*** Built targets in ./build:"
48-
stat -c "%n (%.19y)" ./build/*.hex
49-
fi

cmake/arm-none-eabi-checks.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,23 @@ function(arm_none_eabi_gcc_check)
125125
if(NOT version)
126126
message("-- could not find ${prog}")
127127
arm_none_eabi_gcc_install()
128+
gcc_get_version(version
129+
TRIPLET ${arm_none_eabi_triplet}
130+
PROGRAM_NAME prog
131+
PROGRAM_PATH prog_path
132+
)
128133
return()
129134
endif()
130135
message("-- found ${prog} ${version} at ${prog_path}")
131136
if(COMPILER_VERSION_CHECK AND NOT arm_none_eabi_gcc_version STREQUAL version)
132137
message("-- expecting ${prog} version ${arm_none_eabi_gcc_version}, but got version ${version} instead")
133138
arm_none_eabi_gcc_install()
139+
unset(gcc CACHE)
140+
gcc_get_version(version
141+
TRIPLET ${arm_none_eabi_triplet}
142+
PROGRAM_NAME prog
143+
PROGRAM_PATH prog_path
144+
)
134145
return()
135146
endif()
136147
endfunction()

cmake/at32-bootloader.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ main_sources(BOOTLOADER_SOURCES
2121
drivers/time.c
2222
drivers/timer.c
2323
drivers/flash_m25p16.c
24-
drivers/flash_w25n01g.c
24+
drivers/flash_w25n.c
2525
drivers/flash.c
2626

2727
fc/firmware_update_common.c

cmake/docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ initialize_cmake() {
1111
}
1212

1313
# Check if CMake has never been initialized
14-
if [ ! -f Makefile ]; then
14+
if [ ! -f build.ninja ]; then
1515
initialize_cmake
1616
fi
1717

docs/ADSB.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,26 @@ is an air traffic surveillance technology that enables aircraft to be accurately
77

88
OSD can be configured to shows the closest aircraft.
99

10+
## OSD ADSB Info element
11+
* "-" no ADSB device detected
12+
* "H" IMU heading is not valid
13+
* "G" no GPS fix or less than 4 stats
14+
* "[Number]" count of ADSB aircrafts
15+
16+
## OSD ADSB Warning element
17+
OSD can be configured to simple view (one line) or to extended view (two lines) by \
18+
`set osd_adsb_warning_style=EXTENDED`
19+
20+
### Simple view
21+
`{distance to vehicle} {direction to vehicle} {altitude diff}`
22+
23+
### Extended view
24+
`{distance to vehicle} {direction to vehicle} {altitude diff}` \
25+
`{Emiter Type} {Vehicle direction} {Vehicle Speed}`
26+
27+
![ADSB OSD](assets/images/adsb-info.png)
28+
29+
1030
## Hardware
1131

1232
All ADSB receivers which can send Mavlink [ADSB_VEHICLE](https://mavlink.io/en/messages/common.html#ADSB_VEHICLE) message are supported

docs/Blackbox.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ These chips are also supported:
120120
* Winbond W25Q64 - 64 Mbit / 8 MByte
121121
* Micron N25Q0128 - 128 Mbit / 16 MByte
122122
* Winbond W25Q128 - 128 Mbit / 16 MByte
123+
* Winbond W25N01 - 1 Gbit / 128 MByte
124+
* Winbond W25N02 - 2 Gbit / 256 MByte
123125

124126
#### Enable recording to dataflash
125127
On the Configurator's CLI tab, you must enter `set blackbox_device=SPIFLASH` to switch to logging to an onboard dataflash chip, then save.

0 commit comments

Comments
 (0)