Compare commits

...
13 Commits
Author SHA1 Message Date
piotr f0d51db58b fix(gx12): persist Ground Station AUX1 serial mode across reboot
The YAML serializer's UART mode lookup table had no entry for
UART_MODE_GROUND_STATION, so the AUX1 selection was written with an
empty value and read back as OFF after a power cycle. Add the missing
table entry and regression tests for the save/reload roundtrip of all
AUX1 modes and the legacy auxSerialMode migration.
2026-09-30 18:19:46 +02:00
piotr f067d8b887 fix(gx12): label Ground Station AUX mode 2026-09-29 13:03:16 +02:00
piotr b45295bbb4 feat(gx12): add Ground Station AUX1 mode 2026-09-29 11:29:34 +02:00
piotr ec20759f81 ci: add manual GX12 firmware build 2026-09-28 20:34:01 +02:00
d351fddaa8 docs(lua): add luadoc annotations for the LVGL Lua API (#7837)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 13:58:18 +10:00
philmozandGitHub dd613ac895 fix(color): potential crash when closing popup menu with a menu toolbar (#7838) 2026-09-28 13:57:10 +10:00
a197c43b51 fix(tools): make build-wasm-modules.sh source dir absolute (#7834)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 19:52:03 +10:00
99b17f0011 docs(build): revise Windows Docker build instructions (#7768)
Co-authored-by: Peter Feerick <5500713+pfeerick@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 15:30:50 +10:00
philmozandGitHub 19b50d967e fix(color): illegal characters not excluded when renaming a label (#7824) 2026-09-26 11:30:36 +10:00
philmozandGitHub 942255d93f chore(color): simplify the code for the mix line multiplex icon (#7820) 2026-09-26 08:05:11 +10:00
Piyush JhaandGitHub fd3b0f8271 chore: register LSM6DSO sensor ID as supported also (#7803) 2026-09-25 13:49:58 +10:00
3djcandGitHub c2cfe393e1 fix(fw): lua telemetry handling (#7773) 2026-09-25 13:47:20 +10:00
425944bff2 chore: centralize board manufacturer/model/USB identity in hw_defs JSON (#7786)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-25 13:46:09 +10:00
126 changed files with 2021 additions and 816 deletions
+35
View File
@@ -0,0 +1,35 @@
name: Build EdgeTX GX12
on:
workflow_dispatch:
jobs:
build:
runs-on: edgetx-build
timeout-minutes: 90
env:
FLAVOR: gx12
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- name: Checkout EdgeTX source
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build unmodified GX12 firmware
shell: bash
run: |
set -euo pipefail
./tools/build-gh.sh
test -f "gx12-$(git rev-parse --short HEAD).bin"
sha256sum gx12-*.bin
- name: Upload GX12 firmware
uses: actions/upload-artifact@v4
with:
name: edgetx-gx12-${{ github.sha }}
retention-days: 30
path: |
gx12-*.bin
LICENSE
+12 -2
View File
@@ -73,6 +73,7 @@ BoardJson::BoardJson(Board::Type board, QString hwdefn) :
m_display({0, 0, 0, 0, 0, 0, 0, 0}),
m_cfs({0, 0}),
m_hardware({0, 0, 0}),
m_identity({"", ""}),
m_inputCnt({0, 0, 0, 0, 0, 0, 0, 0, 0}),
m_switchCnt({0, 0, 0})
{
@@ -1005,7 +1006,7 @@ bool BoardJson::loadDefinition()
if (m_board == Board::BOARD_UNKNOWN)
return true;
if (!loadFile(m_board, m_hwdefn, m_inputs, m_switches, m_keys, m_trims, m_display, m_cfs, m_hardware, m_hasKeyLockCombo))
if (!loadFile(m_board, m_hwdefn, m_inputs, m_switches, m_keys, m_trims, m_display, m_cfs, m_hardware, m_identity, m_hasKeyLockCombo))
return false;
afterLoadFixups(m_board, m_inputs, m_switches, m_keys, m_trims);
@@ -1042,7 +1043,7 @@ bool BoardJson::loadDefinition()
// static
bool BoardJson::loadFile(Board::Type board, QString hwdefn, InputsTable * inputs, SwitchesTable * switches,
KeysTable * keys, TrimsTable * trims, DisplayDefn & display, CustomSwitchesDefn & cfs,
HardwareDefn & hardware, bool & hasKeyLockCombo)
HardwareDefn & hardware, IdentityDefn & identity, bool & hasKeyLockCombo)
{
if (board == Board::BOARD_UNKNOWN) {
return false;
@@ -1293,6 +1294,13 @@ bool BoardJson::loadFile(Board::Type board, QString hwdefn, InputsTable * inputs
hardware.cpu_type = o.value("cpu_type").toString().toStdString();
}
if (obj.value("identity").isObject()) {
const QJsonObject &o = obj.value("identity").toObject();
identity.manufacturer = o.value("manufacturer").toString().toStdString();
identity.model = o.value("model").toString().toStdString();
}
delete json;
return true;
}
@@ -1342,6 +1350,8 @@ const QString BoardJson::getCapabilityStr(const Board::Capability capability) co
return m_hardware.cpu.c_str();
case Board::CPUType:
return m_hardware.cpu_type.c_str();
case Board::Manufacturer:
return m_identity.manufacturer.c_str();
default:
return QString();
}
+7 -1
View File
@@ -127,6 +127,11 @@ class BoardJson
std::string cpu_type = "";
};
struct IdentityDefn {
std::string manufacturer = "";
std::string model = "";
};
typedef std::vector<TrimDefn> TrimsTable;
explicit BoardJson(Board::Type board, QString hwdefn);
@@ -202,6 +207,7 @@ private:
DisplayDefn m_display;
CustomSwitchesDefn m_cfs;
HardwareDefn m_hardware;
IdentityDefn m_identity;
bool m_hasKeyLockCombo = false;
struct InputCounts {
@@ -228,7 +234,7 @@ private:
static bool loadFile(Board::Type board, QString hwdefn, InputsTable * inputs, SwitchesTable * switches,
KeysTable * keys, TrimsTable * trims, DisplayDefn & lcd, CustomSwitchesDefn & cfs,
HardwareDefn & hardware, bool & hasKeyLockCombo);
HardwareDefn & hardware, IdentityDefn & identity, bool & hasKeyLockCombo);
static void afterLoadFixups(Board::Type board, InputsTable * inputs, SwitchesTable * switches,
KeysTable * keys, TrimsTable * trims);
+1 -68
View File
@@ -1255,72 +1255,5 @@ QString Boards::getCapabilityStr(Board::Type board, Board::Capability capability
QString Boards::getManufacturer(Board::Type board)
{
switch (board) {
case BOARD_BETAFPV_LR3PRO:
return "BETAFPV";
case BOARD_FATFISH_F16:
return "Fatfish";
case BOARD_FLYSKY_NV14:
case BOARD_FLYSKY_EL18:
case BOARD_FLYSKY_PA01:
case BOARD_FLYSKY_PL18:
case BOARD_FLYSKY_PL18EV:
case BOARD_FLYSKY_PL18U:
case BOARD_FLYSKY_NB4P:
case BOARD_FLYSKY_ST16:
return "FlySky";
case BOARD_TARANIS_X7:
case BOARD_TARANIS_X7_ACCESS:
case BOARD_TARANIS_XLITE:
case BOARD_TARANIS_XLITES:
case BOARD_TARANIS_X9D:
case BOARD_TARANIS_X9DP:
case BOARD_TARANIS_X9DP_2019:
case BOARD_TARANIS_X9E:
case BOARD_TARANIS_X9LITE:
case BOARD_TARANIS_X9LITES:
case BOARD_HORUS_X12S:
case BOARD_X10:
case BOARD_X10_EXPRESS:
return "FrSky";
case BOARD_HELLORADIOSKY_V16:
case BOARD_HELLORADIOSKY_V12:
case BOARD_HELLORADIOSKY_V14:
case BOARD_HELLORADIOSKY_V14LCD:
return "HelloRadioSky";
case BOARD_IFLIGHT_COMMANDO8:
case BOARD_IFLIGHT_COMMANDO14:
return "iFlight";
case BOARD_JUMPER_T12:
case BOARD_JUMPER_TLITE:
case BOARD_JUMPER_TLITE_F4:
case BOARD_JUMPER_TPRO:
case BOARD_JUMPER_TPROV2:
case BOARD_JUMPER_TPROS:
case BOARD_JUMPER_T12MAX:
case BOARD_JUMPER_BUMBLEBEE:
case BOARD_JUMPER_T14:
case BOARD_JUMPER_T15:
case BOARD_JUMPER_T15PRO:
case BOARD_JUMPER_T22:
case BOARD_JUMPER_T16:
case BOARD_JUMPER_T18:
case BOARD_JUMPER_T20:
case BOARD_JUMPER_T20V2:
return "Jumper";
case BOARD_RADIOMASTER_BOXER:
case BOARD_RADIOMASTER_POCKET:
case BOARD_RADIOMASTER_MT12:
case BOARD_RADIOMASTER_T8:
case BOARD_RADIOMASTER_TX12:
case BOARD_RADIOMASTER_TX12_MK2:
case BOARD_RADIOMASTER_TX16S:
case BOARD_RADIOMASTER_TX16SMK3:
case BOARD_RADIOMASTER_TX15:
case BOARD_RADIOMASTER_ZORRO:
case BOARD_RADIOMASTER_GX12:
return "Radiomaster";
default:
return CPN_STR_UNKNOWN_ITEM;
}
return getCapabilityStr(board, Board::Manufacturer);
}
+1
View File
@@ -262,6 +262,7 @@ namespace Board {
LcdHeight,
LcdOLED,
LcdWidth,
Manufacturer,
MaxContrast,
MaxVolume,
MinContrast,
@@ -0,0 +1,57 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
// Boards::getManufacturer() now reads the "manufacturer" field from each
// board's hw_defs JSON (via BoardJson) instead of a hand-maintained switch
// statement. This guards against the JSON entries and the switch it replaced
// silently drifting apart, e.g. a newly-added board being forgotten (as
// happened with BOARD_SENDUWING_H17 and BOARD_RADIOMASTER_GX15, both of
// which fell through to "???" under the old switch).
#include "gtests.h"
#include "constants.h"
#include "firmwares/boards.h"
#include "firmwares/eeprominterface.h"
TEST(BoardManufacturer, NoRegisteredBoardIsUnknown)
{
for (Firmware *firmware : Firmware::getRegisteredFirmwares()) {
const QString manufacturer = Boards::getManufacturer(firmware->getBoard());
EXPECT_FALSE(manufacturer.isEmpty()) << "board: " << firmware->getId().toStdString();
EXPECT_NE(manufacturer, QString(CPN_STR_UNKNOWN_ITEM))
<< "board: " << firmware->getId().toStdString();
}
}
TEST(BoardManufacturer, KnownBoardsMatchExpectedManufacturer)
{
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_RADIOMASTER_TX16S), QString("RadioMaster"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_RADIOMASTER_GX15), QString("RadioMaster"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_FLYSKY_NV14), QString("Flysky"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_HELLORADIOSKY_V12), QString("HelloRadioSky"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_SENDUWING_H17), QString("Senduwing"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_JUMPER_T16), QString("Jumper"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_IFLIGHT_COMMANDO14), QString("iFlight"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_TARANIS_X9E), QString("FrSky"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_BETAFPV_LR3PRO), QString("BETAFPV"));
EXPECT_EQ(Boards::getManufacturer(Board::BOARD_FATFISH_F16), QString("Fatfish"));
}
+345 -75
View File
@@ -1,103 +1,373 @@
# Build Instructions using Docker and Windows 10
# Build Instructions using Docker and Windows 10 / 11
Work-in-progress page
## Setting up the build environment
# Building EdgeTX on Windows 10 using Docker images
This guide runs Docker Engine inside WSL 2 (Windows Subsystem for Linux), and all build commands are run from a WSL (Ubuntu) terminal. This is done in order to not have extra software running all the time when you do not need it. If you would rather use Docker Desktop or Podman Desktop, see [Alternative: Docker Desktop or Podman Desktop](#alternative-docker-desktop-or-podman-desktop) below.
## Download and install [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/)
### WSL 2 and Ubuntu
## Download and install [GWSL](https://github.com/Opticos/GWSL-Source/releases/) to run Linux Companion and Simulator
- Run GWSL to configure it. Accept page 1 and 2 defaults and add disable access control on page 3
## Fetch a local copy of the EdgeTX repository or update your existing local EdgeTX repository
Click Start, type **cmd**, right-click **Command Prompt** and choose **Run as administrator**, then run:
```bat
wsl --install -d Ubuntu
```
git clone --recursive -b main https://github.com/EdgeTX/edgetx.git EdgeTX
Ubuntu will usually carry on installing straight away and ask you to create your Linux user name and password. These are only used inside this Ubuntu installation and don't need to match your Windows account. You will need the password whenever you run a command with `sudo`, such as when installing software later in this guide.
If you are asked to reboot, do so, then open Ubuntu to finish the setup. To open the Ubuntu terminal later, choose **Ubuntu** from the Start Menu, open a new Ubuntu tab in Windows Terminal, or run `wsl` from a Command Prompt or PowerShell.
If you already have WSL installed, run `wsl --update` to make sure it is up to date.
`wsl --install` enables the Windows features WSL needs for you. If it fails, or you are on an older Windows 10 build, see Microsoft's [Install WSL](https://learn.microsoft.com/en-us/windows/wsl/install) guide and the [manual installation steps](https://learn.microsoft.com/en-us/windows/wsl/install-manual). Hardware virtualization must also be enabled in your PC's BIOS/UEFI settings. It usually is by default, but if WSL reports an error about virtualization, check there first.
To run the Linux Companion and Simulator, this guide uses [WSLg](https://github.com/microsoft/wslg), which is built into WSL 2 on Windows 11, and on Windows 10 (21H2 or later) when WSL is installed from the Microsoft Store. No separate X server is needed.
### Docker Engine
In the Ubuntu terminal, install Docker Engine from Ubuntu's package repository:
```bash
sudo apt update && sudo apt install -y docker.io
```
- If you already have a local EdgeTX repository don't forget to update the submodules too, e.g.:
If you would rather have the very latest version of Docker Engine, you can instead follow Docker's own [Docker Engine install guide for Ubuntu](https://docs.docker.com/engine/install/ubuntu/). Either will work for this guide.
Then allow your user to run `docker` without `sudo`:
```bash
sudo usermod -aG docker $USER
```
git fetch origin
Close and re-open the Ubuntu terminal for this to take effect. Then check Docker is working with:
```bash
docker run hello-world
```
The first time you run this, Docker will report that it is `Unable to find image 'hello-world:latest' locally`, and then download it. This is expected. It then runs the container, which prints `Hello from Docker!` followed by `This message shows that your installation appears to be working correctly.` If you get a `permission denied` error instead, the group change above has not taken effect yet. Close all Ubuntu terminals, run `wsl --shutdown` from a Command Prompt, and try again.
!!! tip "Cannot connect to the Docker daemon?"
The Docker service is started by systemd, which is enabled by default in current Ubuntu WSL installs. If `docker` reports that it cannot connect to the Docker daemon, check that `/etc/wsl.conf` contains:
```ini
[boot]
systemd=true
```
then run `wsl --shutdown` from a Windows Command Prompt and re-open Ubuntu.
### Git
[Git](https://git-scm.com/) is source code control software used to download the EdgeTX source code and keep it up to date. Install it in the Ubuntu terminal with:
```bash
sudo apt update && sudo apt install -y git
```
## Getting the EdgeTX source code
In the Ubuntu terminal, clone the source code repository into your Linux home directory:
```bash
cd ~
git clone --recursive -b main https://github.com/EdgeTX/edgetx.git edgetx
```
This gets the latest development code on the `main` branch. If you want to build a specific release series instead, use its branch name in place of `main` here and in the update commands below, e.g. `-b 2.12`.
Keep the repository in the WSL file system (e.g. `~/edgetx`) rather than on a Windows drive under `/mnt/c/...`, as builds are much slower when working across the Windows/WSL boundary. You can still browse the files from Windows at `\\wsl$\Ubuntu\home\<your user name>\edgetx`, or by running `explorer.exe .` from the repository folder.
If you already have a local copy, update it to the latest version of the branch you are building, including the submodules:
```bash
cd ~/edgetx
git checkout main
git pull
git submodule update --init --recursive
```
## Run build (example TX16s)
## Start the build container
- open a PowerShell
- cd to your local repository
```
docker run --name="ETXDocker" -it --rm --mount src="$(pwd)",target="/src",type=bind ghcr.io/edgetx/edgetx-dev bash
cd src
mkdir -p build-output
cd build-output
cmake -DPCB=X10 -DPCBREV=TX16S -DCMAKE_BUILD_TYPE=Release ../
make configure
make -C arm-none-eabi -j$(nproc) firmware
make -C native -j$(nproc) libsimulator
make -C native -j$(nproc) companion210
make -C native -j$(nproc) simulator210
```
- find the results in folder build-output of your local build repository folder
Start the EdgeTX build container from your local repository, using the command for the container runtime you installed:
# More Cmake build options
=== "Docker Engine (WSL)"
X9d+:
```
-DPCB=X9D+ -DCMAKE_BUILD_TYPE=Release
In the Ubuntu terminal:
```bash
cd ~/edgetx
docker run --name="ETXDocker" -it --rm \
--mount src="$(pwd)",target="/src",type=bind \
-w /src \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
-v /mnt/wslg:/mnt/wslg \
-e DISPLAY=:0 \
-e WAYLAND_DISPLAY=wayland-0 \
-e XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir \
-e PULSE_SERVER=/mnt/wslg/PulseServer \
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
ghcr.io/edgetx/edgetx-dev bash
```
=== "Docker Desktop"
In PowerShell, from your local repository folder:
```powershell
docker run --name="ETXDocker" -it --rm `
--mount src="$(pwd)",target="/src",type=bind `
-w /src `
-v /run/desktop/mnt/host/wslg/.X11-unix:/tmp/.X11-unix `
-v /run/desktop/mnt/host/wslg:/mnt/wslg `
-e DISPLAY=:0 `
-e WAYLAND_DISPLAY=wayland-0 `
-e XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir `
-e PULSE_SERVER=/mnt/wslg/PulseServer `
-e CMAKE_BUILD_PARALLEL_LEVEL=$env:NUMBER_OF_PROCESSORS `
ghcr.io/edgetx/edgetx-dev bash
```
=== "Podman Desktop"
In PowerShell, from your local repository folder:
```powershell
podman run --name="ETXDocker" -it --rm `
--mount src="$(pwd)",target="/src",type=bind `
-w /src `
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix `
-v /mnt/wslg:/mnt/wslg `
-e DISPLAY=:0 `
-e WAYLAND_DISPLAY=wayland-0 `
-e XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir `
-e PULSE_SERVER=/mnt/wslg/PulseServer `
-e CMAKE_BUILD_PARALLEL_LEVEL=$env:NUMBER_OF_PROCESSORS `
ghcr.io/edgetx/edgetx-dev bash
```
You should now be in a shell inside the container, with a prompt that looks a little like `root@8c2f137e0944:/src#`. Your local repository is available in the container at `/src` (set by the `--mount` option), and the shell starts in that folder (set by `-w /src`).
The `-v` options and the `DISPLAY`, `WAYLAND_DISPLAY`, `XDG_RUNTIME_DIR` and `PULSE_SERVER` settings give the container access to WSLg, so that Companion and Simulator can open windows on your Windows desktop and play sound.
`CMAKE_BUILD_PARALLEL_LEVEL` sets how many compile jobs run at once to the number of CPU cores on your system. This speeds up builds, and also stops the `--parallel` build commands used in this guide from starting an unlimited number of jobs, which can use up all available memory and cause the build, or even the whole system, to lock up.
!!! tip "Only building firmware?"
If you don't need to run Companion or Simulator, you can leave out the WSLg options:
```bash
docker run --name="ETXDocker" -it --rm --mount src="$(pwd)",target="/src",type=bind -w /src -e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) ghcr.io/edgetx/edgetx-dev bash
```
If you are using Docker Desktop or Podman Desktop, use `podman` instead of `docker` for Podman, and `$env:NUMBER_OF_PROCESSORS` instead of `$(nproc)` in PowerShell.
!!! note "Building an older release?"
The commands above use the latest build container image, which matches the `main` branch. If you are building a release branch, use the image tag for that release by adding it to the end of the image name, e.g. `ghcr.io/edgetx/edgetx-dev:2.12` or `ghcr.io/edgetx/edgetx-dev:2.11` (for 2.10, use `:2.10.0`). Older releases need older build tools (e.g. EdgeTX 2.10 and 2.11 use Qt 5), so they may not build with the latest image.
!!! tip "Start the container with a single command"
To avoid typing the full `docker run` command each time, you can add it to your Ubuntu shell as a command called `etx-docker`. Run this once in the Ubuntu terminal:
```bash
cat >> ~/.bashrc << 'EOF'
# Start the EdgeTX build container in the current folder
# Usage: etx-docker [image tag], e.g. etx-docker or etx-docker 2.12
etx-docker() {
docker run --name="ETXDocker" -it --rm \
--mount src="$(pwd)",target="/src",type=bind \
-w /src \
-v /mnt/wslg/.X11-unix:/tmp/.X11-unix \
-v /mnt/wslg:/mnt/wslg \
-e DISPLAY=:0 \
-e WAYLAND_DISPLAY=wayland-0 \
-e XDG_RUNTIME_DIR=/mnt/wslg/runtime-dir \
-e PULSE_SERVER=/mnt/wslg/PulseServer \
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
ghcr.io/edgetx/edgetx-dev:"${1:-latest}" bash
}
EOF
source ~/.bashrc
```
From then on, start the container with:
```bash
cd ~/edgetx
etx-docker
```
To use the image for an older release, add its tag, e.g. `etx-docker 2.12`.
## Building the firmware
Building the firmware is done in two steps: first you **configure** the build, choosing which radio to build for and any build options, then you **build** it.
Run the following commands in the container, from the `/src` folder it starts in.
### Configure
To configure the build, you need to at least specify the radio target, and can also select or de-select a number of build-time options. A full list of available options is documented on the [Compilation Options](compilation-options.md) page.
As an example, to configure a build for the RadioMaster TX16S in the `build-output` folder:
```bash
cmake --fresh -S . -B build-output -Wno-dev -DPCB=X10 -DPCBREV=TX16S -DCMAKE_BUILD_TYPE=Release
```
X7:
```
-DPCB=X7 -DCMAKE_BUILD_TYPE=Release
```
TX12:
```
-DPCB=X7 -DPCBREV=TX12 -DCMAKE_BUILD_TYPE=Release
If you want to include the debug symbols, use `-DCMAKE_BUILD_TYPE=Debug` instead.
To build for other radios, you just need to specify the appropriate values for `PCB` and `PCBREV` for your radio. It is best to use a different build folder for each radio.
!!! tip "Which `PCB` and `PCBREV` values should I use?"
[`tools/build-common.sh`](https://github.com/EdgeTX/edgetx/blob/main/tools/build-common.sh) lists the CMake options for every supported radio. Search it for your radio's name (e.g. `tx16s`) to find the matching `-DPCB` and `-DPCBREV` values.
Alternatively, the repository includes CMake presets for all supported radios, so you can configure with just the radio name, e.g. `cmake --preset tx16s`. Run `cmake --list-presets` to see them all, and see [Building EdgeTX](index.md#quick-start-with-cmake-presets) for more details.
### Build firmware
To build the firmware, issue:
```bash
cmake --build build-output --target firmware --parallel
```
TX16S:
This process can take some minutes to complete.
If successful, you should find a firmware binary _firmware.bin_ in the `build-output/arm-none-eabi` folder, that you can flash onto your radio.
!!! note "UF2 firmware"
Some newer radios, such as those based on the STM32H7 (e.g. RadioMaster TX16S MK3, TX15 and GX15, and Jumper T15 Pro), also produce a _firmware.uf2_ file in the same folder. For these radios, use the `.uf2` file instead of the `.bin` file.
It's a good idea to rename the firmware file, so that it is easier later to see the target radio and which options were baked into it. For this, issue e.g.:
```bash
mv build-output/arm-none-eabi/firmware.bin build-output/edgetx_main_tx16s_mode2_release.bin
```
-DPCB=X10 -DPCBREV=TX16S -DCMAKE_BUILD_TYPE=Release
(use `firmware.uf2` and a `.uf2` extension instead if your radio uses UF2 firmware)
The firmware is now built and in your local repository under `build-output`. From Windows, you can find it at `\\wsl$\Ubuntu\home\<your user name>\edgetx\build-output`.
!!! tip "Listing all build options"
Once the firmware has been built, you can save a list of all the build options available for your radio, and their current values, to a text file in your repository:
```bash
cmake -LAH -N build-output/arm-none-eabi > edgetx-cmake-options.txt
```
### Flashing the firmware to your radio
Before flashing, make sure your radio's SD card has the matching SD card content. See the [EdgeTX SD card repository](https://github.com/EdgeTX/edgetx-sdcard) for which zip file your radio needs, and download it from the [latest release](https://github.com/EdgeTX/edgetx-sdcard/releases/tag/latest).
You can use [EdgeTX Buddy](https://buddy.edgetx.org/), [EdgeTX Companion](https://edgetx.org/getedgetx/), or [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html) to flash the firmware to your radio. For step-by-step instructions, see [Installing and Updating EdgeTX](https://manual.edgetx.org/installing-and-updating-edgetx) in the EdgeTX manual. STM32H7-based radios (those using `.uf2` firmware) have their own [update process](https://manual.edgetx.org/installing-and-updating-edgetx/updating-your-stm32h7-radio).
## Build Companion and Simulator
### EdgeTX 3.0 and later (`main` branch)
You can build the radio simulator library, Companion and Simulator all in one step:
```bash
cmake --build build-output --parallel --target wasi-module --target companion --target simulator
```
# Running Linux Companion and Simulator
## Running Companion
- make sure GWSL is running
- open a PowerShell
- in case you don't know your IP address enter 'ipconfig' to find out
- cd to your build folder
- remember to replace IP_OF_YOUR_WINDOWS_MACHINE with your IP address and enter:
```
docker run --name="ETXDocker" -it --rm --mount src="$(pwd)",target="/src",type=bind ghcr.io/edgetx/edgetx-dev bash
export DISPLAY=IP_OF_YOUR_WINDOWS_MACHINE:0.0
cd src
./native/companion210
This will configure and download extra dependencies as needed. Alternately, if you only want to build the simulator module at this point, you can run:
```bash
cmake --build build-output --parallel --target wasi-module
```
## Running Simulator
- make sure GWSL is running
- open a PowerShell
- in case you don't know your IP address enter `ipconfig` to find out
- `cd` to your build folder
- remember to replace IP_OF_YOUR_WINDOWS_MACHINE with your IP address and enter:
```
docker run --name="ETXDocker" -it --rm --mount src="$(pwd)",target="/src",type=bind ghcr.io/edgetx/edgetx-dev bash
export DISPLAY=IP_OF_YOUR_WINDOWS_MACHINE:0.0
cd src
./native/simulator210
The WASM simulator module is built into `build-output/wasm/wasm-build/` but Companion looks for it in `build-output/native/`. Copy it across before launching Companion or Simulator:
```bash
cp /src/build-output/wasm/wasm-build/*.wasm /src/build-output/native/
```
# Needful things
If you want to build simulator modules for multiple radio targets (so they are all available in Companion), the helper script `tools/build-wasm-modules.sh` can build all supported targets in one go:
```bash
tools/build-wasm-modules.sh . wasm-modules
```
- Should you get a message like ```container name "/ETXDocker" is already in use``` open a PowerShell and enter ```docker stop ETXDocker```
- If you need to update the docker image open a PowerShell and enter: ``` docker rmi ghcr.io/edgetx/edgetx-dev```. The latest image will then be downloaded at next docker run
- before running the simulator you need to run companion and create a radio profile
- companion and simulator won't have audio. If you need audio you might find [PulseAudio on WSL2](https://www.linuxuprising.com/2021/03/how-to-get-sound-pulseaudio-to-work-on.html) useful
To build only some radios, list them in the `FLAVOR` environment variable, separated by semicolons. The quotes are required. The radio names are the same ones used in `tools/build-common.sh`:
```bash
FLAVOR="tx16s;tx16smk3;gx12" tools/build-wasm-modules.sh . wasm-modules
```
# References
The script's two arguments are the source folder (`.` for the current folder) and the folder to put the `.wasm` files in.
see [EdgeTX Build repository](https://github.com/EdgeTX/build-edgetx)
Copy the `.wasm` files to `build-output/native/` before launching Companion:
```bash
cp /src/wasm-modules/*.wasm /src/build-output/native/
```
### Legacy: EdgeTX 2.10 to 2.12
In EdgeTX 2.10 to 2.12, each radio you want to use in Companion and Simulator needs its own radio simulator library (`libsimulator`). Companion only includes the radios whose simulator libraries were already built when Companion itself was built, so always build the simulator libraries **first**, then Companion and Simulator.
#### Single radio
For a single radio, configure the build for that radio as described in [Configure](#configure), then build the simulator library, Companion and Simulator in one step:
```bash
cmake --build build-output --parallel --target libsimulator --target companion --target simulator
```
#### Multiple radios
To include more than one radio, configure and build the simulator library for each radio in turn, using the same build folder, and then build Companion and Simulator once at the end. For example, for the Jumper T20 and T15:
```bash
# Jumper T20
rm -f build-output/native/CMakeCache.txt
cmake --fresh -S . -B build-output -Wno-dev -DPCB=X7 -DPCBREV=T20 -DCMAKE_BUILD_TYPE=Release
cmake --build build-output --parallel --target libsimulator
# Jumper T15
rm -f build-output/native/CMakeCache.txt
cmake --fresh -S . -B build-output -Wno-dev -DPCB=X10 -DPCBREV=T15 -DCMAKE_BUILD_TYPE=Release
cmake --build build-output --parallel --target libsimulator
# Companion and Simulator, including both radios
cmake --build build-output --parallel --target companion --target simulator
```
Removing `build-output/native/CMakeCache.txt` before each configure makes sure no build options are carried over from the previous radio. The simulator libraries already built are kept, so each radio adds to the list.
!!! note "Adding radios later"
Companion only picks up the list of radios when it is first built. If you have already built Companion and want to add another radio, build its simulator library as above, then delete `build-output/native/companion/src/hwdefs.qrc` before building Companion and Simulator again. Alternatively, start again with a new build folder.
## Launching Companion
In the container, change into the `native` directory and run Companion, where `<ver>` is the EdgeTX version as digits (e.g. `30` for 3.0, or `212` for 2.12):
```bash
cd /src/build-output/native
./companion<ver>
```
The Companion window will open on your Windows desktop via WSLg. Before running the simulator, create a radio profile in Companion for the radio you want to simulate.
!!! tip "Keep your Companion settings between sessions"
Companion saves its settings, including your radio profiles, in `/root/.config/EdgeTX` inside the container, which is deleted when the container exits. To keep them, create a folder for them in the Ubuntu terminal:
```bash
mkdir -p ~/.config/EdgeTX-docker
```
and add this line to the `docker run` command (before the image name):
```bash
-v ~/.config/EdgeTX-docker:/root/.config/EdgeTX \
```
In PowerShell (Docker Desktop or Podman Desktop), run `mkdir "$env:APPDATA\EdgeTX-docker"` once, and add `` -v "$env:APPDATA\EdgeTX-docker:/root/.config/EdgeTX" ` `` instead.
## Launching the Simulator
The simulator needs the SD card content for your radio. Download the matching zip from [EdgeTX SD card releases](https://github.com/EdgeTX/edgetx-sdcard/releases/tag/latest) and extract it into your local repository, e.g. to `~/edgetx/simu_sdcard/horus` in the Ubuntu terminal. Inside the container, this is `/src/simu_sdcard/horus`.
!!! note
Keep the SD card content inside your local repository. The container's own file system (including its home directory `~`) is deleted each time the container exits.
From the same `native` directory, run:
```bash
./simulator<ver>
```
In the dialog that pops up, select _SD Path_ as data source and under _SD Image Path:_ browse to `/src/simu_sdcard/horus`.
[![EdgeTX simulator on Linux](../assets/images/build/linux/EdgeTX_simulator_Linux.png)](../assets/images/build/linux/EdgeTX_simulator_Linux.png)
## Running Companion or the Simulator again later
You don't need to rebuild each time. Start the container as described in [Start the build container](#start-the-build-container), then launch Companion or the Simulator as above.
## Troubleshooting
- Should you get a message like `container name "/ETXDocker" is already in use`, open another Ubuntu terminal and enter `docker stop ETXDocker`
- If the build fails after updating your repository, or the build tools seem out of date, update the build container image by opening an Ubuntu terminal and entering `docker pull ghcr.io/edgetx/edgetx-dev`
- If builds fail with errors about running out of memory (e.g. `Killed` or `internal compiler error`), or the build or your PC locks up, reduce the number of compile jobs. By default, WSL can only use half of your PC's memory, which may not be enough to run one job per CPU core. In the container, run e.g. `export CMAKE_BUILD_PARALLEL_LEVEL=4` before building, and try a lower number if it still fails.
- If Companion or Simulator fail with an error like `could not connect to display`, check that WSLg is working by running `wsl --update` and then `wsl --shutdown` from a Windows Command Prompt, re-opening Ubuntu, and making sure you started the container with the WSLg `-v` and `-e` options shown above.
## Alternative: Docker Desktop or Podman Desktop
Instead of installing Docker Engine inside WSL, you can use a Windows desktop application to run the container. Either of the following will work:
- [Docker Desktop for Windows](https://www.docker.com/products/docker-desktop/) (free for personal use, education and small businesses; check the license terms if using it at work)
- [Podman Desktop](https://podman-desktop.io/) (free and open source)
Both use WSL 2 under the hood, and the installer will normally enable it for you. With these, the steps above change as follows:
- Commands are run from PowerShell instead of the Ubuntu terminal. Tip: Shift + right-click in a folder in File Explorer to get an "Open PowerShell window here" option in the context menu.
- Install [Git for Windows](https://git-scm.com/install/windows) (or run `winget install --id Git.Git --source winget`), and clone the repository to a folder on your Windows drive.
- Your repository, build output and firmware files are in that Windows folder, so you can ignore the `\\wsl$\Ubuntu\...` paths mentioned above. The SD card content for the simulator also goes in that folder, and is still available at `/src/...` inside the container.
- If you are using Podman, replace `docker` with `podman` in each command.
- To start the container, use the **Docker Desktop** or **Podman Desktop** tab in [Start the build container](#start-the-build-container).
- If you cannot use WSLg (e.g. an older Windows 10 build), you can use an X server such as [GWSL](https://github.com/Opticos/GWSL-Source/releases/) instead. Install and run it, disable access control during its setup, then leave out the WSLg `-v` and `-e` options when starting the container, and in the container run `export DISPLAY=<your Windows IP address>:0.0` (find your IP with `ipconfig`) before launching Companion or Simulator. Audio will not work in this setup.
## References
- [Building EdgeTX](index.md): overview of building EdgeTX on all platforms, including CMake presets and build options
- [EdgeTX build-edgetx repository](https://github.com/EdgeTX/build-edgetx): source of the `edgetx-dev` build container image used in this guide
*[WASM]: WebAssembly
*[WSL]: Windows Subsystem for Linux
*[WSLg]: Windows Subsystem for Linux GUI
*[UF2]: USB Flashing Format
+1
View File
@@ -33,6 +33,7 @@ theme:
- content.action.edit
markdown_extensions:
- abbr
- admonition
- pymdownx.details
- pymdownx.superfences
+1
View File
@@ -154,6 +154,7 @@ AddHWGenTarget(${HW_DESC_JSON} simu_keys simu_keys.inc)
AddHWGenTarget(${HW_DESC_JSON} simu_switches simu_switches.inc)
AddHWGenTarget(${HW_DESC_JSON} hal_keys_lock hal_keys_lock.h)
AddHWGenTarget(${HW_DESC_JSON} hal_usb_descriptor usb_descriptor.h)
add_dependencies(board hal_settings hal_pwm_sticks hal_keys hal_keys_lock hal_adc_inputs stm32_keys stm32_switches stm32_adc_inputs stm32_pwm_inputs yaml_inputs lua_inputs lua_mixsrc lua_keys)
add_dependencies(board_bl hal_settings hal_pwm_sticks hal_keys stm32_keys)
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "Boxer",
"usb_manufacturer": "RM_TX",
"usb_product": "RM Boxer"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "Bumblebee",
"usb_manufacturer": "JUMPER",
"usb_product": "Bumblebe"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "iFlight",
"model": "Commando 14",
"usb_manufacturer": "iFlight",
"usb_product": "C14"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "iFlight",
"model": "Commando 8",
"usb_manufacturer": "iFlight",
"usb_product": "C8"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "EL18",
"usb_manufacturer": "Flysky",
"usb_product": "EL18"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Fatfish",
"model": "F16",
"usb_manufacturer": "FATFISH",
"usb_product": "FF F16"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "GX12",
"usb_manufacturer": "RM_TX",
"usb_product": "RM GX12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "GX15",
"usb_manufacturer": "RM",
"usb_product": "GX15"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Senduwing",
"model": "H17",
"usb_manufacturer": "SEND",
"usb_product": "H17"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "BETAFPV",
"model": "LR3PRO",
"usb_manufacturer": "BETAFPV",
"usb_product": "LR3PRO"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "MT12",
"usb_manufacturer": "RM_TX",
"usb_product": "RM MT12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "NB4+",
"usb_manufacturer": "FlySky",
"usb_product": "NB4+"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "NV14",
"usb_manufacturer": "Flysky",
"usb_product": "NV14"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "PA01",
"usb_manufacturer": "FlySky",
"usb_product": "PA01"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "PL18",
"usb_manufacturer": "FlySky",
"usb_product": "PL18"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "PL18EV",
"usb_manufacturer": "FlySky",
"usb_product": "PL18EV"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "PL18U",
"usb_manufacturer": "FlySky",
"usb_product": "PL18U"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "Pocket",
"usb_manufacturer": "RM_TX",
"usb_product": "RMPocket"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Flysky",
"model": "ST16",
"usb_manufacturer": "FlySky",
"usb_product": "ST16"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T12",
"usb_manufacturer": "JUMPER",
"usb_product": "T12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T12 MAX",
"usb_manufacturer": "JUMPER",
"usb_product": "T12 MAX"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T14",
"usb_manufacturer": "JUMPER",
"usb_product": "T14"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T15",
"usb_manufacturer": "Jumper",
"usb_product": "T15"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T15 Pro",
"usb_manufacturer": "JUMPER",
"usb_product": "T15 PRO"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T16",
"usb_manufacturer": "Jumper",
"usb_product": "T16"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T18",
"usb_manufacturer": "Jumper",
"usb_product": "T18"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T20",
"usb_manufacturer": "JUMPER",
"usb_product": "T20"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T20 V2",
"usb_manufacturer": "JUMPER",
"usb_product": "T20V2"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T22",
"usb_manufacturer": "JUMPER",
"usb_product": "T22"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "T8",
"usb_manufacturer": "RM_TX",
"usb_product": "RM T8"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T-Lite",
"usb_manufacturer": "JUMPER",
"usb_product": "T-Lite"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T-Pro",
"usb_manufacturer": "JUMPER",
"usb_product": "T-Pro"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T-Pro S",
"usb_manufacturer": "JUMPER",
"usb_product": "T-Pro S"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "Jumper",
"model": "T-Pro V2",
"usb_manufacturer": "JUMPER",
"usb_product": "T-Pro V2"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "TX12",
"usb_manufacturer": "RM_TX",
"usb_product": "RM TX12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "TX12 Mark II",
"usb_manufacturer": "RM_TX",
"usb_product": "RM TX12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "TX15",
"usb_manufacturer": "RM",
"usb_product": "TX15"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "TX16S",
"usb_manufacturer": "RM_TX",
"usb_product": "RM TX16S"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "TX16S MK3",
"usb_manufacturer": "RM",
"usb_product": "TX16SMK3"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "HelloRadioSky",
"model": "V12",
"usb_manufacturer": "HRSky",
"usb_product": "V12"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "HelloRadioSky",
"model": "V14",
"usb_manufacturer": "HRSky",
"usb_product": "V14"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "HelloRadioSky",
"model": "V14LCD",
"usb_manufacturer": "HRSky",
"usb_product": "V14LCD"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "HelloRadioSky",
"model": "V16",
"usb_manufacturer": "HRSky",
"usb_product": "V16"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X10/X10S",
"usb_manufacturer": "FrSky",
"usb_product": "X10"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X10/X10S Express",
"usb_manufacturer": "FrSky",
"usb_product": "X10"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X12S",
"usb_manufacturer": "FrSky",
"usb_product": "Horus"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X7/X7S",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X7/X7S Access",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9D+",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9D+ 2019",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9D",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9E",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9-Lite",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X9-Lite S",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X-Lite",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "FrSky",
"model": "X-Lite S/PRO",
"usb_manufacturer": "FrSky",
"usb_product": "Taranis"
},
"adc_inputs": {
"adcs": [
{
+6
View File
@@ -1,4 +1,10 @@
{
"identity": {
"manufacturer": "RadioMaster",
"model": "Zorro",
"usb_manufacturer": "RM_TX",
"usb_product": "Zorro"
},
"adc_inputs": {
"adcs": [
{
+1
View File
@@ -259,6 +259,7 @@ enum UartModes {
UART_MODE_DEBUG,
UART_MODE_SPACEMOUSE,
UART_MODE_EXT_MODULE,
UART_MODE_GROUND_STATION,
UART_MODE_COUNT SKIP,
UART_MODE_MAX SKIP = UART_MODE_COUNT-1
};
+3 -1
View File
@@ -194,6 +194,8 @@ static uint16_t s_i2c_addr;
#define LSM6DSLTR_ID 0x6A
#define LSM6DS33TR_ID 0x69
#define LSM6DSO_ID 0x6C
static const char configure[][2] = {
// ODR = 1000 (1.66 kHz (high performance)); FS_XL = 00 (+/-2 g full scale)
@@ -249,7 +251,7 @@ static int lsm6dsInit(etx_i2c_bus_t bus, uint16_t addr)
// LSM6DS33TR works with LSM6DSLTR code for our use
int id = read_reg(LSM6DS_WHO_AM_I);
if (id != LSM6DSLTR_ID && id != LSM6DS33TR_ID)
if (id != LSM6DSLTR_ID && id != LSM6DS33TR_ID && id != LSM6DSO_ID)
return -1;
for (uint8_t i = 0; i < DIM(configure); i++) {
+77
View File
@@ -0,0 +1,77 @@
#include "edgetx.h"
#include "groundstation.h"
#include "os/timer.h"
#include "tasks/mixer_task.h"
namespace {
constexpr uint8_t kMagic0 = 'G';
constexpr uint8_t kMagic1 = 'S';
constexpr uint8_t kVersion = 1;
constexpr uint8_t kTypeRCChannels = 1;
constexpr uint8_t kChannels = 16;
constexpr uint8_t kFrameSize = 10 + kChannels * 2 + 2;
constexpr uint32_t kPeriodMs = 40; // 25 Hz
const etx_serial_driver_t *driver = nullptr;
void *driverCtx = nullptr;
timer_handle_t timer = TIMER_INITIALIZER;
uint16_t sequence = 0;
uint16_t crc16(const uint8_t *data, size_t size)
{
uint16_t crc = 0xffff;
for (size_t i = 0; i < size; ++i) {
crc ^= uint16_t(data[i]) << 8;
for (uint8_t bit = 0; bit < 8; ++bit)
crc = (crc & 0x8000) ? uint16_t((crc << 1) ^ 0x1021) : uint16_t(crc << 1);
}
return crc;
}
void sendRCFrame()
{
if (!driver || !driver->sendByte || !mixerTaskRunning()) return;
uint8_t frame[kFrameSize] = { kMagic0, kMagic1, kVersion, kTypeRCChannels };
frame[4] = sequence & 0xff;
frame[5] = sequence >> 8;
const uint32_t timestamp = get_tmr10ms() * 10;
frame[6] = timestamp & 0xff;
frame[7] = (timestamp >> 8) & 0xff;
frame[8] = (timestamp >> 16) & 0xff;
frame[9] = (timestamp >> 24) & 0xff;
for (uint8_t i = 0; i < kChannels; ++i) {
const uint16_t value = channelOutputs[i];
frame[10 + i * 2] = value & 0xff;
frame[11 + i * 2] = value >> 8;
}
const uint16_t crc = crc16(frame, kFrameSize - 2);
frame[kFrameSize - 2] = crc & 0xff;
frame[kFrameSize - 1] = crc >> 8;
for (uint8_t byte : frame) driver->sendByte(driverCtx, byte);
++sequence;
}
void timerCb(timer_handle_t *)
{
// Drain input now so the future profile-control parser has a single owner.
// The baseline intentionally does not act on received bytes yet.
if (driver && driver->getByte) {
uint8_t ignored;
while (driver->getByte(driverCtx, &ignored)) {}
}
sendRCFrame();
}
} // namespace
void groundstationSetSerialDriver(void *ctx, const etx_serial_driver_t *drv)
{
driverCtx = ctx;
driver = drv;
sequence = 0;
if (!timer_is_created(&timer))
timer_create(&timer, timerCb, "gstation", kPeriodMs, true);
timer_start(&timer);
}
+6
View File
@@ -0,0 +1,6 @@
#pragma once
#include <stdint.h>
#include "hal/serial_port.h"
void groundstationSetSerialDriver(void *ctx, const etx_serial_driver_t *drv);
@@ -218,6 +218,20 @@ void InputMixButtonBase::updateHeight()
#endif
}
void InputMixButtonBase::swapLvglGroup(InputMixButtonBase* swapWith)
{
// Swap elements (focus + line list)
lv_obj_t* obj1 = getLvObj();
lv_obj_t* obj2 = swapWith->getLvObj();
if (lv_obj_get_parent(obj1) == lv_obj_get_parent(obj2)) {
// same input group: swap obj + focus group
lv_obj_swap(obj1, obj2);
} else {
// different input group: swap only focus group
lv_group_swap_obj(obj1, obj2);
}
}
static void group_constructor(const lv_obj_class_t* class_p, lv_obj_t* obj)
{
etx_std_style(obj, LV_PART_MAIN, PAD_TINY);
@@ -58,7 +58,7 @@ class InputMixButtonBase : public ListLineButton
void updateHeight();
virtual void updatePos(coord_t x, coord_t y) = 0;
virtual void swapLvglGroup(InputMixButtonBase* line2) = 0;
void swapLvglGroup(InputMixButtonBase* swapWith);
void checkEvents() override;
@@ -59,6 +59,10 @@ MenuToolbarButton::MenuToolbarButton(Window* parent, const rect_t& rect,
auto label = etx_label_create(lvobj);
lv_label_set_text(label, picto);
lv_obj_center(label);
onClosing([=]() {
lv_group_remove_obj(lvobj);
});
}
MenuToolbar::MenuToolbar(Choice* choice, Menu* menu, const int columns) :
+7 -4
View File
@@ -193,10 +193,13 @@ void StaticIcon::setColor(LcdColorIndex color)
void StaticIcon::setIcon(EdgeTxIcon icon)
{
auto newMask = getBuiltinIcon(icon);
setSize(newMask->width, newMask->height);
lv_canvas_set_buffer(lvobj, (void*)newMask->data, newMask->width, newMask->height,
LV_IMG_CF_ALPHA_8BIT);
if (currentIcon != icon) {
currentIcon = icon;
auto newMask = getBuiltinIcon(icon);
setSize(newMask->width, newMask->height);
lv_canvas_set_buffer(lvobj, (void*)newMask->data, newMask->width, newMask->height,
LV_IMG_CF_ALPHA_8BIT);
}
}
void StaticIcon::center(coord_t w, coord_t h)
+1
View File
@@ -136,6 +136,7 @@ class StaticIcon : public Window
protected:
LcdColorIndex currentColor;
EdgeTxIcon currentIcon = EDGETX_ICONS_COUNT;
MaskBitmap* mask = nullptr;
};
@@ -166,22 +166,6 @@ class InputLineButton : public InputMixButtonBase
setPos(x, y);
}
void swapLvglGroup(InputMixButtonBase* line2) override
{
InputLineButton* swapWith = (InputLineButton*)line2;
// Swap elements (focus + line list)
lv_obj_t* obj1 = getLvObj();
lv_obj_t* obj2 = swapWith->getLvObj();
if (lv_obj_get_parent(obj1) == lv_obj_get_parent(obj2)) {
// same input group: swap obj + focus group
lv_obj_swap(obj1, obj2);
} else {
// different input group: swap only focus group
lv_group_swap_obj(obj1, obj2);
}
}
bool isActive() const override { return isExpoActive(index); }
protected:
+13 -79
View File
@@ -33,65 +33,25 @@
#define SET_DIRTY() storageDirty(EE_MODEL)
class MPlexIcon : public Window
{
public:
MPlexIcon(Window* parent, uint8_t index) :
Window(parent, {0, 0, MPLEX_ICON_W, MPLEX_ICON_H}),
index(index)
{
}
void refresh()
{
MixData* mix = mixAddress(index);
EdgeTxIcon n = ICON_MPLEX_ADD;
if (mix->mltpx == MLTPX_MUL) {
n = ICON_MPLEX_MULTIPLY;
} else if (mix->mltpx == MLTPX_REPL) {
n = ICON_MPLEX_REPLACE;
}
if (!icon) {
icon = new StaticIcon(this, 0, 0, n, COLOR_THEME_SECONDARY1_INDEX);
icon->center(width(), height());
}
icon->show(lv_obj_get_index(lvobj) != 0);
icon->setIcon(n);
}
void setIndex(uint8_t i)
{
index = i;
}
static LAYOUT_VAL_SCALED(MPLEX_ICON_W, 25)
static LAYOUT_VAL_SCALED(MPLEX_ICON_H, 29)
protected:
uint8_t index;
StaticIcon* icon = nullptr;
};
class MixLineButton : public InputMixButtonBase
{
public:
MixLineButton(Window* parent, uint8_t index) :
InputMixButtonBase(parent, index)
{
mplex = new MPlexIcon(parent, index);
// mplex is a sibling (not a child) so must be closed explicitly
onClosing([=]() {
mplex->closeWindow();
});
// Allow multiplex icon to render outside this window
lv_obj_add_flag(lvobj, LV_OBJ_FLAG_OVERFLOW_VISIBLE);
delayLoad();
}
void delayedInit() override
{
// Add multiplex icon
mplex = new StaticIcon(this, 0, 0, ICON_MPLEX_ADD, COLOR_THEME_SECONDARY1_INDEX);
// Position multiplex icon to the left of the parent mix line
mplex->setPos(-mplex->width() - PAD_MEDIUM, PAD_SMALL);
refresh();
((InputMixGroupBase*)parent)->adjustHeight();
}
@@ -125,50 +85,24 @@ class MixLineButton : public InputMixButtonBase
setOpts(tmp_str);
mplex->refresh();
if (mplex)
mplex->setIcon((EdgeTxIcon)(ICON_MPLEX_ADD + line.mltpx));
setFlightModes(line.flightModes);
}
void setIndex(uint8_t i) override
{
ListLineButton::setIndex(i);
mplex->setIndex(i);
}
void updatePos(coord_t x, coord_t y) override
{
setPos(x, y);
mplex->setPos(x - MPLEX_XO, y);
mplex->show(y > ListLineButton::BTN_H);
}
lv_obj_t* mplexLvObj() const { return mplex->getLvObj(); }
void swapLvglGroup(InputMixButtonBase* line2) override
{
MixLineButton* swapWith = (MixLineButton*)line2;
// Swap elements (focus + line list)
lv_obj_t* obj1 = getLvObj();
lv_obj_t* obj2 = swapWith->getLvObj();
if (lv_obj_get_parent(obj1) == lv_obj_get_parent(obj2)) {
// same input group: swap obj + focus group
lv_obj_swap(obj1, obj2);
lv_obj_swap(mplexLvObj(), swapWith->mplexLvObj());
} else {
// different input group: swap only focus group
lv_group_swap_obj(obj1, obj2);
lv_group_swap_obj(mplexLvObj(), swapWith->mplexLvObj());
}
// Don't show multiplex icon for first line
if (mplex)
mplex->show(y > ListLineButton::BTN_H);
}
bool isActive() const override { return isMixActive(index); }
static LAYOUT_VAL_SCALED(MPLEX_XO, 28)
protected:
MPlexIcon* mplex = nullptr;
StaticIcon* mplex = nullptr;
};
class MixGroup : public InputMixGroupBase
@@ -844,7 +844,7 @@ void ModelLabelsWindow::buildBody(Window *window)
lblselector->setNames(labels);
updateFilteredLabels(modelCellManager.filteredLabels(), false);
}
});
}, labelExcludedChars);
return 0;
});
menu->addLine(STR_DELETE_LABEL, [=]() {
+854
View File
@@ -113,6 +113,19 @@ static int luaDestroyLvglWidget(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.set(parent, params)
Update the settings of an existing LVGL object. Can also be used to change settings that have no dedicated update function (e.g. rectangle thickness). Can also be called as `parent:set(params)`.
@param parent (object) LVGL object to update; unlike the constructor functions, this parameter is required, not optional
@param params (table) settings to update; use the same keys documented for the object's constructor function
@retval none
@status current Introduced in 2.11.0
*/
static int luaLvglSet(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -122,6 +135,20 @@ static int luaLvglSet(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.clear([parent])
Delete LVGL objects.
@param parent (object) optional LVGL object whose children should be deleted; if omitted, the entire script UI is deleted
@retval none
@notice If `parent` is not set, the entire script UI is deleted -- use this when the UI changes dramatically (e.g. widget size changes).
@notice If `parent` is set, only its child LVGL objects are deleted -- use this to remove and replace a specific set of objects.
@status current Introduced in 2.11.0
*/
static int luaLvglClear(lua_State *L)
{
if (luaScriptManager) {
@@ -138,6 +165,19 @@ static int luaLvglClear(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.show(parent)
Show an LVGL object.
@param parent (object) LVGL object to show
@retval none
@notice The `visible` setting function can also be used to dynamically show and hide objects.
@status current Introduced in 2.11.0
*/
static int luaLvglShow(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -147,6 +187,19 @@ static int luaLvglShow(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.hide(parent)
Hide an LVGL object.
@param parent (object) LVGL object to hide
@retval none
@notice The `visible` setting function can also be used to dynamically show and hide objects.
@status current Introduced in 2.11.0
*/
static int luaLvglHide(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -156,6 +209,17 @@ static int luaLvglHide(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.enable(obj)
Enable interaction for an LVGL control object.
@param obj (object) LVGL object previously created by the `lvgl` library
@retval none
@status current Introduced in 2.11.0
*/
static int luaLvglEnable(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -165,6 +229,17 @@ static int luaLvglEnable(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.disable(obj)
Disable interaction for an LVGL control object.
@param obj (object) LVGL object previously created by the `lvgl` library
@retval none
@status current Introduced in 2.11.0
*/
static int luaLvglDisable(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -174,6 +249,17 @@ static int luaLvglDisable(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.close(obj)
Close an LVGL object that represents a closable container or dialog.
@param obj (object) LVGL object previously created by the `lvgl` library
@retval none
@status current Introduced in 2.11.0
*/
static int luaLvglClose(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -364,6 +450,26 @@ static int luaLvglObjEx(lua_State *L, std::function<LvglWidgetObjectBase*()> cre
return 1;
}
/*luadoc
@function lvgl.build([parent, ]params)
Build a complex UI in a single operation from a table of object definitions.
@param parent (object) optional LVGL object to attach the built objects to; if omitted they attach to the top-level script window
@param params (table) a table of tables, each defining one LVGL object:
* `type` (string or type constant) mandatory, selects the kind of object to create, e.g. `"rectangle"` or `lvgl.RECTANGLE`; named type constants (e.g. `lvgl.RECTANGLE`) added in 2.11.4, string names work in all versions
* `name` (string) optional name used to look up this object in the returned table, defaults to an empty string
* `children` (table) optional nested table of the same shape, to create child objects
* any other key accepted by the constructor function for the chosen `type`
@retval table named LVGL objects (only entries whose definition included a `name` are included)
@notice Objects can be nested via `children`, another table of tables using the same shape as the top-level `params`.
@notice Very large or deeply nested tables may fail to compile to `.luac` -- if a script works from `.lua` but fails from `.luac`, split the call into multiple smaller `lvgl.build()` calls.
@status current Introduced in 2.11.0, named type constants added in 2.11.4
*/
static int luaLvglBuild(lua_State *L)
{
if (luaScriptManager) {
@@ -389,6 +495,15 @@ static int luaLvglBuild(lua_State *L)
return 1;
}
/*luadoc
@function lvgl.isAppMode()
Test if the script is running in App Mode.
@retval boolean true if running in App Mode, false otherwise
@status current Introduced in 2.11.0
*/
static int luaLvglIsAppMode(lua_State *L)
{
if (luaScriptManager) {
@@ -399,6 +514,17 @@ static int luaLvglIsAppMode(lua_State *L)
return 1;
}
/*luadoc
@function lvgl.isFullScreen()
Test if the script is running in full screen mode.
@retval boolean true if running in full screen mode, false otherwise
@notice Always returns true for stand alone tool scripts.
@status current Introduced in 2.11.0
*/
static int luaLvglIsFullscreen(lua_State *L)
{
if (luaScriptManager) {
@@ -409,6 +535,15 @@ static int luaLvglIsFullscreen(lua_State *L)
return 1;
}
/*luadoc
@function lvgl.exitFullScreen()
If the script is running in full screen mode, return it to normal mode.
@retval none
@status current Introduced in 2.11.0
*/
static int luaLvglExitFullscreen(lua_State *L)
{
if (luaScriptManager)
@@ -416,6 +551,15 @@ static int luaLvglExitFullscreen(lua_State *L)
return 0;
}
/*luadoc
@function lvgl.getContext()
For a widget script, returns the local instance table created by (and returned from) the script's `create()` function.
@retval table the widget instance's local data table, or nil for stand alone tool scripts
@status current Introduced in 2.11.0
*/
static int luaLvglGetContext(lua_State *L)
{
if (luaScriptManager && luaScriptManager->getContext() != LUA_REFNIL) {
@@ -427,6 +571,19 @@ static int luaLvglGetContext(lua_State *L)
return 1;
}
/*luadoc
@function lvgl.getScrollPos(parent)
Get the current scroll position of a container object.
@param parent (object) LVGL container object (e.g. `box`, `rectangle`, or `page`)
@retval number, number the X and Y scroll position of the container's top-left corner
@notice Only applies to container objects such as `box`, `rectangle`, and `page`.
@status current Introduced in 2.11.2
*/
static int luaLvglGetScrollPos(lua_State *L)
{
auto p = LvglWidgetObjectBase::checkLvgl(L, 1, true);
@@ -447,41 +604,738 @@ LROT_BEGIN(lvgllib, NULL, 0)
LROT_FUNCENTRY(isFullScreen, luaLvglIsFullscreen)
LROT_FUNCENTRY(exitFullScreen, luaLvglExitFullscreen)
LROT_FUNCENTRY(getContext, luaLvglGetContext)
/*luadoc
@common lvgl_object
* `x` (number) position relative to the top-left of the parent
* `y` (number) position relative to the top-left of the parent
* `w` (number) width
* `h` (number) height
* `color` (color or function) primary color for the object
* `pos` (function) dynamic position callback returning `x, y`
* `size` (function) dynamic size callback returning `w, h`
* `visible` (function) dynamic visibility callback
* `floating` (boolean) keep the object fixed inside a scrollable container, added in 2.11.6, defaults to false
*/
// Objects - widgets and standalone scripts
/*luadoc
@function lvgl.label([parent, ]params)
Display a text label.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `text` (string or function) text to display, defaults to an empty string
* `font` (font value or function) sets the font size, e.g. `MIDSIZE`, `DBLSIZE`; defaults to `STDSIZE`
* `align` (text alignment value or function) sets the text justification, e.g. `RIGHT`, `VCENTER`; defaults to `LEFT`. `RIGHT`/`CENTER` require `w` to be set. `LEFT`/`RIGHT`/`CENTER` align text horizontally within the label's bounding box `(x,y,w,h)`; `VCENTER`/`VTOP`/`VBOTTOM` align the label's bounding box vertically within the parent object
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(label, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetLabel(); }); })
/*luadoc
@function lvgl.rectangle([parent, ]params)
Display a rectangle. Based on `lvgl.box`, so all `lvgl.box` settings also apply.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `thickness` (number) width of the border line, defaults to 1
* `filled` (boolean or function) if true the rectangle is filled with `color`, defaults to false (function support added in 2.11.4)
* `rounded` (number) if greater than 0, rounds the corners with this radius; must be >= `thickness` if set, defaults to 0
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
@retval table LVGL object
@notice When used in a stand alone tool script, the rectangle automatically adds scroll bars if any child objects are placed outside its boundaries. For widgets, child objects outside the bounds are clipped instead.
@status current Introduced in 2.11.0, filled function support added in 2.11.4, floating added in 2.11.6
*/
LROT_FUNCENTRY(rectangle, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetRectangle(); }); })
/*luadoc
@function lvgl.hline([parent, ]params)
Display a horizontal line.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`w` sets the length of the line; `h` sets its thickness.
@param params (table):
@commonparams lvgl_object
* `rounded` (boolean) if true the line's end caps are rounded, defaults to false
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
* `dashGap` (number) gap size for dashed lines, defaults to 0
* `dashWidth` (number) dash size for dashed lines, defaults to 0; both `dashGap` and `dashWidth` must be > 0 to draw dashed lines
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(hline, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetHLine(); }); })
/*luadoc
@function lvgl.vline([parent, ]params)
Display a vertical line.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`h` sets the length of the line; `w` sets its thickness.
@param params (table):
@commonparams lvgl_object
* `rounded` (boolean) if true the line's end caps are rounded, defaults to false
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
* `dashGap` (number) gap size for dashed lines, defaults to 0
* `dashWidth` (number) dash size for dashed lines, defaults to 0; both `dashGap` and `dashWidth` must be > 0 to draw dashed lines
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(vline, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetVLine(); }); })
/*luadoc
@function lvgl.line([parent, ]params)
Display one or more connected line segments.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`x`, `y`, `w`, and `h` are not used.
@param params (table):
@commonparams lvgl_object
* `rounded` (boolean) if true the line's end caps are rounded, defaults to false
* `thickness` (number) thickness of each line segment, defaults to 1
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
* `pts` (table or function) table of points, each a `{x, y}` pair; at least two points are required, defaults to nil
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(line, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetLine(); }); })
/*luadoc
@function lvgl.triangle([parent, ]params)
Display a filled triangle.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`x`, `y`, `w`, and `h` are not used.
@param params (table):
@commonparams lvgl_object
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
* `pts` (table or function) table of exactly three points, each a `{x, y}` pair, defaults to nil
@retval table LVGL object
@notice Unlike the line-drawing objects, LVGL has no built-in triangle primitive. The drawing method used is simple and does not anti-alias.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(triangle, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetTriangle(); }); })
/*luadoc
@function lvgl.circle([parent, ]params)
Display a solid or outlined circle.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`w`, `h`, and `size` should not be used with `lvgl.circle` -- use `radius` instead.
@param params (table):
@commonparams lvgl_object
* `thickness` (number) width of the border line, defaults to 1
* `filled` (boolean) if true the circle is filled with `color`, defaults to false
* `radius` (number or function) radius of the circle, defaults to 0
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(circle, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetCircle(); }); })
/*luadoc
@function lvgl.arc([parent, ]params)
Display an arc.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`w`, `h`, and `size` should not be used with `lvgl.arc` -- use `radius` instead.
@param params (table):
@commonparams lvgl_object
* `thickness` (number) width of the arc's line, defaults to 1
* `radius` (number or function) radius of the arc, defaults to 0
* `startAngle` (number or function) starting angle in degrees (0-360), 0 is 3 o'clock, defaults to 0
* `endAngle` (number or function) ending angle in degrees, defaults to 360
* `opacity` (number or function) opacity from 0 (transparent) to 255 (opaque), defaults to 255
* `rounded` (boolean) if true the ends of the arc are rounded, defaults to false
* `bgColor` (color or function) color of the background arc, not used by default
* `bgOpacity` (number or function) opacity of the background arc, defaults to 0 (not visible)
* `bgStartAngle` (number or function) starting angle of the background arc in degrees, defaults to 0
* `bgEndAngle` (number or function) ending angle of the background arc in degrees, defaults to 360
@retval table LVGL object
@notice Arc objects have two elements, a foreground arc and a background arc. By default the background arc is not shown -- to show it, set both `bgColor` and `bgOpacity`.
@notice If `opacity` or `bgOpacity` is less than 255 and `rounded` is true, the ends of the arc will not draw correctly. This is an LVGL limitation.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(arc, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetArc(); }); })
/*luadoc
@function lvgl.image([parent, ]params)
Display an image, centered in the frame `(x, y, w, h)`. Images can be scaled to fit entirely within the frame or to fill it completely.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `file` (string) full path to the image file on the SD card, defaults to an empty string
* `fill` (boolean) if true the image is scaled to completely fill the frame (may be cropped); if false it is scaled to fit entirely within the frame (may have empty borders), defaults to false
@retval table LVGL object
@notice `w` and `h` are required.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(image, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetImage(); }); })
/*luadoc
@function lvgl.qrcode([parent, ]params)
Display a QR code.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`w` and `h` should be set to the same value for a QR code.
@param params (table):
@commonparams lvgl_object
* `data` (string) URL or other content to encode, defaults to an empty string
* `bgColor` (color) background color for the QR code image, defaults to `COLOR_THEME_SECONDARY3`
@retval table LVGL object
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(qrcode, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetQRCode(); }); })
// Objects - standalone scripts and full screen widgets only
/*luadoc
@function lvgl.button([parent, ]params)
Add a text button using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `text` (string or function) text displayed in the button, defaults to an empty string
* `press` (function) called when the user taps the button, after releasing ENTER or the screen; may optionally return a non-zero integer to display the button in the checked state, defaults to nil
* `longpress` (function) called on a long tap; may optionally return a non-zero integer to display the button in the checked state, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `checked` (boolean) sets the initial checked state; can be updated with `lvgl.set()`, defaults to false
* `color` (color or function) background color, defaults to the EdgeTX button style PRIMARY2 theme color
* `textColor` (color or function) text color, defaults to the EdgeTX button style SECONDARY1 theme color
* `cornerRadius` (number) radius for the button's corners, defaults to the EdgeTX button style radius
* `font` (font value or function) sets the font size, e.g. `MIDSIZE`, `DBLSIZE`; defaults to `STDSIZE`
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(button, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetTextButton(); }, true); })
/*luadoc
@function lvgl.momentaryButton([parent, ]params)
Add a momentary text button using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `text` (string or function) text displayed in the button, defaults to an empty string
* `press` (function) called immediately when the user first taps the button or presses ENTER, defaults to nil
* `release` (function) called when the user releases ENTER or stops touching the screen, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `color` (color or function) background color, defaults to the EdgeTX button style PRIMARY2 theme color
* `textColor` (color or function) text color, defaults to the EdgeTX button style SECONDARY1 theme color
* `cornerRadius` (number) radius for the button's corners, defaults to the EdgeTX button style radius
* `font` (font value or function) sets the font size, e.g. `MIDSIZE`, `DBLSIZE`; defaults to `STDSIZE`
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice Unlike `lvgl.button`, `press` fires immediately on tap/press rather than on release. The button shows the checked state until ENTER is released or the screen is no longer touched.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(momentaryButton, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetMomentaryButton(); }, true); })
/*luadoc
@function lvgl.toggle([parent, ]params)
Add a toggle switch using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called to get the current state; must return a boolean or number (0/false = off, 1/true = on), defaults to nil
* `set` (function) called when the user interacts with the switch; passed a single number, 0 = off, 1 = on, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(toggle, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetToggleSwitch(); }, true); })
/*luadoc
@function lvgl.textEdit([parent, ]params)
Add a text edit box using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `value` (string or function) text to edit; if a function, the text can be changed by both script and user, defaults to an empty string
* `length` (number) maximum editable text length, 1 to 128, defaults to 32
* `set` (function) called when the user edits the text; passed the new string content, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(textEdit, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetTextEdit(); }, true); })
/*luadoc
@function lvgl.numberEdit([parent, ]params)
Add a number edit box using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called to get the current value to display, defaults to nil
* `set` (function) called for every change to the number while editing; passed the new value, defaults to nil
* `edited` (function) called after the user finishes editing; passed the final value (added in 2.11.5), defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `min` (number) minimum allowed value, defaults to -1024
* `max` (number) maximum allowed value, defaults to 1024
* `display` (function) overrides how the value is displayed; passed the current value, must return a string, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice Use `set` to react to every change during editing, or `edited` to only react to the final value once editing is complete.
@status current Introduced in 2.11.0, edited added in 2.11.5, floating added in 2.11.6
*/
LROT_FUNCENTRY(numberEdit, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetNumberEdit(); }, true); })
/*luadoc
@function lvgl.choice([parent, ]params)
Display a button showing an option value. Tapping it opens a popup menu of options to choose from, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `title` (string) text displayed in the popup menu's header, defaults to an empty string
* `values` (table) simple table of option strings shown in the popup; can be changed via `lvgl.set()` since 2.11.6, defaults to an empty list
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the index of the currently selected option (1..number of values), defaults to nil
* `set` (function) called when the user taps a menu item; passed the selected item's index (1..number of values), defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `filter` (function) called for each option when the popup opens, passed the option's index; return true to show it, false to hide it, defaults to nil
* `popupWidth` (number) width of the popup window, defaults to 0 (use default width)
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, values updatable via lvgl.set() added in 2.11.6, floating added in 2.11.6
*/
LROT_FUNCENTRY(choice, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetChoice(); }, true); })
/*luadoc
@function lvgl.slider([parent, ]params)
Add a horizontal slider using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`w` sets the size of the slider; `h` is not used.
@param params (table):
@commonparams lvgl_object
* `min` (number) minimum value at the left end of the range, defaults to 0
* `max` (number) maximum value at the right end of the range, defaults to 100
* `get` (function) called to get the current knob value; should return a value between `min` and `max` inclusive, defaults to nil
* `set` (function) called when the user moves the knob; passed the new value, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(slider, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetSlider(); }, true); })
/*luadoc
@function lvgl.verticalSlider([parent, ]params)
Add a vertical slider using the EdgeTX style.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
`h` sets the size of the slider; `w` is not used.
@param params (table):
@commonparams lvgl_object
* `min` (number) minimum value at the bottom end of the range, defaults to 0
* `max` (number) maximum value at the top end of the range, defaults to 100
* `get` (function) called to get the current knob value; should return a value between `min` and `max` inclusive, defaults to nil
* `set` (function) called when the user moves the knob; passed the new value, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(verticalSlider, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetVerticalSlider(); }, true); })
/*luadoc
@function lvgl.font([parent, ]params)
Display a button showing a font name. Tapping it opens a popup menu to choose a font from, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the currently selected font, defaults to nil
* `set` (function) called when the user taps a font in the popup; passed the selected font value, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(font, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetFontPicker(); }, true); })
/*luadoc
@function lvgl.align([parent, ]params)
Display a button showing a text alignment name. Tapping it opens a popup menu to choose an alignment from, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the currently selected alignment, defaults to nil
* `set` (function) called when the user taps an alignment in the popup; passed the selected alignment value, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(align, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetAlignPicker(); }, true); })
/*luadoc
@function lvgl.color([parent, ]params)
Display a button showing a color swatch. Tapping it opens the color picker dialog, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called once when the object is created, to get the initial color, defaults to nil
* `set` (function) called when the user picks a color; passed the selected color value, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects a color.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(color, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetColorPicker(); }, true); })
/*luadoc
@function lvgl.timer([parent, ]params)
Display a button showing a timer name. Tapping it opens a popup menu to choose a timer from, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the currently selected timer, defaults to nil
* `set` (function) called when the user taps a timer in the popup; passed the selected timer value, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(timer, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetTimerPicker(); }, true); })
/*luadoc
@function lvgl.switch([parent, ]params)
Display a button showing a switch name. Tapping it opens the switch-select popup, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the currently selected switch, defaults to nil
* `set` (function) called when the user picks a switch; passed the selected switch value, defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `filter` (number) controls which switch types the user can pick; combine `lvgl.SW_xxx` constants to build a custom filter, defaults to `lvgl.SW_ALL`
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(switch, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetSwitchPicker(); }, true); })
/*luadoc
@function lvgl.source([parent, ]params)
Display a button showing a source name. Tapping it opens the source-select popup, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `get` (function) called on every refresh cycle to keep the displayed value in sync, to get the currently selected source, defaults to nil
* `set` (function) called when the user picks a source; passed the selected source value, defaults to nil
* `filter` (number) controls which source types the user can pick; combine `lvgl.SRC_xxx` constants to build a custom filter, defaults to `lvgl.SRC_ALL`
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(source, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetSourcePicker(); }, true); })
/*luadoc
@function lvgl.file([parent, ]params)
Display a button showing a filename. Tapping it opens a popup file picker, using EdgeTX styling.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `title` (string) text displayed in the popup's header, defaults to an empty string
* `get` (function) called when the popup is opened, and after the selection changes, to get the currently selected filename; must return a string, defaults to nil
* `set` (function) called when the user picks a file; passed the selected filename (without path), defaults to nil
* `active` (function) sets the enabled/disabled state; must return a boolean, true to enable, defaults to nil
* `folder` (string) SD card folder to browse for files, defaults to nil
* `extension` (string) extension filter, e.g. `.png` or concatenated `.png.bmp` to match multiple, defaults to nil (no filter)
* `hideExtension` (boolean) if true, the extension is stripped before `set` is called and hidden in the picker list, defaults to false
* `maxLen` (number) maximum filename length (measured after `hideExtension` stripping, if set); files with longer names are not shown in the picker list, defaults to 255
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The popup closes and `set` is called when the user picks a file.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.0, floating added in 2.11.6
*/
LROT_FUNCENTRY(file, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetFilePicker(); }, true); })
// Containers
/*luadoc
@function lvgl.box([parent, ]params)
Create a container for managing object layout.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `flexFlow` (lvgl.FLOW_COLUMN or lvgl.FLOW_ROW) enables flex layout for this box, not used by default
* `flexPad` (number) padding between rows/columns when flex layout is used; recommend using `lvgl.PAD_xxx` values, defaults to `PAD_OUTLINE`
* `scrollBar` (boolean) enables/disables scroll bars, defaults to true
* `scrollDir` (lvgl.SCROLL_xx) allowed scroll directions when child objects extend past the box bounds (stand alone scripts only), defaults to `lvgl.SCROLL_ALL`
* `scrolled` (function) called when the box content is scrolled; passed `x`, `y` of the current scroll position, defaults to nil
* `scrollTo` (function) overrides the box scroll position; must return `x`, `y` to scroll to, defaults to nil
* `align` (alignment type (LEFT, RIGHT, CENTER, VTOP, VBOTTOM, VCENTER)) alignment used with flex layouts (added in 2.11.4); avoid combining an alignment with a scrollbar on the same axis, defaults to `CENTER | VTOP`
* `borderPad` (number or table) border padding around the container edges; a single number applies to all sides, or a table `{left=?, right=?, top=?, bottom=?}` (added in 2.11.5), defaults to `PAD_OUTLINE` if `flexFlow` is set, otherwise 0
@retval table LVGL object
@notice The box is a helper for managing screen layouts.
@notice When adding controls such as button/toggle/textEdit, leave enough space around them for the focus outline.
@notice In a stand alone tool script, the box automatically adds scroll bars if child objects fall outside its boundaries; for widgets, out-of-bounds children are clipped instead.
@notice `scrollBar`, `scrollDir`, `scrolled`, and `scrollTo` were added in 2.11.2.
@status current Introduced in 2.11.0, align added in 2.11.4, borderPad added in 2.11.5, floating added in 2.11.6, scrollBar/scrollDir/scrolled/scrollTo added in 2.11.2
*/
LROT_FUNCENTRY(box, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetBox(); }); })
/*luadoc
@function lvgl.setting([parent, ]params)
Create a container for a single row of a settings page, automatically padded for controls such as toggle/textEdit/button.
@param parent (object) optional LVGL object to attach the new object to; if omitted the object is created in the top-level script window
@param params (table):
@commonparams lvgl_object
* `title` (string or function) text displayed on the left; function support added in 2.11.6, defaults to an empty string
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@status current Introduced in 2.11.0, title function support added in 2.11.6, floating added in 2.11.6
*/
LROT_FUNCENTRY(setting, [](lua_State* L) { return luaLvglObjEx(L, []() { return new LvglWidgetSetting(); }, true); })
/*luadoc
@function lvgl.page(params)
Create a page layout for a One-Time script using EdgeTX styling: a header with title/sub-title lines and a back button in the top-left corner. Should be created as the top-level LVGL object, with all other objects added as its children.
@param params (table):
* `title` (string or function) title text in the header; function support added in 2.11.4, defaults to an empty string
* `subtitle` (string or function) sub-title text in the header; function support added in 2.11.4, defaults to an empty string
* `icon` (string) full path to a 30x30 grey-scale mask image for the back button icon (white = transparent, black = opaque); defaults to the EdgeTX logo icon
* `back` (function) called when RTN is pressed, or when the back button is tapped -- the top-left header button if `backButton` is not set, otherwise a second button on the top-right, defaults to nil
* `menu` (function) called when the top-left header button is tapped, but only if `backButton` is set to true -- in that case `back` moves to a second button on the top-right, defaults to nil
* `prevButton` (table) adds a prev navigation button; table has a `press` function and optional `active` function (added in 2.11.4), defaults to nil
* `nextButton` (table) adds a next navigation button; table has a `press` function and optional `active` function (added in 2.11.4), defaults to nil
* `flexFlow` (lvgl.FLOW_COLUMN or lvgl.FLOW_ROW) enables flex layout for this page, not used by default
* `flexPad` (number) padding between rows/columns when flex layout is used, defaults to `PAD_OUTLINE`
* `scrollBar` (boolean) enables/disables scroll bars, defaults to true
* `scrollDir` (lvgl.SCROLL_xx) allowed scroll directions when child objects extend past the page bounds (stand alone scripts only), defaults to `lvgl.SCROLL_ALL`
* `scrolled` (function) called when the page content is scrolled; passed `x`, `y` of the current scroll position, defaults to nil
* `scrollTo` (function) overrides the page scroll position; must return `x`, `y` to scroll to, defaults to nil
* `align` (alignment type (LEFT, RIGHT, CENTER, VTOP, VBOTTOM, VCENTER)) alignment used with flex layouts (added in 2.11.4), defaults to `CENTER | VTOP`
* `backButton` (boolean) if true, adds a second header button on the top-right calling `back`, and repurposes the top-left button to call `menu` instead (added in 2.11.4), defaults to false
* `borderPad` (number or table) border padding around the container edges; a single number applies to all sides, or a table `{left=?, right=?, top=?, bottom=?}` (added in 2.11.5), defaults to `PAD_OUTLINE` if `flexFlow` is set, otherwise 0
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The common object settings (x, y, w, h, color, etc.) are not used by `lvgl.page` -- only the settings listed above apply.
@notice The page automatically adds scroll bars if child objects fall outside its boundaries.
@notice `scrollBar`, `scrollDir`, `scrolled`, and `scrollTo` were added in 2.11.2.
@notice The PAGE keys are not automatically mapped to `prevButton`/`nextButton` -- the script's `run` function must detect and handle them itself.
@status current Introduced in 2.11.0, title/subtitle function support, menu, prevButton, nextButton, align, and backButton added in 2.11.4, borderPad added in 2.11.5, scrollBar/scrollDir/scrolled/scrollTo added in 2.11.2
*/
LROT_FUNCENTRY(page, [](lua_State* L) { return luaLvglObj(L, []() { return new LvglWidgetPage(); }, true); })
/*luadoc
@function lvgl.dialog(params)
Display a dialog box.
@param params (table):
* `title` (string) text displayed in the dialog's header, defaults to an empty string
* `close` (function) called when the dialog is closed, defaults to nil
* `flexFlow` (lvgl.FLOW_COLUMN or lvgl.FLOW_ROW) enables flex layout for this box, not used by default
* `flexPad` (number) padding between rows/columns when flex layout is used, defaults to `PAD_OUTLINE`
@retval table LVGL object, or nil if not running as a One-Time script or fullscreen widget
@notice Only available for One-Time scripts and widgets running in full screen mode -- returns nil otherwise.
@notice The common object settings (x, y, w, h, color, etc.) are not used by `lvgl.dialog` -- only the settings listed above apply.
@status current Introduced in 2.11.0
*/
LROT_FUNCENTRY(dialog, [](lua_State* L) { return luaLvglObj(L, []() { return new LvglWidgetDialog(); }, true); })
// Dialogs
/*luadoc
@function lvgl.confirm(params)
Display a Yes/No confirmation dialog box.
@param params (table):
* `title` (string) text displayed in the dialog's header, defaults to an empty string
* `message` (string) text displayed in the dialog's body, defaults to an empty string
* `confirm` (function) called when the user taps Yes, defaults to nil
* `cancel` (function) called when the user taps No, defaults to nil
@retval none
@notice The common object settings (x, y, w, h, color, etc.) are not used by `lvgl.confirm` -- only the settings listed above apply.
@status current Introduced in 2.11.0
*/
LROT_FUNCENTRY(confirm, [](lua_State* L) { return luaLvglPopup(L, []() { return new LvglWidgetConfirmDialog(); }); })
/*luadoc
@function lvgl.message(params)
Display a message dialog box.
@param params (table):
* `title` (string) text displayed in the dialog's header, defaults to an empty string
* `message` (string) text displayed in the dialog's body, defaults to an empty string
* `details` (string) additional text displayed in the dialog's body, defaults to an empty string
@retval none
@notice The common object settings (x, y, w, h, color, etc.) are not used by `lvgl.message` -- only the settings listed above apply.
@status current Introduced in 2.11.0
*/
LROT_FUNCENTRY(message, [](lua_State* L) { return luaLvglPopup(L, []() { return new LvglWidgetMessageDialog(); }); })
/*luadoc
@function lvgl.menu(params)
Open a popup menu with multiple options to choose from, using EdgeTX styling.
@param params (table):
* `title` (string) text displayed in the popup's header, defaults to an empty string
* `values` (table) simple table of option strings shown in the popup, defaults to an empty list
* `get` (function) called when the popup is opened, to get the index of the currently selected option (1..number of values), defaults to nil
* `set` (function) called when the user taps a menu item; passed the selected item's index (1..number of values), defaults to nil
@retval none
@notice The common object settings (x, y, w, h, color, etc.) are not used by `lvgl.menu` -- only the settings listed above apply.
@notice The popup closes and `set` is called when the user selects an item.
@notice If the user taps outside the popup or presses RTN, the popup closes without calling `set`.
@status current Introduced in 2.11.1
*/
LROT_FUNCENTRY(menu, [](lua_State* L) { return luaLvglPopup(L, []() { return new LvglWidgetMenu(); }); })
// Object manipulation functions
LROT_FUNCENTRY(set, luaLvglSet)
+3 -3
View File
@@ -95,9 +95,9 @@ void luaPushDateTime(lua_State * L, uint32_t year, uint32_t mon, uint32_t day,
@param path (string) path to the object
@retval table object info, table elements:
* 'size' (number) file size
* 'attrib' (number) file attribute flags
* 'time' (table) table with last time modified date and times, table elements:
* `size` (number) file size
* `attrib` (number) file attribute flags
* `time` (table) table with last time modified date and times, table elements:
* `year` (number) year
* `mon` (number) month
* `day` (number) day of month
+16 -10
View File
@@ -1206,13 +1206,19 @@ static int luaCrossfireTelemetryPush(lua_State* L)
if (lua_gettop(L) == 0) {
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
} else if (lua_gettop(L) > TELEMETRY_OUTPUT_BUFFER_SIZE) {
lua_pushboolean(L, false);
return 1;
} else if (outputTelemetryBuffer.isAvailable()) {
uint8_t command = luaL_checkinteger(L, 1);
luaL_checktype(L, 2, LUA_TTABLE);
uint8_t length = luaL_len(L, 2);
lua_Integer payloadLen = luaL_len(L, 2);
// ADDRESS + LENGTH + COMMAND + payload + CRC (2 bytes for COMMAND_ID)
lua_Integer frameLen = 3 + payloadLen + (command == COMMAND_ID ? 2 : 1);
if (payloadLen < 0 || frameLen > TELEMETRY_OUTPUT_BUFFER_SIZE) {
lua_pushboolean(L, false);
return 1;
}
uint8_t length = (uint8_t)payloadLen;
outputTelemetryBuffer.pushByte(MODULE_ADDRESS);
@@ -1232,6 +1238,7 @@ static int luaCrossfireTelemetryPush(lua_State* L)
for (int i = 0; i < length; i++) {
lua_rawgeti(L, 2, i + 1);
outputTelemetryBuffer.pushByte(luaL_checkinteger(L, -1));
lua_pop(L, 1);
}
// CRC
@@ -1324,20 +1331,18 @@ static int luaGhostTelemetryPush(lua_State * L)
if (lua_gettop(L) == 0) {
lua_pushboolean(L, outputTelemetryBuffer.isAvailable());
}
else if (lua_gettop(L) > TELEMETRY_OUTPUT_BUFFER_SIZE ) {
lua_pushboolean(L, false);
return 1;
}
else if (outputTelemetryBuffer.isAvailable()) {
uint8_t type = luaL_checkinteger(L, 1);
luaL_checktype(L, 2, LUA_TTABLE);
uint8_t length = luaL_len(L, 2); // payload length
lua_Integer payloadLen = luaL_len(L, 2); // payload length
if( length > 10 ) { // max 10B payload
if (payloadLen < 0 || payloadLen > 10) { // max 10B payload
lua_pushboolean(L, false);
return 1;
}
uint8_t length = (uint8_t)payloadLen;
// Ghost frames are fixed 14B:
// address(1B) + len (1B) + type(1B) + payload(10B) + crc(1B)
// -> address + len up-front are inserted later
@@ -1346,6 +1351,7 @@ static int luaGhostTelemetryPush(lua_State * L)
for (; i < length; i++) { // data, max 10B
lua_rawgeti(L, 2, i + 1);
outputTelemetryBuffer.pushByte(luaL_checkinteger(L, -1));
lua_pop(L, 1);
}
for (; i < 10; i++) { // fill zeroes to frame size
outputTelemetryBuffer.pushByte(0);
+9 -9
View File
@@ -613,9 +613,9 @@ Return input data for given input and line number
* `curveType` (number) curve type (function, expo, custom curve)
* `curveValue` (number) curve index
* `carryTrim` deprecated, please use trimSource instead. WARNING: carryTrim was getting negative values (carryTrim = - trimSource)
* 'trimSource' (number) a positive number representing trim source
* 'side' (number) input side (positive, negative or all)
* 'flightModes' (number) bit-mask of active flight modes
* `trimSource` (number) a positive number representing trim source
* `side` (number) input side (positive, negative or all)
* `flightModes` (number) bit-mask of active flight modes
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11, broken carryTrim replaced by trimSource in 2.8.1, scale added in 2.10, side added in 2.11
*/
@@ -1891,12 +1891,12 @@ Get heli swash parameters
@retval table with heli swash parameters:
* `type` (number) 0=---, 1=120, 2=120X, 3=140, 4=90
* `value` (number) swash ring value (normally 0)
* 'collectiveSource' (number) source index
* 'aileronSource' (number) source index
* 'elevatorSource' (number) source index
* 'collectiveWeight'(value) -100 to 100
* 'aileronWeight' (value) -100 to 100
* 'elevatorWeight' (value) -100 to 100
* `collectiveSource` (number) source index
* `aileronSource` (number) source index
* `elevatorSource` (number) source index
* `collectiveWeight`(value) -100 to 100
* `aileronWeight` (value) -100 to 100
* `elevatorWeight` (value) -100 to 100
@status current Introduced in 2.8.0
*/
+1 -2
View File
@@ -617,8 +617,7 @@ LuaScriptManager::~LuaScriptManager()
{
luaL_unref(lsWidgets, LUA_REGISTRYINDEX, luaScriptContextRef);
if (luaInputTelemetryFifo != nullptr) {
deregisterTelemetryQueue(luaInputTelemetryFifo);
delete luaInputTelemetryFifo;
destroyTelemetryQueue(luaInputTelemetryFifo);
luaInputTelemetryFifo = nullptr;
}
}
+10
View File
@@ -37,6 +37,7 @@
#if !defined(BOOT)
#include "edgetx.h"
#include "groundstation.h"
#include "lua/lua_api.h"
#else
#include "dataconstants.h"
@@ -257,6 +258,10 @@ static void serialSetCallBacks(int mode, void* ctx, const etx_serial_port_t* por
break;
#endif
case UART_MODE_GROUND_STATION:
groundstationSetSerialDriver(ctx, drv);
break;
#if defined(CONFIGURABLE_MODULE_PORT) and !defined(BOOT)
case UART_MODE_EXT_MODULE:
if (port && !ctx) { // de-init
@@ -354,6 +359,11 @@ static void serialSetupPort(int mode, etx_serial_init& params)
break;
#endif
case UART_MODE_GROUND_STATION:
params.baudrate = 115200;
params.direction = ETX_Dir_TX_RX;
break;
#endif // BOOT
}
}
@@ -2683,6 +2683,7 @@ static const struct YamlIdStr enum_UartModes[] = {
{ UART_MODE_DEBUG, "DEBUG" },
{ UART_MODE_SPACEMOUSE, "SPACEMOUSE" },
{ UART_MODE_EXT_MODULE, "EXT_MODULE" },
{ UART_MODE_GROUND_STATION, "GROUND_STATION" },
{ 0, NULL }
};
-1
View File
@@ -56,7 +56,6 @@ add_definitions(-DFIRMWARE_FORMAT_UF2)
add_definitions(-DUSE_CUSTOM_EXTI_IRQ)
set(FLAVOUR c14)
add_definitions(-DMANUFACTURER_IFLIGHT)
# Defines internal modules for PL18 via UART7
# set(INTERNAL_MODULES MULTI CACHE STRING "Internal modules")
-26
View File
@@ -1,26 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#pragma once
#define USB_NAME "C14"
#define USB_MANUFACTURER 'I', 'F', 'l', 'i', 'g', 'h', 't', ' ' /* 8 bytes */
#define USB_PRODUCT 'C', '1', '4', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
@@ -62,6 +62,8 @@ if(NOT NATIVE_BUILD)
${STM32USB_DIR}/Class/HID/Inc
${STM32USB_DIR}/Class/MSC/Inc)
add_dependencies(stm32usb_device_bl hal_usb_descriptor)
set(BOOTLOADER_SRC ${BOOTLOADER_SRC} $<TARGET_OBJECTS:stm32usb_device_bl>)
# Firmware USB devices
@@ -85,6 +87,8 @@ if(NOT NATIVE_BUILD)
${STM32USB_DIR}/Class/HID/Inc
${STM32USB_DIR}/Class/MSC/Inc)
add_dependencies(stm32usb_device_fw hal_usb_descriptor)
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32usb_device_fw>)
# HAL/LL based driver library
-1
View File
@@ -52,7 +52,6 @@ add_definitions(-DUSB_CHARGER)
add_definitions(-DUSB_CHARGE_CONTROL)
set(FLAVOUR gx15)
add_definitions(-DMANUFACTURER_RADIOMASTER)
# defines existing internal modules
set(INTERNAL_MODULES CRSF CACHE STRING "Internal modules")
-29
View File
@@ -1,29 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#ifndef _USB_DESCRIPTOR_H_
#define _USB_DESCRIPTOR_H_
#define USB_NAME "Radiomaster GX15"
#define USB_MANUFACTURER 'R', 'M', ' ', ' ', ' ', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'G', 'X', '1', '5', ' ', ' ', ' ', ' ' /* 8 Bytes */
#endif // _USB_DESCRIPTOR_H_
-2
View File
@@ -51,8 +51,6 @@ add_definitions(-DFIRMWARE_FORMAT_UF2)
add_definitions(-DUSE_CUSTOM_EXTI_IRQ)
set(FLAVOUR h17)
add_definitions(-DRADIO_H17)
add_definitions(-DMANUFACTURER_SENDUWING)
# defines existing internal modules
set(INTERNAL_MODULES CRSF CACHE STRING "Internal modules")
-29
View File
@@ -1,29 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#ifndef _USB_DESCRIPTOR_H_
#define _USB_DESCRIPTOR_H_
#define USB_NAME "Senduwing H17"
#define USB_MANUFACTURER 'S', 'E', 'N', 'D', ' ', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'H', '1', '7', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#endif // _USB_DESCRIPTOR_H_
-9
View File
@@ -56,7 +56,6 @@ if (PCB STREQUAL X10)
set(AUX_SERIAL OFF)
set(EXTERNAL_ANTENNA ON)
add_definitions(-DHARDWARE_POWER_MANAGEMENT_UNIT)
add_definitions(-DMANUFACTURER_FRSKY)
elseif (PCBREV STREQUAL T15)
set(FLAVOUR t15)
add_definitions(-DRADIO_FAMILY_T16)
@@ -71,14 +70,12 @@ if (PCB STREQUAL X10)
# Aux2 is reserved for serial gimbal on this radio
set(AUX2_SERIAL OFF)
set(USB_CHARGE_LED YES)
add_definitions(-DMANUFACTURER_JUMPER)
set(LCD_DRIVER lcd_st7796s_driver.cpp)
elseif (PCBREV STREQUAL T16)
set(FLAVOUR t16)
add_definitions(-DRADIO_FAMILY_T16)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
add_definitions(-DMANUFACTURER_JUMPER)
if (NOT BLUETOOTH)
set(AUX2_SERIAL ON)
endif()
@@ -93,7 +90,6 @@ if (PCB STREQUAL X10)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
set(USB_CHARGER YES)
add_definitions(-DMANUFACTURER_RADIOMASTER)
if (NOT BLUETOOTH)
set(AUX2_SERIAL ON)
endif()
@@ -104,7 +100,6 @@ if (PCB STREQUAL X10)
add_definitions(-DRADIO_FAMILY_T16)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
add_definitions(-DMANUFACTURER_FATFISH)
set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches")
set(VIDEO_SWITCH ON)
elseif (PCBREV STREQUAL V16)
@@ -112,7 +107,6 @@ if (PCB STREQUAL X10)
add_definitions(-DRADIO_FAMILY_T16)
set(DEFAULT_INTERNAL_MODULE CROSSFIRE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
add_definitions(-DMANUFACTURER_HELLORADIOSKY)
set(FLEXSW "2" CACHE STRING "Max flex inputs usable as switches")
set(AUX2_SERIAL OFF)
set(CSD203_SENSOR ON)
@@ -128,7 +122,6 @@ if (PCB STREQUAL X10)
add_definitions(-DRADIO_FAMILY_T16)
set(DEFAULT_INTERNAL_MODULE MULTIMODULE CACHE STRING "Default internal module")
option(BLUETOOTH "Support for bluetooth module" OFF)
add_definitions(-DMANUFACTURER_JUMPER)
if (NOT BLUETOOTH)
set(AUX2_SERIAL ON)
endif()
@@ -138,7 +131,6 @@ if (PCB STREQUAL X10)
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
set(BLUETOOTH ON)
set(EXTERNAL_ANTENNA ON)
add_definitions(-DMANUFACTURER_FRSKY)
endif()
elseif (PCB STREQUAL X12S)
set(DEFAULT_INTERNAL_MODULE XJT_PXX1 CACHE STRING "Default internal module")
@@ -150,7 +142,6 @@ elseif (PCB STREQUAL X12S)
set(USE_VS1053B ON)
set(USE_ADS79xx ON)
set(FONTS_TARGET x12s_fonts)
add_definitions(-DMANUFACTURER_FRSKY)
endif()
# Handset supports external antenna
-56
View File
@@ -1,56 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#pragma once
#if defined(PCBX12S)
#define USB_NAME "FrSky Horus"
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'H', 'o', 'r', 'u', 's', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_T15)
#define USB_NAME "Jumper T15"
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'T', '1', '5', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_T16)
#define USB_NAME "Jumper T16"
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'T', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_T18)
#define USB_NAME "Jumper T18"
#define USB_MANUFACTURER 'J', 'u', 'm', 'p', 'e', 'r', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'T', '1', '8', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_TX16S)
#define USB_NAME "Radiomaster TX16S"
#define USB_MANUFACTURER 'R', 'M', '_', 'T', 'X', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'R', 'M', ' ', 'T', 'X', '1', '6', 'S' /* 8 Bytes */
#elif defined(RADIO_F16)
#define USB_NAME "Fatfish F16"
#define USB_MANUFACTURER 'F', 'A', 'T', 'F', 'I', 'S', 'H', ' ' /* 8 bytes */
#define USB_PRODUCT 'F', 'F', ' ', 'F', '1', '6', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_V16)
#define USB_NAME "HelloRadioSky V16"
#define USB_MANUFACTURER 'H', 'R', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'V', '1', '6', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(PCBX10)
#define USB_NAME "FrSky X10"
#define USB_MANUFACTURER 'F', 'r', 'S', 'k', 'y', ' ', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'X', '1', '0', ' ', ' ', ' ', ' ', ' ' /* 8 Bytes */
#endif
-1
View File
@@ -48,7 +48,6 @@ add_definitions(-DFIRMWARE_FORMAT_UF2)
add_definitions(-DUSE_CUSTOM_EXTI_IRQ)
set(FLAVOUR pa01)
add_definitions(-DMANUFACTURER_FLYSKY)
# Defines internal modules for PL18 via UART7
set(INTERNAL_MODULES AFHDS3;CRSF CACHE STRING "Internal modules")
-29
View File
@@ -1,29 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#ifndef _USB_DESCRIPTOR_H_
#define _USB_DESCRIPTOR_H_
#define USB_NAME "PA01"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'P', 'A', '0', '1', ' ', ' ', ' ', ' ' /* 8 Bytes */
#endif // _USB_DESCRIPTOR_H_
-1
View File
@@ -40,7 +40,6 @@ set(PCB_RF_BAUD 921600 CACHE STRING "INTERNAL_MODULE_BAUDRATE: ${RF_BAUD_RATE}")
set_property(CACHE PCB_RF_BAUD PROPERTY STRINGS ${RF_BAUD_RATE})
add_definitions(-DPCBPL18 -DPCBFLYSKY)
add_definitions(-DMANUFACTURER_FLYSKY)
add_definitions(-DBATTERY_CHARGE)
add_definitions(-DSTM32_SUPPORT_32BIT_TIMERS)
-48
View File
@@ -1,48 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#pragma once
#if defined(RADIO_PL18U)
#define USB_NAME "FlySky PL18Ultra"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'P', 'L', '1', '8', 'U', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_EL18)
#define USB_NAME "Flysky EL18"
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'E', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_NV14)
#define USB_NAME "Flysky NV14"
#define USB_MANUFACTURER 'F', 'l', 'y', 's', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'N', 'V', '1', '4', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_NB4P)
#define USB_NAME "FlySky NB4+"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'N', 'B', '4', '+', ' ', ' ', ' ', ' ' /* 8 Bytes */
#elif defined(RADIO_PL18EV)
#define USB_NAME "FlySky PL18EV"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'P', 'L', '1', '8', 'E', 'V', ' ', ' ' /* 8 Bytes */
#else
#define USB_NAME "FlySky PL18"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'P', 'L', '1', '8', ' ', ' ', ' ', ' ' /* 8 Bytes */
#endif
-1
View File
@@ -48,7 +48,6 @@ add_definitions(-DFIRMWARE_FORMAT_UF2)
add_definitions(-DUSE_CUSTOM_EXTI_IRQ)
set(FLAVOUR st16)
add_definitions(-DMANUFACTURER_FLYSKY)
# Defines internal modules for PL18 via UART7
# set(INTERNAL_MODULES MULTI CACHE STRING "Internal modules")
-26
View File
@@ -1,26 +0,0 @@
/*
* Copyright (C) EdgeTX
*
* Based on code named
* opentx - https://github.com/opentx/opentx
* th9x - http://code.google.com/p/th9x
* er9x - http://code.google.com/p/er9x
* gruvin9x - http://code.google.com/p/gruvin9x
*
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program 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.
*/
#pragma once
#define USB_NAME "ST16"
#define USB_MANUFACTURER 'F', 'l', 'y', 'S', 'k', 'y', ' ', ' ' /* 8 bytes */
#define USB_PRODUCT 'S', 'T', '1', '6', ' ', ' ', ' ', ' ' /* 8 Bytes */

Some files were not shown because too many files have changed in this diff Show More