Skip to content

Commit ea8b800

Browse files
authored
Merge pull request #243 from iNavFlight/development
V1.6.0
2 parents cca7ef9 + d90faf1 commit ea8b800

Some content is hidden

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

41 files changed

+678
-187
lines changed

Diff for: .travis.yml

+33-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
1-
os:
2-
- linux
3-
4-
sudo: false
1+
os: linux
52

63
dist: trusty
74

8-
addons:
9-
apt:
10-
packages:
11-
- lua5.2
12-
13-
git:
14-
depth: 4
5+
sudo: false
156

167
language: c
178

9+
env:
10+
global:
11+
- LUAROCKS=2.3.0
12+
matrix:
13+
- LUA=lua5.2
14+
15+
before_install:
16+
- source .travis/setenv_lua.sh
17+
- pip install --user cpp-coveralls
18+
- luarocks install Lua-cURL --server=https://luarocks.org/dev
19+
- luarocks install luacov-coveralls --server=https://luarocks.org/dev
20+
- luarocks install lunitx
21+
1822
install:
23+
- luarocks make .travis/foo-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"
24+
25+
script:
26+
- ./.travis/build.sh
27+
- cd test
28+
- lunit.sh test.lua
29+
30+
after_success:
31+
- coveralls -b .. -r .. -i ./src --dump c.report.json
32+
- luacov-coveralls -j c.report.json -v
33+
- 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then curl -X POST https://api.telegram.org/bot797688679:AAEcKXFJ-0cDfiQLmn_hMg83FDFEtV7x2LQ/sendMessage -d chat_id=@luatelemetry -d "text=Build successful - PR #$TRAVIS_PULL_REQUEST $TRAVIS_PULL_REQUEST_BRANCH > $TRAVIS_BRANCH"; fi'
34+
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then curl -X POST https://api.telegram.org/bot797688679:AAEcKXFJ-0cDfiQLmn_hMg83FDFEtV7x2LQ/sendMessage -d chat_id=@luatelemetry -d "text=Build successful - Branch $TRAVIS_BRANCH: $TRAVIS_COMMIT_MESSAGE"; fi'
1935

20-
script: ./bin/build.sh
36+
notifications:
37+
email:
38+
recipients:
39+
40+
on_success: never
41+
on_failure: always

Diff for: bin/build.sh renamed to .travis/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ done
3232
if [[ $LAST_FAILURE -eq 0 ]]; then
3333
echo -e "\e[1m\e[39m[\e[32mTEST SUCCESSFUL\e[39m]\e[21m All lua files built successfully!"
3434
fi
35-
exit $LAST_FAILURE
35+
exit $LAST_FAILURE

Diff for: .travis/foo-scm-0.rockspec

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package = "foo"
2+
version = "scm-0"
3+
4+
source = {
5+
url = "" -- this is just make file
6+
}
7+
8+
description = {
9+
summary = "",
10+
homepage = "",
11+
license = "MIT/X11",
12+
}
13+
14+
dependencies = {
15+
"lua >= 5.1",
16+
}
17+
18+
build = {
19+
copy_directories = {},
20+
21+
type = "builtin",
22+
23+
modules = {
24+
[ "foo.core" ] = "src/foo.c";
25+
[ "foo" ] = "src/lua/foo.lua";
26+
}
27+
}

Diff for: .travis/platform.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if [ -z "${PLATFORM:-}" ]; then
2+
PLATFORM=$TRAVIS_OS_NAME;
3+
fi
4+
5+
if [ "$PLATFORM" == "osx" ]; then
6+
PLATFORM="macosx";
7+
fi
8+
9+
if [ -z "$PLATFORM" ]; then
10+
if [ "$(uname)" == "Linux" ]; then
11+
PLATFORM="linux";
12+
else
13+
PLATFORM="macosx";
14+
fi;
15+
fi

Diff for: .travis/setenv_lua.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin
2+
bash .travis/setup_lua.sh
3+
eval `$HOME/.lua/luarocks path`

Diff for: .travis/setup_lua.sh

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#! /bin/bash
2+
3+
# A script for setting up environment for travis-ci testing.
4+
# Sets up Lua and Luarocks.
5+
# LUA must be "lua5.1", "lua5.2" or "luajit".
6+
# luajit2.0 - master v2.0
7+
# luajit2.1 - master v2.1
8+
9+
set -eufo pipefail
10+
11+
LUAJIT_VERSION="2.0.4"
12+
LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION"
13+
14+
source .travis/platform.sh
15+
16+
LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua
17+
18+
LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks
19+
20+
mkdir $HOME/.lua
21+
22+
LUAJIT="no"
23+
24+
if [ "$PLATFORM" == "macosx" ]; then
25+
if [ "$LUA" == "luajit" ]; then
26+
LUAJIT="yes";
27+
fi
28+
if [ "$LUA" == "luajit2.0" ]; then
29+
LUAJIT="yes";
30+
fi
31+
if [ "$LUA" == "luajit2.1" ]; then
32+
LUAJIT="yes";
33+
fi;
34+
elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
35+
LUAJIT="yes";
36+
fi
37+
38+
mkdir -p "$LUA_HOME_DIR"
39+
40+
if [ "$LUAJIT" == "yes" ]; then
41+
42+
if [ "$LUA" == "luajit" ]; then
43+
curl --location https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz;
44+
else
45+
git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE;
46+
fi
47+
48+
cd $LUAJIT_BASE
49+
50+
if [ "$LUA" == "luajit2.1" ]; then
51+
git checkout v2.1;
52+
# force the INSTALL_TNAME to be luajit
53+
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
54+
fi
55+
56+
make && make install PREFIX="$LUA_HOME_DIR"
57+
58+
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
59+
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;
60+
61+
else
62+
63+
if [ "$LUA" == "lua5.1" ]; then
64+
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
65+
cd lua-5.1.5;
66+
elif [ "$LUA" == "lua5.2" ]; then
67+
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz
68+
cd lua-5.2.4;
69+
elif [ "$LUA" == "lua5.3" ]; then
70+
curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz
71+
cd lua-5.3.2;
72+
fi
73+
74+
# Build Lua without backwards compatibility for testing
75+
perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' src/Makefile
76+
make $PLATFORM
77+
make INSTALL_TOP="$LUA_HOME_DIR" install;
78+
79+
ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
80+
ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;
81+
82+
fi
83+
84+
cd $TRAVIS_BUILD_DIR
85+
86+
lua -v
87+
88+
LUAROCKS_BASE=luarocks-$LUAROCKS
89+
90+
curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz
91+
92+
cd $LUAROCKS_BASE
93+
94+
if [ "$LUA" == "luajit" ]; then
95+
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
96+
elif [ "$LUA" == "luajit2.0" ]; then
97+
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
98+
elif [ "$LUA" == "luajit2.1" ]; then
99+
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR";
100+
else
101+
./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR"
102+
fi
103+
104+
make build && make install
105+
106+
ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks
107+
108+
cd $TRAVIS_BUILD_DIR
109+
110+
luarocks --version
111+
112+
rm -rf $LUAROCKS_BASE
113+
114+
if [ "$LUAJIT" == "yes" ]; then
115+
rm -rf $LUAJIT_BASE;
116+
elif [ "$LUA" == "lua5.1" ]; then
117+
rm -rf lua-5.1.5;
118+
elif [ "$LUA" == "lua5.2" ]; then
119+
rm -rf lua-5.2.4;
120+
elif [ "$LUA" == "lua5.3" ]; then
121+
rm -rf lua-5.3.2;
122+
fi

Diff for: README.md

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## INAV Lua Telemetry Flight Status for Taranis/Horus - v1.5.1
1+
## INAV Lua Telemetry Flight Status for Taranis/Horus - v1.6.0
22

3-
### FrSky SmartPort(S.Port), D-series and F.Port telemetry on all Taranis and Horus transmitters
3+
### FrSky SmartPort(S.Port), D-series, F.Port & TBS Crossfire telemetry on Taranis & Horus transmitters
44

55
[![Build Status](https://travis-ci.com/iNavFlight/LuaTelemetry.svg?branch=master)](https://travis-ci.com/iNavFlight/LuaTelemetry)
66

@@ -29,7 +29,8 @@
2929

3030
## Features
3131

32-
* Works with all FrSky telemetry receivers (X-series, R9 series and D-series) and all FrSky Taranis and Horus transmitters
32+
* Works with all FrSky telemetry receivers (X, R9 and D series), all TBS Crossfire receivers and all FrSky Taranis and Horus transmitters
33+
* Compatible with Betaflight using FrSky X or R9 series receivers (with reduced functionality) and TBS Crossfire support with Betaflight >3.5.5
3334
* Launch/pilot-based model orientation and location indicators (great for lost orientation/losing sight of your model)
3435
* Compass-based direction indicator (with compass on multirotor or fixed-wing with GPS)
3536
* Pilot (glass cockpit) view which includes attitude indicator as well as pilot-familiar layout of additional data
@@ -42,15 +43,15 @@
4243
* Display of current/maximum: Altitude, Distance, Speed and Current
4344
* Display of current/minimum: Battery voltage, RSSI strength
4445
* Title display of model name, flight timer, transmitter voltage and receiver voltage
45-
* Menu configuration options can be changed from inside the script and are unique to each model on the transmitter
46+
* Menu configuration options can be changed from inside the script and can be unique to each model
4647
* Speed and distance values are displayed in metric or imperial based on transmitter's telemetry settings
4748
* Voice files, modes and config menu in English, German, French or Spanish (more languages to follow)
4849

4950
## Requirements
5051

5152
* [OpenTX v2.2.0+](http://www.open-tx.org/) running on Taranis Q X7/Q X7S, X9D/X9D+, X9E, X-Lite, Horus X10/X10S or X12S (OpenTX v2.2.2+ is suggested)
52-
* FrSky X-series, R9 series or D-series telemetry receiver: X4RSB, X8R, XSR, R-XSR, XSR-M, XSR-E, RX4R, RX6R, XM, XM+, R9, R9 Slim, R9 Slim+, R9 Mini, R9 MM, D8R-II plus, D8R-XP, D4R-II, etc.
53-
* [INAV v1.7.3+](https://github.com/iNavFlight/inav/releases) running on your flight controller (INAV v2.0+ is suggested for full functionality)
53+
* FrSky X, R9 or D series telemetry receiver: X4RSB, X8R, XSR, R-XSR, XSR-M, XSR-E, RX4R, RX6R, XM, XM+, R9, R9 Slim, R9 Slim+, R9 Mini, R9 MM, D8R-II plus, D8R-XP, D4R-II, etc. or any TBS Crossfire receiver: Micro, Nano, Diversity, etc.
54+
* [INAV v1.7.3+](https://github.com/iNavFlight/inav/releases) running on your flight controller (INAV v2.1.0+ is suggested for full functionality) - Also compatible with Betaflight (with reduced functionality)
5455
* GPS - If you're looking for a GPS module, I suggest the [Beitian BN-880](https://www.banggood.com/UBLOX-NEO-M8N-BN-880-Flight-Control-GPS-Module-Dual-Module-Compass-p-971082.html)
5556

5657
## Suggested Sensors
@@ -61,22 +62,23 @@
6162

6263
## Notes
6364

64-
* INAV v2.0+ is required for FrSky D-series telemetry and proper GPS accuracy (HDOP) display
65+
* INAV v2.1.0+ is required for TBS Crossfire support (some telemetry missing from Crossfire: HDOP, GPS altitude, variometer and heading hold notifications)
66+
* INAV v2.0.0+ is required for FrSky D-series telemetry and proper GPS accuracy (HDOP) display
6567
* If using pilot or radar view or a Horus transmitter and INAV v2.0+, set `frsky_pitch_roll = ON` in CLI settings for more accurate attitude display
6668
* INAV v1.9.1+ is required for F.Port compatibility
67-
* INAV v1.8+ is required for `Home reset` voice notification
69+
* INAV v1.8.0+ is required for `Home reset` voice notification
6870
* OpenTX v2.2.2 (release version) is required for compatibility with Taranis X-Lite transmitter
69-
* [Crossfire](https://github.com/iNavFlight/LuaTelemetry/issues/36) is not currently supported due to missing flight modes that are critical to Lua Telemetry
71+
* Betaflight compatibility is mostly complete, except for some GPS and flight mode information missing from Betaflight
7072

7173
## Special Thanks
74+
* [Team Black Sheep](https://www.team-blacksheep.com/) - Sponsoring TBS Crossfire telemetry support
7275
* [FrSky](https://www.frsky-rc.com/) - Sponsoring Horus transmitter support
7376

7477
## Setup
7578

7679
* [Lua Telemetry Wiki](https://github.com/iNavFlight/LuaTelemetry/wiki)
7780
* [Download latest release](https://github.com/iNavFlight/LuaTelemetry/releases/latest)
7881
* [Installation Instructions](https://github.com/iNavFlight/LuaTelemetry/wiki/Installation)
79-
* [Installation: Horus Widget](https://github.com/iNavFlight/LuaTelemetry/wiki/Installation:-Horus-Widget)
8082
* [Upgrade Instructions](https://github.com/iNavFlight/LuaTelemetry/wiki/Upgrade)
8183

8284
## Information & Settings
@@ -90,6 +92,7 @@
9092

9193
* [Tips & Common Problems](https://github.com/iNavFlight/LuaTelemetry/wiki/Tips-&-Common-Problems)
9294
* [Support Issues](https://github.com/iNavFlight/LuaTelemetry/issues?q=is%3Aissue)
95+
* [Support Chat (Telegram)](https://t.me/luatelemetry)
9396

9497
## Other
9598

Diff for: assets/iNavHorus.png

72 Bytes
Loading

Diff for: assets/iNavX9Dvideo.png

136 KB
Loading

Diff for: dist/SCRIPTS/TELEMETRY/iNav.lua

-49 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav.luac

-49 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/config.luac

94 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/crsf.luac

2.11 KB
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/data.luac

81 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/func_h.luac

419 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/func_t.luac

212 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/horus.luac

989 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/menu.luac

179 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/other.luac

225 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/pics/bg.png

-31 Bytes
Loading

Diff for: dist/SCRIPTS/TELEMETRY/iNav/pics/fg.png

-11 Bytes
Loading

Diff for: dist/SCRIPTS/TELEMETRY/iNav/pilot.luac

384 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/radar.luac

384 Bytes
Binary file not shown.

Diff for: dist/SCRIPTS/TELEMETRY/iNav/view.luac

297 Bytes
Binary file not shown.

Diff for: src/foo.c

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "lua.h"
2+
3+
static int ret_true(lua_State *L){
4+
lua_pushboolean(L, 1);
5+
return 1;
6+
}
7+
8+
int luaopen_foo_core(lua_State *L){
9+
lua_newtable(L);
10+
lua_pushcfunction(L, ret_true);
11+
lua_setfield(L, -2, "test_true");
12+
return 1;
13+
}

0 commit comments

Comments
 (0)