Skip to content

Commit

Permalink
Merge pull request #243 from iNavFlight/development
Browse files Browse the repository at this point in the history
V1.6.0
  • Loading branch information
teckel12 authored Feb 26, 2019
2 parents cca7ef9 + d90faf1 commit ea8b800
Show file tree
Hide file tree
Showing 41 changed files with 678 additions and 187 deletions.
45 changes: 33 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,41 @@
os:
- linux

sudo: false
os: linux

dist: trusty

addons:
apt:
packages:
- lua5.2

git:
depth: 4
sudo: false

language: c

env:
global:
- LUAROCKS=2.3.0
matrix:
- LUA=lua5.2

before_install:
- source .travis/setenv_lua.sh
- pip install --user cpp-coveralls
- luarocks install Lua-cURL --server=https://luarocks.org/dev
- luarocks install luacov-coveralls --server=https://luarocks.org/dev
- luarocks install lunitx

install:
- luarocks make .travis/foo-scm-0.rockspec CFLAGS="-O2 -fPIC -ftest-coverage -fprofile-arcs" LIBFLAG="-shared --coverage"

script:
- ./.travis/build.sh
- cd test
- lunit.sh test.lua

after_success:
- coveralls -b .. -r .. -i ./src --dump c.report.json
- luacov-coveralls -j c.report.json -v
- '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'
- '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'

script: ./bin/build.sh
notifications:
email:
recipients:
- [email protected]
on_success: never
on_failure: always
2 changes: 1 addition & 1 deletion bin/build.sh → .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ done
if [[ $LAST_FAILURE -eq 0 ]]; then
echo -e "\e[1m\e[39m[\e[32mTEST SUCCESSFUL\e[39m]\e[21m All lua files built successfully!"
fi
exit $LAST_FAILURE
exit $LAST_FAILURE
27 changes: 27 additions & 0 deletions .travis/foo-scm-0.rockspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package = "foo"
version = "scm-0"

source = {
url = "" -- this is just make file
}

description = {
summary = "",
homepage = "",
license = "MIT/X11",
}

dependencies = {
"lua >= 5.1",
}

build = {
copy_directories = {},

type = "builtin",

modules = {
[ "foo.core" ] = "src/foo.c";
[ "foo" ] = "src/lua/foo.lua";
}
}
15 changes: 15 additions & 0 deletions .travis/platform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
if [ -z "${PLATFORM:-}" ]; then
PLATFORM=$TRAVIS_OS_NAME;
fi

if [ "$PLATFORM" == "osx" ]; then
PLATFORM="macosx";
fi

if [ -z "$PLATFORM" ]; then
if [ "$(uname)" == "Linux" ]; then
PLATFORM="linux";
else
PLATFORM="macosx";
fi;
fi
3 changes: 3 additions & 0 deletions .travis/setenv_lua.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export PATH=${PATH}:$HOME/.lua:$HOME/.local/bin:${TRAVIS_BUILD_DIR}/install/luarocks/bin
bash .travis/setup_lua.sh
eval `$HOME/.lua/luarocks path`
122 changes: 122 additions & 0 deletions .travis/setup_lua.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#! /bin/bash

# A script for setting up environment for travis-ci testing.
# Sets up Lua and Luarocks.
# LUA must be "lua5.1", "lua5.2" or "luajit".
# luajit2.0 - master v2.0
# luajit2.1 - master v2.1

set -eufo pipefail

LUAJIT_VERSION="2.0.4"
LUAJIT_BASE="LuaJIT-$LUAJIT_VERSION"

source .travis/platform.sh

LUA_HOME_DIR=$TRAVIS_BUILD_DIR/install/lua

LR_HOME_DIR=$TRAVIS_BUILD_DIR/install/luarocks

mkdir $HOME/.lua

LUAJIT="no"

if [ "$PLATFORM" == "macosx" ]; then
if [ "$LUA" == "luajit" ]; then
LUAJIT="yes";
fi
if [ "$LUA" == "luajit2.0" ]; then
LUAJIT="yes";
fi
if [ "$LUA" == "luajit2.1" ]; then
LUAJIT="yes";
fi;
elif [ "$(expr substr $LUA 1 6)" == "luajit" ]; then
LUAJIT="yes";
fi

mkdir -p "$LUA_HOME_DIR"

if [ "$LUAJIT" == "yes" ]; then

if [ "$LUA" == "luajit" ]; then
curl --location https://github.com/LuaJIT/LuaJIT/archive/v$LUAJIT_VERSION.tar.gz | tar xz;
else
git clone https://github.com/LuaJIT/LuaJIT.git $LUAJIT_BASE;
fi

cd $LUAJIT_BASE

if [ "$LUA" == "luajit2.1" ]; then
git checkout v2.1;
# force the INSTALL_TNAME to be luajit
perl -i -pe 's/INSTALL_TNAME=.+/INSTALL_TNAME= luajit/' Makefile
fi

make && make install PREFIX="$LUA_HOME_DIR"

ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/luajit
ln -s $LUA_HOME_DIR/bin/luajit $HOME/.lua/lua;

else

if [ "$LUA" == "lua5.1" ]; then
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz
cd lua-5.1.5;
elif [ "$LUA" == "lua5.2" ]; then
curl http://www.lua.org/ftp/lua-5.2.4.tar.gz | tar xz
cd lua-5.2.4;
elif [ "$LUA" == "lua5.3" ]; then
curl http://www.lua.org/ftp/lua-5.3.2.tar.gz | tar xz
cd lua-5.3.2;
fi

# Build Lua without backwards compatibility for testing
perl -i -pe 's/-DLUA_COMPAT_(ALL|5_2)//' src/Makefile
make $PLATFORM
make INSTALL_TOP="$LUA_HOME_DIR" install;

ln -s $LUA_HOME_DIR/bin/lua $HOME/.lua/lua
ln -s $LUA_HOME_DIR/bin/luac $HOME/.lua/luac;

fi

cd $TRAVIS_BUILD_DIR

lua -v

LUAROCKS_BASE=luarocks-$LUAROCKS

curl --location http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz | tar xz

cd $LUAROCKS_BASE

if [ "$LUA" == "luajit" ]; then
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
elif [ "$LUA" == "luajit2.0" ]; then
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.0" --prefix="$LR_HOME_DIR";
elif [ "$LUA" == "luajit2.1" ]; then
./configure --lua-suffix=jit --with-lua-include="$LUA_HOME_DIR/include/luajit-2.1" --prefix="$LR_HOME_DIR";
else
./configure --with-lua="$LUA_HOME_DIR" --prefix="$LR_HOME_DIR"
fi

make build && make install

ln -s $LR_HOME_DIR/bin/luarocks $HOME/.lua/luarocks

cd $TRAVIS_BUILD_DIR

luarocks --version

rm -rf $LUAROCKS_BASE

if [ "$LUAJIT" == "yes" ]; then
rm -rf $LUAJIT_BASE;
elif [ "$LUA" == "lua5.1" ]; then
rm -rf lua-5.1.5;
elif [ "$LUA" == "lua5.2" ]; then
rm -rf lua-5.2.4;
elif [ "$LUA" == "lua5.3" ]; then
rm -rf lua-5.3.2;
fi
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## INAV Lua Telemetry Flight Status for Taranis/Horus - v1.5.1
## INAV Lua Telemetry Flight Status for Taranis/Horus - v1.6.0

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

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

Expand Down Expand Up @@ -29,7 +29,8 @@

## Features

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

## Requirements

* [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)
* 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.
* [INAV v1.7.3+](https://github.com/iNavFlight/inav/releases) running on your flight controller (INAV v2.0+ is suggested for full functionality)
* 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.
* [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)
* 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)

## Suggested Sensors
Expand All @@ -61,22 +62,23 @@

## Notes

* INAV v2.0+ is required for FrSky D-series telemetry and proper GPS accuracy (HDOP) display
* INAV v2.1.0+ is required for TBS Crossfire support (some telemetry missing from Crossfire: HDOP, GPS altitude, variometer and heading hold notifications)
* INAV v2.0.0+ is required for FrSky D-series telemetry and proper GPS accuracy (HDOP) display
* 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
* INAV v1.9.1+ is required for F.Port compatibility
* INAV v1.8+ is required for `Home reset` voice notification
* INAV v1.8.0+ is required for `Home reset` voice notification
* OpenTX v2.2.2 (release version) is required for compatibility with Taranis X-Lite transmitter
* [Crossfire](https://github.com/iNavFlight/LuaTelemetry/issues/36) is not currently supported due to missing flight modes that are critical to Lua Telemetry
* Betaflight compatibility is mostly complete, except for some GPS and flight mode information missing from Betaflight

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

## Setup

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

## Information & Settings
Expand All @@ -90,6 +92,7 @@

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

## Other

Expand Down
Binary file modified assets/iNavHorus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/iNavX9Dvideo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav.lua
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/config.luac
Binary file not shown.
Binary file added dist/SCRIPTS/TELEMETRY/iNav/crsf.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/data.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/func_h.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/func_t.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/horus.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/menu.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/other.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/pics/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/pics/fg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/pilot.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/radar.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/view.luac
Binary file not shown.
13 changes: 13 additions & 0 deletions src/foo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "lua.h"

static int ret_true(lua_State *L){
lua_pushboolean(L, 1);
return 1;
}

int luaopen_foo_core(lua_State *L){
lua_newtable(L);
lua_pushcfunction(L, ret_true);
lua_setfield(L, -2, "test_true");
return 1;
}
Loading

0 comments on commit ea8b800

Please sign in to comment.