New:
line and triangle primitives
message popup dialog
expose buttons for for font, alignment, color, timer, switch and source pickers
generic popup dialog that can be filled with other things
lvgl.isAppMode() function to let widgets know when app mode is active
additional containers for creating layouts (box and setting)
flex layouts
Fixes:
colors are updated when theme changes
fix memory leaks when stand alone scripts close
run stand alone scripts in a separate Lua state and use lua_pcallk() to prevent cross boundary errors (color only)
* Refactor object creation logic.
Remove unused LVGL features.
* Remove unused files.
Fix height for widgets.
* Rename 'OpenTxTheme' class to 'EdgeTxTheme'.
Cleanup commented out code.
Cleanup unused code from 'etx_lv_theme.cpp'.
* More cleanup.
* Move more style code to etx_lv_theme.cpp
* Update license
* Make default button height match other controls.
* Fix curve edit layout.
* Fix layouts.
* FormWindow and FormGroup provided identical functionality - rename FormGroup to FormWindow and remove duplicate.
* Simplify menu icon handling.
Remove unused 'flysky.cpp' file.
* Fix window size change.
* Simplify page header code.
Fix statistics view page.
* Remove unused file.
Replace redundant 'Subtitle' class with a macro.
Fix compiler warnings.
* Fix compiler warning in LvglWrapper.cpp.
Remove unused code in static.h.
Simplify about page.
* Rename ICON_OPENTX to ICON_EDGETX.
* Fix github build error.
* Fix github build error (attempt 2).
* Move ButtonMatrix styling to etx_lv_theme.cpp.
* Scroll bar consistency.
* Use styles for ButtonMatrix text color.
* Use 'active' color for selected USB advanced setup buttons. Move error message to bottom of page.
* Create style for popup window title bar.
Simplify advanced USB setup code.
Remove unused libopenui/carousel.* files.
* Add style for modal popup content.
* Remove unused BUTTON_BACKGROUND flag.
* Replace GridLayout with FormWindow. Remove unused gridlayout.h file.
* Fix rebase.
* Merge ChoiceEx class into Choice class code.
Remove unused CurveKeyboard.
* Use LVGL bar for progress indicator.
Update only style colors when theme changes (don't recreate all style settings).
* Move ProgressDialog class to dlalog.h/dialog.cpp files.
* Simplify trim and slider code in main view.
Simplify the hardware inputs code.
Fix dialog size.
Remove unused code in layout factory.
* Cleanup unused code.
* Add style for FormWindow class.
Merge BaseNumberEdit class into NumberEdit class and remove BaseNumberEdit.
Remove more unused files.
Cleanup libopenui_config.h files.
* Re-organise libopenui include files to fix build error.
* Fix build error.
* Add missed styles to etx_lv_theme.cpp.
Delete commented out #includes.
More cleaning up of libopenui_xxx.h files and dependencies.
Re-enable LVGL CHECKBOX feature.
* Merge libopenui_helpers.h into opentx_helpers.h file.
* Fix firmware build.
* Use object constructors for LVGL object creation as suggested by gagarinlg.
Add style for number edit text alignment.
Fix background color for focussed control.
* Move color related stuff from libopenui_defines.h to colors.h.
Remove need for libopenui_depends.h file.
* Merge libopenui_types.h content into opentx_types.h file.
* Rename CheckBox class to ToggleSwitch.
* Restore code to update flight mode text color when theme changes.
* Cleanup some more unused code.
* Remove redundant theme.h file.
* Fix rebase.
* Fix button matrix style.
* Fix rebase
* Fix rebase
* Ensure correct initialisation of Choice object.
* Fix rebase.
* Make the slider control bigger to make touch activation easier.
* Fix build error.
* Fix slider logic and cleanup code.
* Use ACTIVE theme color for inputs, mixes, LS, GV and SF.
* Improved border width consistency and focussed state consistency.
* Remove duplicate copy of the default theme colors.
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
* 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
* Moved getFieldInfo and getValue up right after related functions
* Modified getValue to return a valid status, so Lua can see if it got zero because of invalid source id
* Added new getSourceValue Lua function per Issue #781
Also added alias getSourceInfo for getFieldInfo
* Updated according to comment https://github.com/EdgeTX/edgetx/pull/2175#issuecomment-1245605114
* Replaced isFresh() by !isOld() as requested in https://github.com/EdgeTX/edgetx/pull/2316#issuecomment-1246759370
* Clean up `lua_pushtablenil` - tables cannot hold nil values
* Changed isFresh() to !isOld() ... AGAIN
* Return both `!isOld()` and `isFresh()`
* Return nil for all values if the item does not exist
* Return 0 instead of pushing three nil values
* Update documentation
`getfieldInfo` can now also take a source index as argument. Plus it was modified to also handle "telem1+" etc.
New functions `getSourceIndex(sourceName)` and `getSourceName(sourceIndex)` were added, which use the names shown on the
screen instead of the special names table used by `getFieldInfo` and `getValue`.
Indices are the same for all of the functions, so `getValue(sourceIndex)` also works with indices from `getSourceIndex`.
New iterator functions `sources([first[, last]])` and `switches([first[, last]])` for getting ranges of sources and switches.
`getPhysicalSwitches` was removed, as I consider the iterator function to be a better solution.
* 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
* Preliminary trims as keys for lua
Largely based on open-flysky implementation
* Add `isLuaStandaloneRunning()`
* Add more virtual events
* Tweak virtual events further
* Finish remapping keys to virtual events
* Move some virtuals to right trim hat
* Add missing "defined"
* Revert to common EVT_VIRTUAL_MENU mapping
* Make keys/trims reset backlight like other radios
* Add Lua getUsage() function that returns percent of already used up instructions in current script execution cycle. It can be used to avoid script being killed when doing long lasting tasks (like telemetry logs loading and parsing)
* Compilation fixes
* Doc fix
* Disable Lua script instructions limit in DEBUG mode
* Fixes#4438: wrong cast used when setting Lua mixer script input source
Improved parsing of Lua mixer script inputs
* Additional type check
* ScriptDataInput union introduced.
Fixed: when using SOURCE input, do not use default value
Fixed: when using SOURCE input, min-max range is fixed
* Fixes#4284: Prevent Lua from allocating all heap memory (Horus)
Lua bitmap functions cleanup and docs update
Added x or y < 0 check to drawBitmap()
* Proper float constant
* [simu] simpgmspace: Populate file date/time/size in f_stat(); Add f_utime(); Fix f_getcwd() on Windows; Fix f_mkdir() build error on Windows.
* [Lua] Add runtime support for script pre-compilation. Changes behavior with LUA_COMPILER (Re: https://github.com/opentx/opentx/issues/3318):
All .lua scripts are now compiled and saved to binary "bytecode" file (.luac extension) upon first execution;
Scripts are also automatically re-compiled if .lua source file is newer than existing .luac file;
The pre-compiled .luac version is loaded if modification time is newer or equivalent to .lua source file;
If a .luac version of a script exists, then the .lua version does not need to be present;
Guards against bytecode compatibility issues (binaries from 64-bit sim will not run on 32-bit sim/radio);
In SIMU and DEBUG builds, the source .lua file is always preferred in order to preserve full debug info (this is is controlled with new LUA_SCRIPT_LOAD_MODE macro, see lua_api.h);
GC is now run after each script is loaded.
* [Lua] Add loadScript() API function as alternative to loadfile() from Lua base. This can take advantage of the new OTx script pre-compilation features to reduce memory footprint when loading functions dynamically. This is an interface to luaLoadScriptFileToState(). Fully documented.
* [SD][Lua] Flexible file extensions support:
Allow for variable length file extensions throughout system (no longer hard-coded in LEN_FILE_EXTENSION);
Fixes issues with renaming files in SD manager which have file extensions longer than ".ext";
Expand general support for multiple file extensions per file type in sdListFiles() (eg. .lua and .luac for scripts);
Lua scripts with .luac extensions can now be selected in custom/telemetry/function menus even if no .lua version exists (duplicates are not shown);
.luac files can now also be executed from SD file manager UI.
* [Build] Added CMake options for LUA_COMPILER and LUA_SCRIPT_LOAD_MODE.
* Cosmetics.
* [SD][gui] Improve efficiency of some file name handling routines in sdmanager GUI and sdListFiles() by extending getFileExtension() function. Use shared isExtensionMatching() in place of isImageFileExtension(). Only allow executing .luac files when LUA_COMPILER defined (as per request).
* [simpgmspace] Fix f_mkdir() for MSVC build and misc. cleanup.
* [Lua] Use getFileExtension() in script loader to determine file type and check for buffer overflow.