Commit Graph
129 Commits
Author SHA1 Message Date
philmozandGitHub ecfa1e1b5b feat(color): add Slider & Choice widget option types (#5518) 2024-09-11 16:20:37 +10:00
philmozandGitHub 06db4c7989 fix(lua): radio tries to run 'nil' script if SF disabled (#5457) 2024-08-19 09:01:33 +10:00
Peter FeerickandGitHub 839cfbd53c chore: more OTX to ETX housekeeping (#5396) 2024-08-14 21:02:29 +10:00
philmozandGitHub 8443b50aef fix(bw): LONG press RTN to exit Lua script closes tools menu (#5417) 2024-08-12 10:37:02 +10:00
philmozandGitHub 2eee7cd011 chore: re-organise source files for color LCD UI (#5358) 2024-08-02 08:50:55 +10:00
philmozandGitHub 4d29d5dbae feat(color): additions to LVGL for Lua scripts (#5179) 2024-07-01 09:07:18 +10:00
philmozandGitHub 0d6d35ef02 fix(color): standalone Lua syntax errors or missing run() may cause EM (#5212) 2024-06-23 18:46:36 +10:00
philmozandGitHub b4e33fc439 feat(lua): support for using LVGL objects on colorlcd (#4887) 2024-06-13 13:16:07 +10:00
philmozandGitHub 97f9884639 refactor(color): UI code cleanup, speed up loading of complex pages (#5031) 2024-06-06 20:08:13 +10:00
philmozandGitHub e807ccbebf refactor: key handling (#4849) 2024-05-27 18:33:53 +10:00
Peter FeerickandGitHub e72f1d2da1 fix: some cppcheck errors (#4942) 2024-05-02 13:13:16 +10:00
ThomasKuehneandGitHub 8225fb21c5 chore(radio): cleanup -Wzero-as-null-pointer-constant warnings (#4851) 2024-04-15 09:31:46 +10:00
philmozandGitHub f28c1150ed refactor(color): use LVGL styles and objects for UI, legacy cleanup (#4407) 2024-04-05 17:33:14 +10:00
philmozandGitHub 0d84acef59 fix(lua): ignore potential unwanted key events (#4833) 2024-04-02 10:52:17 +10:00
ee73fa47f0 feat: Add "Enable" button to all SF/GF (#3024) (#3601)
Co-authored-by: eshifri <eshifri@hotmail.com>
Co-authored-by: philmoz <philmoz@users.noreply.github.com>
2023-12-03 12:23:34 +10:00
bug400andGitHub 926dc36d51 fix(lua): Do not pass key event that triggered telemetry view to lua (#4168) 2023-11-07 09:08:31 +10:00
b22a1b5d32 feat: Support for WS2812 RGB LEDs (#3909)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
2023-10-14 14:06:55 +10:00
philmozandGitHub 776b64c469 feat(radio): Disable Special Functions when feature turned off (#4116) 2023-10-03 10:57:09 +10:00
f40fa1a64b feat(el18): Use trim hats as keys for navigation (#3894)
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2023-09-29 20:12:54 +10:00
philmozandGitHub e4f845c844 chore(radio): Fix some compiler warnings when building firmware (#4058) 2023-09-20 11:16:48 +10:00
Raphael CoefficandMalte Langermann 2b100e0eb5 refact: ADC, switches and keys
Add "hardware_defs" target to dump hardware defines from hal.h per target

Fixed hal.h definitions for switches & ADC inputs

Tools to generate hardware definitions from current hal.h

generator: add support for EXTx and analog switches

WiP

Add generated header to hardware_defs target

Add support for ADC input direction and index per GPIO port

Incredible: it compiles

Removed StdPeriph ADC driver

Works on QX7

Works on TX16S (VBat missing)

Switch driver using generated switches for stm32 targets

Switch driver with generated switches for simu

Use switch names from switch driver

Fixed single conversion handling

Fixed horus VBat reading

Added switch name

Fix warnings about bitfield offsets and GCC 4.4

This is caused by bitfields that cross type boundaries. In this particular case, it happens as the bitfield is not defined the same in `rtc_backup.cpp`.

Switches has already been moved to generic driver

Jitter measurement for each sample, not just for oversampled values

Moved periph clock init to the ADC driver

ADC & GPIOs.

Add switchInit() to init pins

Fix NV14 CMake

Fix taranis target

Fix NV14 (again)

Model audio files: use new interface for switch index

Fix X9-lite

Fix simu headers

Fix getSwitchName()

Add support for ADC switches

Fix switch warning YAML

Test only switches which are defined

Conversions tests for QX7 only on QX7

Fix X12S

Fix function switch names

Enable ADC periph clock before initialising channels

NV14: offset inputs for the sticks & fix switches

WiP: get rid of VSRCRAW and some more

Simu shall use normal ADC driver

fix x7

fix nv14

Fix 9x nav

fix 212x64

fix xlite

fix x9e

fix simu lib

fix unit tests

fix x7 tests

PWM stick values should be written directly into adcValues

... just like FlySky sticks.

fix x12s

fix nv14

Add some support for SPI ADC (only unit tests)

Remove `jq` usage

fix generate_yaml.py for newer libclang

fix pot config

fix stick names

Some YAML generator improvements

Max 16 Pots on COLORLCD

Fix some source names

Use 10 bits for switches to prevent overflow

Removed horus constants for switches & ADC inputs

Fix unit tests

Fix curve edit

Fix libsimulator

Fix function switches (tpro)

Refine ADC & analog API

Moved hardware definitions scripts and templates into own dir

cleanup API refine

Fix unit tests

Mixer: apply calibration only on required inputs

Place ADC switches after all other ADC inputs

Fix X12S

Remove useless TR_POTS_VSRCRAW, TR_SW_VSRCRAW, and TR_VSRCRAW

Cleanup redundant generated YAML parsers

Fixes Boxer rebase

Add boxer to generate-hw-defs.sh

Obsolete LUA exports

Add boxer ADC_DIRECTION

Split generate_hw_defs.py into multiple files

Some cleanup (+ LUA switches)

Fix AXIS definitions

Fixed translation strings declarations

Some rebase fixes

Remove some useless StdPeriph drivers

fix: set pin mode to reset state on usart deinit

fix: use canonical names for calibration data

fix: ADC driver does not care about unconfigured inputs

fix X12S ADC

Add support for ADC conversion chaining

Better X12S ADC implem

Moved X12S ADC driver to HAL/LL

Improve ADC driver separation

Fixed taranis & nv14

Moved PWM gimbals to HAL/LL

Removed useless TR_EXTRA_VSRCRAW

Fixed include guards

Small fixes

Renamed control inputs

Moved internal and external module pulse driver def to boards

Move more things to the generic_stm32 board

Remove STR_VMIXTRIMS

Added analog labels

Generate main control names

Misuse labels / short labels for main controls

Backward compatibility: sliders and legacy names

New keys driver

Let's get rid of StdPeriph headers in simu

Add jinja2 to CI workflows

Use `grep` instead of `sed`

chore: add python jinja2 oto msys setup script

Removed more static definitions and use dynamic ones instead

Fixes X9E

Fix x7 nav too

212 switch display

Fix default sliders

Removed NUM_STICKS

212 switch display working nicely

Surface radio 'stick' replacements

fix: switch, trim & rotary pin init

Remove old key drivers

Removed VKEYS

Removed ETX_FOURCC

Fixed SURFACE_NAME

Removed TR_VSWITCHES & TR_TRIMS_SWITCHES

Fix xpot switches

Store calibrated analogs in physical order

Use getSourceString in drawSource

Implement missing YAML read/write

Fix isSourceAvailableInInputs()

Fix isSourceAvailable()

Some surface fixes

Fix CLI debug

Ported colour UI of analog diagnostics to new ADC API

Small fixes

Better input mapping

Minor tpro fixes

Fix trims available

Remove TX mode choice on surface radio

Rename surface controls

Channel order alignement

Fix throttle warning

Fix checkTrims()

Fix pot config casting issue

Fix IS_SWITCH_FS()

Fixed input mapping

Fix fswitch auto-switch

Fixed storing / reading function switches in YAML

Fix enableVBatBridge() / disableVBatBridge()

Fix interesting mode conversion

Fix sources issues

Fix special funnction list

Proper function switch handling

128 GUI improvements

Fix compilation

Boxer cosmetics

128 hardware screen cosmetic

Fix TX12 switches

More switches fixes

Simplify CPU type handling

Fix flash size

Fixed page-up / page-down in libopenui
2023-06-25 14:32:39 +02:00
philmozandGitHub 5327c890f2 feat: Add options to disable radio and model menu tabs (#3484)
* Add options to disable radio and model menu tabs.
- Update radio and model data structs
- UI for color LCD radios
- Convert existing 'noGlobalFunctions' property.
- Language strings.

* Make 'theme' control specific to color LCD radios.

* Add B&W radio UI.

* Simplify code, reduce compiled code size.
Fix page count display on model select tab.
Fix GVARS for 212x64 radios.

* Collapse timer sections if timer is off.

* Remove 'Use global functions' checkbox from B&W model setup.

* Make preflight checks, throttle and view options sections expand & collapse (default collapsed).

* Fix build.

* Add view options to companion data classes, save and load values in YAML files.
Fix scrolling for radio setup view options.

* Add Companion UI for view option settings.

* Remove 'Mixes' from list of tabs that can be hidden.

* Updated Companion UI from elecpower.

* Use view options flags to enable/disable functionality:
- skip heli mixer logic if heli not enabled
- Remove heli, gvars and telemetry options from source selection if not enabled

* Remove 'flight mode', 'curve' and 'global variable' settings from input & mix editors if option disabled.

* Rename 'View Options' to 'Enabled Features'.
Put GVAR option under Flight Mode and indent text.
Make relationship between FM and GV more obvious.

* Remove global variable option dependency on flight modes.
Hide FM1-FM8 in global variables if flight modes hidden.

* Hide 'Custom Mixer Scripts' in source selection menu popup if disabled.

* Add translation strings for Hebrew language file.

* Fix typo. Add comment for double call to setCurrentTab.
2023-05-22 20:08:16 +10:00
philmozandGitHub 227780d784 feat: Add 'repeat' option to 'Lua Script' special function (#3338)
* Add support for the '1x' repeat option for 'Play Script' special functions.

* Add Companion and B&W radio support.

* Fix B&W radio logic and layout.

* Add translation hooks.
2023-04-10 11:00:50 +10:00
Raphael CoefficandGitHub be3f8d74a8 feat(lua): Port of NodeMCU Lua53 read-only tables (#2994)
* chore(lua): revert useless c light function change

This change was part of the eLua LTR patches (based on 5.1), whereby this feature was already integrated in Lua 5.2.

* feat(lua): port of NodeMCU Lua53 read-only tables

# Conflicts:
#	radio/src/lua/CMakeLists.txt
#	radio/src/lua/api_general.cpp

* fix(nv14): missing SDRAM definition

* fix: l_mathop

* fix: use float functions in drawPower()

* fix: ltable resize

* fix: correct name is "bit32"

* fix: first Lua context must be closed last

As the lookup cache is attached to that one

* Revert to Lua using double

* Ensure byte-code compatibility

* Fix possible compatibility issue with `lua_typename`/`luaL_typename`

* Fix Bitmap symbol table

* Re-add table lib for COLORLCD
2023-02-09 20:29:56 +10:00
Raphael CoefficandRaphael Coeffic a3424d5bc0 Support for touch/key events in LUA widgets 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic 4c8bb99e73 Replaced focus handling with LVGL groups 2022-06-11 15:38:08 +02:00
WilhelmandGitHub c14417a325 Try to fix use of unterminated strings in mixer setup (#1317) (#1338)
* fixes the non-terminated fixed-string problem in lua-mixer-script
added some useful info to the script-line
make the popup menu to delete a script

* removed unneccessary comments

* intermediate fix

* tried to obey all comments to the code
and to eliminate further potential buffer-overflows

* fixed typo

* fixed async loading of lua scripts and update of widget
cleanup

* removed GCC pragmas (clang warn about them)
remove constexpr qualification (gcc accepts them because gcc-builtins are already constexpr, clang still warns about them)

* removed merge marker
2022-03-23 12:40:06 +01:00
Hans Christian OlaussenandGitHub 279c308da4 fix: lua error message not always shown (#1604) 2022-02-26 19:18:35 +10:00
5a4c6df594 fix: OSK DEF button was not setting Value inputs of mixer scripts correctly (#1536)
* The set/reset switches for a logical switch are only processed if the are valid.

* Revert "The set/reset switches for a logical switch are only processed if the are valid."

This reverts commit c238108415aec39f64ba6bae4c86cfb3ea4713bc.

* fix handling of default values in mixer scripts

* revised the use of default value to be consistent to the past usage

* Limited autoformatting

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-02-04 21:53:14 +10:00
Jesper FrickmannandGitHub d37b3e4051 [lua] Fix Lua Mixer index issue (#1312)
* Bug with the index of Mixer script input/output data

* Missed a #if defined(COLORLCD)
2021-12-30 19:37:23 +10:00
jfrickmannandPeter Feerick a9c5365ccb Truncate Mixer Lua script input and output names to 6 chars 2021-12-13 14:51:47 +10:00
jfrickmann ce7b408445 Add touch to Standalone Lua scripts 2021-11-19 08:01:28 -05:00
Jesper FrickmannandGitHub f1baa383ae Fix standalone Lua script screen flicker and improve error messages (#982)
* Relax assumptions about when Lua is called in foreground and background

* Start Lua cycle timer both in foreground and background
Do not assume that background/foreground alternates

* Lua is called at every Standalone GUI cycle instead of 5 Hz
Since Lua preempts every 50 ms or so, the GUI should remain responsive.

* In standalone script, only call Lua once per GUI cycle, to avoid messing up buffer handling.

* Revamped error reporting for Standalone and Telemetry Lua scripts

* Font size for Lua error is reduced from XL to L on color if LCD_W < LCD_H

* In drawTextLines, also possible linebreaks for opening brackets.

* Smaller font for error message on tall color screen

* Make titlebar height match font size on narrow LCD
2021-11-15 12:57:14 +11:00
Jesper FrickmannandGitHub ecf386e71f Fix certain Lua script errors hanging the GUI (#899)
* Fixed a bug where a standalone Lua script w/o a run function will hang the GUI on non-color radios

* Prevent Lua standalone window from opening if Lua failed on load

* Fixed scroll down key in TX12 simulator
Copied key definitions from TX16S

* Fixed the Lua error trying to call nil value when no scripts are loaded.

* I messed up in the previous commit; now it does not freeze and it does not call nil.
2021-10-15 12:03:23 +11:00
rotormanandRisto fc2142ec78 Changed uniformly to EdgeTX boiler plate (also added boiler for files that were missing it). 2021-10-02 14:22:01 +02:00
Riwan c1d8ae531a moving include api_filesystem 2021-08-24 10:24:47 +02:00
Riwan ec1c1ec345 Added LUA file system operations 2021-08-23 14:39:49 +02:00
jfrickmann 8e4e2cceea Fix for issue #537
The function luaResume(...) assumes that it is called alternatingly in the background and the foreground.
But on color LCD radios it is only called in the foreground by standalone and tools script, so it got stuck waiting for a foreground call.
2021-08-03 20:57:16 -04:00
jfrickmann 5671838864 Cleaned up code for Mixer/Custom/Model scripts and added compiler directives 2021-07-22 15:11:12 -04:00
jfrickmann dcac3cb9da Fixed Lua error messages in standalone and telemetry scripts - again. There is still a problem that the call to POPUP_WARNING in displayLuaError does not return and the gui goes dark on colorlcd. Could it be long jump? 2021-07-22 14:56:23 -04:00
jfrickmann c76532f33a Fixed Lua error messages in standalone and telemetry scripts. TODO: If a standalone script errors in init() on COLORLCD it just quits without showing error. Is that because it calls luaError from luaExec() in radio_tools.cpp instead of from luaTask() in standalone_lua.cpp? 2021-07-22 14:51:44 -04:00
jfrickmann c62aac7bde Lua task preempts long running scripts instead of killing them
Ported to EdgeTX from https://github.com/opentx/opentx/pull/8194
2021-07-22 14:41:53 -04:00
Raphael CoefficandRaphael Coeffic 6d490bddf0 Sensors don't use ZCHAR in 2.4
Resolves #97
2021-06-02 11:19:11 +02:00
olliw42andGitHub 25cce2611c avoid compiler warning (#139) 2021-06-02 07:12:09 +02:00
Raphael Coeffic 5030939e4e Added support for LUA pop-up functions 2021-05-30 18:25:35 +02:00
Raphael Coeffic 54a7ef68e0 Fixed starting scripts from "Tools" page 2021-05-30 08:10:02 +02:00
Raphael CoefficandRaphael Coeffic 6b9abe0670 Remove obsoleted code 2021-05-24 16:23:06 +02:00
Raphael CoefficandRaphael Coeffic 3ba55ac34e Fixed non-color lcd cmake
No widgets necessary for B/W.
2021-05-06 12:55:59 +02:00
Raphael CoefficandRaphael Coeffic 72a7409d10 First working LUA widget: Timer2 2021-05-06 12:55:59 +02:00
Raphael CoefficandRaphael Coeffic 3a45cbe8e7 Cleanup & fixes 2021-05-06 12:55:59 +02:00