Skip to content

Commit

Permalink
Merge pull request #310 from iNavFlight/development
Browse files Browse the repository at this point in the history
v1.7.1
  • Loading branch information
teckel12 authored Jun 29, 2019
2 parents 03fce67 + b35f777 commit 7c93e45
Show file tree
Hide file tree
Showing 46 changed files with 645 additions and 514 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.luac -diff
*.png -diff
*.wav -diff
dist/SCRIPTS/TELEMETRY/iNav.lua -diff
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist/SCRIPTS/TELEMETRY/iNav/*.lua
*.dat
*.zip
desktop.ini
dist/THEMES/
dist/THEMES/
obj/
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## INAV Lua Telemetry Flight Status for Taranis/Horus/Jumper T16 - v1.7.0
## INAV Lua Telemetry Flight Status for Taranis/Horus/Jumper T16 - v1.7.1

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

Expand Down Expand Up @@ -35,13 +35,13 @@
## Features

* Works with all FrSky telemetry receivers (X, R9 and D series), all TBS Crossfire receivers, all FrSky Taranis and Horus transmitters, and the Jumper T16 transmitter
* Compatible with Betaflight using FrSky X or R9 series receivers (with reduced functionality) and TBS Crossfire support with Betaflight >3.5.5
* Compatible with Betaflight using FrSky X or R9 series receivers (with reduced functionality) and TBS Crossfire support with Betaflight 4.0.0+
* Launch/pilot-based model orientation and location indicators (great for lost orientation/losing sight of your model)
* Compass-based direction indicator (with magnetometer sensor on multirotor or fixed-wing with GPS)
* Pilot (glass cockpit) view which includes attitude indicator as well as pilot-familiar layout of additional data
* Radar (map) view shows model in relationship to home position, can be displayed either as launch/pilot-based or compass-based orientation
* Altitude graph view shows altitude for the last 1-6 minutes
* Horus and Jumper T16 transmitters show all views at the same time, and include additional features like roll indicator and uncaged pitch ladder
* Horus and Jumper T16 transmitters show all views at the same time, and include additional features like roll scale
* Bar gauges for Fuel (% battery mAh capacity remaining), Battery voltage, RSSI strength, Transmitter battery, GPS accuracy (HDOP), Variometer (and Altitude for X9D, X9D+ and X9E transmitters)
* Display and voice alerts for flight modes and flight mode modifiers (altitude hold, heading hold, home reset, etc.)
* Voice notifications for % battery remaining (based on current), voltage low/critical, high altitude, lost GPS, ready to arm, armed, disarmed, etc.
Expand All @@ -55,7 +55,7 @@

## Requirements

* [OpenTX v2.2.2+](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.3+ is suggested)
* [OpenTX v2.2.2+](http://www.open-tx.org/) running on Taranis Q X7/Q X7S, X9D/X9D+, X9E, X9 Lite, X-Lite/X-Lite Pro, Horus X10/X10S or X12S (OpenTX v2.2.3+ is suggested)
* Jumper T16 requires [JumperTX 2.2.3+](https://www.jumper.xyz/jumpertx-t16) (May 23, 2019 or after release)
* 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)
Expand Down Expand Up @@ -90,6 +90,7 @@
* [Download latest release](https://github.com/iNavFlight/LuaTelemetry/releases/latest)
* [Installation Instructions](https://github.com/iNavFlight/LuaTelemetry/wiki/Installation)
* [Upgrade Instructions](https://github.com/iNavFlight/LuaTelemetry/wiki/Upgrade)
* [Download Options](https://github.com/iNavFlight/LuaTelemetry/wiki/Download-Options)

## Information & Settings

Expand Down
Binary file modified assets/iNavConfigHorus.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 assets/iNavX9Dalt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions build
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

echo
echo Compiling INAV Lua Telemetry...
echo

mkdir obj

luac52 -s -o obj/main.luac dist/WIDGETS/iNav/main.lua
luac52 -s -o obj/iNav.luac src/iNav.lua
luac52 -s -o obj/alt.luac src/iNav/alt.lua
luac52 -s -o obj/config.luac src/iNav/config.lua
luac52 -s -o obj/crsf.luac src/iNav/crsf.lua
luac52 -s -o obj/data.luac src/iNav/data.lua
luac52 -s -o obj/func_h.luac src/iNav/func_h.lua
luac52 -s -o obj/func_t.luac src/iNav/func_t.lua
luac52 -s -o obj/horus.luac src/iNav/horus.lua
luac52 -s -o obj/lang.luac src/iNav/lang.lua
luac52 -s -o obj/lang_de.luac src/iNav/lang_de.lua
luac52 -s -o obj/lang_es.luac src/iNav/lang_es.lua
luac52 -s -o obj/lang_fr.luac src/iNav/lang_fr.lua
luac52 -s -o obj/load.luac src/iNav/load.lua
luac52 -s -o obj/menu.luac src/iNav/menu.lua
luac52 -s -o obj/modes.luac src/iNav/modes.lua
luac52 -s -o obj/other.luac src/iNav/other.lua
luac52 -s -o obj/pilot.luac src/iNav/pilot.lua
luac52 -s -o obj/radar.luac src/iNav/radar.lua
luac52 -s -o obj/reset.luac src/iNav/reset.lua
luac52 -s -o obj/view.luac src/iNav/view.lua

rm -fR obj/

echo
echo Complete
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/alt.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/config.luac
Binary file not shown.
Binary file modified 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/horus.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/lang.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/lang_de.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/lang_es.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/lang_fr.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 added dist/SCRIPTS/TELEMETRY/iNav/pics/fpv.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/reset.luac
Binary file not shown.
Binary file modified dist/SCRIPTS/TELEMETRY/iNav/view.luac
Binary file not shown.
1 change: 1 addition & 0 deletions dist/WIDGETS/iNav/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ end
-- This function allow updates when you change widgets settings
local function update(iNavZone, options)
iNavZone.options = options
return
end

-- Called periodically when custom telemetry screen containing widget is visible.
Expand Down
Binary file modified dist/WIDGETS/iNav/main.luac
Binary file not shown.
9 changes: 5 additions & 4 deletions release
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

echo
echo -n Packaging release files

rm LuaTelemetry-Taranis-en.zip > /dev/null 2>&1
Expand All @@ -10,13 +11,13 @@ echo -n .

cd dist

zip -9 -q -r ../LuaTelemetry-Taranis-en.zip SCRIPTS/* -x *.lua -x *.dat -x */pics/* -x */de/* -x */es/* -x */fr/*
zip -9 -q -r ../LuaTelemetry-Taranis-en.zip SCRIPTS/* -x *.lua -x *.dat -x */pics/* -x */horus.luac -x */func_h.luac -x */de/* -x */es/* -x */fr/* -x */lang*.luac
echo -n .
zip -9 -q -r ../LuaTelemetry-Taranis.zip SCRIPTS/* -x *.lua -x *.dat -x */pics/*
zip -9 -q -r ../LuaTelemetry-Taranis.zip SCRIPTS/* -x *.lua -x *.dat -x */pics/* -x */horus.luac -x */func_h.luac
echo -n .
zip -9 -q -r ../LuaTelemetry-Horus-en.zip SCRIPTS/* WIDGETS/* -x *.lua -x *.dat -x */de/* -x */es/* -x */fr/*
zip -9 -q -r ../LuaTelemetry-Horus-en.zip SCRIPTS/* WIDGETS/* -x *.lua -x *.dat -x */de/* -x */es/* -x */fr/* -x */lang*.luac -x */alt.luac -x */func_t.luac -x */pilot.luac -x */radar.luac -x */view.luac
echo -n .
zip -9 -q -r ../LuaTelemetry-Horus.zip SCRIPTS/* WIDGETS/* -x *.lua -x *.dat
zip -9 -q -r ../LuaTelemetry-Horus.zip SCRIPTS/* WIDGETS/* -x *.lua -x *.dat -x */alt.luac -x */func_t.luac -x */pilot.luac -x */radar.luac -x */view.luac
echo -n .
zip -9 -q -r ../LuaTelemetry.zip SCRIPTS/* WIDGETS/* -x *.lua -x *.dat
echo -n .
Expand Down
101 changes: 48 additions & 53 deletions src/iNav.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@
-- Docs: https://github.com/iNavFlight/LuaTelemetry

local buildMode = ...
local VERSION = "1.7.0"
local VERSION = "1.7.1"
local FILE_PATH = "/SCRIPTS/TELEMETRY/iNav/"
local SMLCD = LCD_W < 212
local HORUS = LCD_W >= 480
local FLASH = HORUS and WARNING_COLOR or 3
local tmp, view, lang
local env = "bx"

-- Build with Companion
-- Build with Companion and allow debugging
local v, r, m, i, e = getVersion()
if string.sub(r, -4) == "simu" and buildMode ~= false then
loadScript(FILE_PATH .. "build", "tx")(buildMode)
if string.sub(r, -4) == "simu" then
env = "tx"
if buildMode ~= false then
loadScript(FILE_PATH .. "build", "tx")(buildMode)
end
end

local config = loadfile(FILE_PATH .. "config.luac")(SMLCD)
local config = loadScript(FILE_PATH .. "config", env)(SMLCD)
collectgarbage()

local modes, units, labels = loadfile(FILE_PATH .. "modes.luac")()
local modes, units, labels = loadScript(FILE_PATH .. "modes", env)()
collectgarbage()

local data, getTelemetryId, getTelemetryUnit, PREV, INCR, NEXT, DECR, MENU = loadfile(FILE_PATH .. "data.luac")(r, m, i, HORUS)
local data, getTelemetryId, getTelemetryUnit, PREV, INCR, NEXT, DECR, MENU = loadScript(FILE_PATH .. "data", env)(r, m, i, HORUS)
collectgarbage()

loadfile(FILE_PATH .. "load.luac")(config, data, FILE_PATH)
loadScript(FILE_PATH .. "load", env)(config, data, FILE_PATH)
collectgarbage()

--[[ Simulator language testing
Expand All @@ -34,15 +38,17 @@ data.voice = "es"
]]

if data.lang ~= "en" or data.voice ~= "en" then
lang = loadfile(FILE_PATH .. "lang.luac")(modes, labels, data, FILE_PATH)
lang = loadScript(FILE_PATH .. "lang", env)(modes, labels, data, FILE_PATH, env)
collectgarbage()
end

loadfile(FILE_PATH .. "reset.luac")(data)
local crsf = loadfile(FILE_PATH .. "other.luac")(config, data, units, getTelemetryId, getTelemetryUnit, FILE_PATH)
loadScript(FILE_PATH .. "reset", env)(data)
collectgarbage()

local crsf, distCalc = loadScript(FILE_PATH .. "other", env)(config, data, units, getTelemetryId, getTelemetryUnit, FILE_PATH, env)
collectgarbage()

local title, gpsDegMin, hdopGraph, icons, widgetEvt = loadfile(FILE_PATH .. (HORUS and "func_h.luac" or "func_t.luac"))(config, data, FILE_PATH)
local title, gpsDegMin, hdopGraph, icons, widgetEvt = loadScript(FILE_PATH .. (HORUS and "func_h" or "func_t"), env)(config, data, FILE_PATH)
collectgarbage()

local function playAudio(f, a)
Expand All @@ -51,24 +57,15 @@ local function playAudio(f, a)
end
end

local function calcTrig(gps1, gps2, deg)
local o1 = math.rad(gps1.lat)
local a1 = math.rad(gps1.lon)
local o2 = math.rad(gps2.lat)
local a2 = math.rad(gps2.lon)
if deg then
local x = (math.cos(o1) * math.sin(o2)) - (math.sin(o1) * math.cos(o2) * math.cos(a2 - a1))
local y = math.sin(a2 - a1) * math.cos(o2)
return math.deg(math.atan2(y, x))
else
--[[ Spherical-Earth math: More accurate but only at extreme distances
return math.acos(math.sin(o1) * math.sin(o2) + math.cos(o1) * math.cos(o2) * math.cos(a2 - a1)) * 6371009;
]]
-- Flat-Earth math
local x = (a2 - a1) * math.cos((o1 + o2) / 2)
local y = o2 - o1
return math.sqrt(x * x + y * y) * 6371009
end
local function calcBearing(gps1, gps2)
--[[ Spherical-Earth math: More accurate if the Earth was a sphere, but obviously it's not
local x = (math.cos(o1) * math.sin(o2)) - (math.sin(o1) * math.cos(o2) * math.cos(a2 - a1))
local y = math.sin(a2 - a1) * math.cos(o2)
return math.deg(math.atan2(y, x))
]]
-- Flat-Earth math
local x = (gps2.lon - gps1.lon) * math.cos(math.rad(gps1.lat))
return math.deg(1.5708 - math.atan2(gps2.lat - gps1.lat, x))
end

local function calcDir(r1, r2, r3, x, y, r)
Expand All @@ -82,11 +79,11 @@ local function calcDir(r1, r2, r3, x, y, r)
end

local function background()
data.rssi = getValue(data.rssi_id)
data.rssi, data.rssiLow, data.rssiCrit = getRSSI()
if data.rssi > 0 then
data.telem = true
data.telemFlags = 0
data.rssiMin = getValue(data.rssiMin_id) > 0 and getValue(data.rssiMin_id) or data.rssiMin
data.rssiMin = math.min(data.rssiMin, data.rssi)
data.satellites = getValue(data.sat_id)
if data.showFuel then
data.fuel = getValue(data.fuel_id)
Expand Down Expand Up @@ -146,16 +143,8 @@ local function background()
if data.satellites > 1000 and gpsTemp.lat ~= 0 and gpsTemp.lon ~= 0 then
data.gpsFix = true
data.lastLock = gpsTemp
-- Calculate distance to home if sensor is missing or in simlulator
if data.gpsHome ~= false and (data.dist_id == -1 or data.simu) then
data.distance = calcTrig(data.gpsHome, data.gpsLatLon, false)
data.distanceMax = math.max(data.distMaxCalc, data.distance)
data.distMaxCalc = data.distanceMax
-- If distance is in feet, convert
if data.dist_unit == 10 then
data.distance = math.floor(data.distance * 3.28084 + 0.5)
data.distanceMax = data.distanceMax * 3.28084
end
if data.gpsHome ~= false and distCalc ~= nil then
distCalc(data)
end
end
end
Expand Down Expand Up @@ -230,6 +219,7 @@ local function background()
data.showMax = false
data.showDir = config[32].v == 1 and true or false
data.configStatus = 0
data.configSelect = 0
if not data.gpsAltBase and data.gpsFix then
data.gpsAltBase = data.gpsAlt
end
Expand Down Expand Up @@ -381,7 +371,7 @@ local function background()
-- Initalize variables on flight reset (uses timer3)
tmp = model.getTimer(2)
if tmp.value == 0 then
loadfile(FILE_PATH .. "reset.luac")(data)
loadScript(FILE_PATH .. "reset", env)(data)
tmp.value = 3600
model.setTimer(2, tmp)
end
Expand Down Expand Up @@ -431,19 +421,20 @@ local function run(event)
end

-- Display error if Horus widget isn't full screen
if data.widget then
if (iNavZone.zone.w < 450 or iNavZone.zone.h < 250) and data.msg ~= false then
lcd.drawText(iNavZone.zone.x + 14, iNavZone.zone.y + 16, data.msg, SMLSIZE + WARNING_COLOR)
data.startupTime = math.huge -- Never timeout
return 0
end
event = data.armed and 0 or widgetEvt(data)
if data.widget and data.msg ~= false and (iNavZone.zone.w < 450 or iNavZone.zone.h < 250) then
lcd.drawText(iNavZone.zone.x + 14, iNavZone.zone.y + 16, data.msg, SMLSIZE + WARNING_COLOR)
data.startupTime = math.huge -- Never timeout
return 0
end

-- Clear screen
if HORUS then
lcd.setColor(CUSTOM_COLOR, 264) --lcd.RGB(0, 32, 65)
lcd.clear(CUSTOM_COLOR)
-- On Horus use sticks to control the menu
if event == 0 or event == nil then
event = widgetEvt(data)
end
else
lcd.clear()
end
Expand All @@ -459,7 +450,7 @@ local function run(event)
if data.v ~= 9 then
view = nil
collectgarbage()
view = loadfile(FILE_PATH .. "menu.luac")()
view = loadScript(FILE_PATH .. "menu", env)()
data.v = 9
end
tmp = config[30].v
Expand All @@ -472,6 +463,10 @@ local function run(event)
if data.configStatus == 27 and data.configSelect ~= 0 then
icons.sym(icons.fg)
end
-- Return throttle stick to bottom center
if data.stickMsg ~= nil and not data.armed then
icons.alert()
end
end
else
-- User input
Expand All @@ -494,10 +489,10 @@ local function run(event)
if data.v ~= config[25].v then
view = nil
collectgarbage()
view = loadfile(FILE_PATH .. (HORUS and "horus.luac" or (config[25].v == 0 and "view.luac" or (config[25].v == 1 and "pilot.luac" or (config[25].v == 2 and "radar.luac" or "alt.luac")))))()
view = loadScript(FILE_PATH .. (HORUS and "horus" or (config[25].v == 0 and "view" or (config[25].v == 1 and "pilot" or (config[25].v == 2 and "radar" or "alt")))), env)()
data.v = config[25].v
end
view(data, config, modes, units, labels, gpsDegMin, hdopGraph, icons, calcTrig, calcDir, VERSION, SMLCD, FLASH, FILE_PATH)
view(data, config, modes, units, labels, gpsDegMin, hdopGraph, icons, calcBearing, calcDir, VERSION, SMLCD, FLASH, FILE_PATH)
end
collectgarbage()

Expand Down
20 changes: 10 additions & 10 deletions src/iNav/alt.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, icons, calcTrig, calcDir, VERSION, SMLCD, FLASH, FILE_PATH)
local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, icons, calcBearing, calcDir, VERSION, SMLCD, FLASH, FILE_PATH)

local LEFT_DIV = 36
local LEFT_POS = SMLCD and LEFT_DIV or 73
Expand Down Expand Up @@ -61,15 +61,15 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
-- Altitude graph
local BOTTOM = SMLCD and 47 or 63
tmp = (SMLCD and 30 or 40) / (data.altMax - data.altMin)
lcd.drawLine(RIGHT_POS - 60, BOTTOM, RIGHT_POS - 1, BOTTOM, SOLID, FORCE)
lcd.drawLine(RIGHT_POS - 60, BOTTOM, RIGHT_POS - 1, BOTTOM, SOLID, SMLCD and FORCE or GREY_DEFAULT + FORCE)
for i = 1, 60 do
local cx = RIGHT_POS - 61 + i
local cy = math.floor(BOTTOM - (data.alt[((data.altCur - 2 + i) % 60) + 1] - data.altMin) * tmp)
if cy < BOTTOM then
lcd.drawLine(cx, cy, cx, BOTTOM - 1, SOLID, FORCE)
lcd.drawLine(cx, cy, cx, BOTTOM - 1, SOLID, SMLCD and FORCE or GREY_DEFAULT + FORCE)
end
if (i ~= 1 or not SMLCD) and (i - 1) % (60 / config[28].v) == 0 then
lcd.drawLine(cx, BOTTOM - (SMLCD and 30 or 40), cx, BOTTOM, DOTTED, SMLCD and 0 or GREY_DEFAULT)
lcd.drawLine(cx, BOTTOM - (SMLCD and 30 or 40), cx, BOTTOM, DOTTED, 0)
end
end
if data.altMin < -1 then
Expand All @@ -82,7 +82,7 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic

-- Orientation
if not SMLCD and data.telem then
if data.showDir or data.headingRef < 0 then
if data.showDir or data.headingRef == -1 then
lcd.drawText(LEFT_POS + 12, 29, "N", SMLSIZE)
lcd.drawText(LEFT_POS + 25 - (data.heading < 100 and 3 or 0) - (data.heading < 10 and 3 or 0), 57, math.floor(data.heading + 0.5) % 360 .. "\64", SMLSIZE + RIGHT + data.telemFlags)
tmp = data.heading
Expand Down Expand Up @@ -150,14 +150,14 @@ local function view(data, config, modes, units, labels, gpsDegMin, hdopGraph, ic
lcd.drawLine(LEFT_DIV, 8, LEFT_DIV, 63, SOLID, FORCE)
tmp = (not data.telem or data.cell < config[3].v or (data.showFuel and config[23].v == 0 and data.fuel <= config[17].v)) and FLASH or 0
if data.showFuel then
if config[23].v == 0 then
if config[23].v > 0 or (data.crsf and data.showMax) then
lcd.drawText(LEFT_DIV, data.showCurr and 8 or 10, (data.crsf and data.fuelRaw or data.fuel), MIDSIZE + RIGHT + tmp)
lcd.drawText(LEFT_DIV, data.showCurr and 20 or 23, data.fUnit[data.crsf and 1 or config[23].v], SMLSIZE + RIGHT + tmp)
else
lcd.drawText(LEFT_DIV - 5, data.showCurr and 8 or 12, data.fuel, DBLSIZE + RIGHT + tmp)
lcd.drawText(LEFT_DIV, data.showCurr and 17 or 21, "%", SMLSIZE + RIGHT + tmp)
else
lcd.drawText(LEFT_DIV, data.showCurr and 8 or 10, data.fuel, MIDSIZE + RIGHT + tmp)
lcd.drawText(LEFT_DIV, data.showCurr and 20 or 23, data.fUnit[config[23].v], SMLSIZE + RIGHT + tmp)
end
end
end
lcd.drawText(LEFT_DIV - 5, data.showCurr and 25 or 32, string.format(config[1].v == 0 and "%.2f" or "%.1f", config[1].v == 0 and (data.showMax and data.cellMin or data.cell) or (data.showMax and data.battMin or data.batt)), DBLSIZE + RIGHT + tmp)
lcd.drawText(LEFT_DIV, data.showCurr and 34 or 41, "V", SMLSIZE + RIGHT + tmp)
if data.showCurr then
Expand Down
Loading

0 comments on commit 7c93e45

Please sign in to comment.