Commit Graph
543 Commits
Author SHA1 Message Date
WilhelmandGitHub 5e6cf2e79c fix: Custom stick and switch names were being mangled internally (#1770)
* followup to PR1754

* Cleanup

* Formatting

* Long comment
2022-04-01 14:16:01 +10:00
Raphael CoefficandRaphael Coeffic 86d1ca4364 Reorganize module type/subType/rfProtocol 2022-03-24 10:40:17 +01: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
Jesper FrickmannandGitHub cdda903a25 fix: Lua - Changed getSwitch* so can also get "One" and "ON" switch positions (#1720)
Use `ModelCustomFunctionsContext` instead of `LogicalSwitchesContext` to get "One" and "ON" switch positions
2022-03-23 19:09:43 +10:00
Raphael Coeffic 9c9f77a2a9 Do not allocate memory for LUA Rx fifo from the USB ISR
Rather use explicit allocation when the serial is set as the on-demand method that was used previously.
2022-03-20 16:30:59 +01:00
Raphael Coeffic 530d395204 WiP 2022-03-20 16:22:14 +01:00
Raphael Coeffic 74f19371ae Fixes for TX16S 2022-03-20 16:22:14 +01:00
Raphael Coeffic d93cd1ea25 Moved aux serial defs to own header file 2022-03-20 16:22:14 +01:00
MichaelandGitHub 45731d8577 fix: Numerous updates and fixes for HoTT telemetry (#1617)
* transferred respective OpenTX updates to HoTT telemetry

* integrated LUA function flushAudio from OpenTx

* sensor names moved to “untranslated.h”

reverted *.h.txt to original mainline content
removed leading "Z" in sensor name defines
2022-03-18 10:06:53 +10:00
Peter FeerickandGitHub 2929f1aca9 fix: Disable LUA GV funcs if GVARS=NO build (#1645)
Compile option breakage from #1602
2022-03-01 08:38:20 +10:00
Jesper FrickmannandGitHub 0391174e06 fix: Lua get/setGlobalVariable not honoring flight mode setting (#1602)
When GV was set to e.g. `FM0` , `setGlobalVariable` would change it to own value. Now it works as it should
2022-02-27 08:46:37 +10: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 b91be18414 feat: Increase resources for Lua widgets (#1498) 2022-02-01 11:37:11 +10:00
jfrickmannandPeter Feerick 65584ae0d6 Fixed a bug with drawing INVERS + CENTER 2022-01-31 21:33:20 +10:00
Štěpán DaleckýandPeter Feerick 8c6bc67f18 Ghost MSP support 2022-01-27 10:35:56 +10:00
Peter FeerickandGitHub dcbdde2b74 Fix warning: "EVENT_BUFFER_SIZE" redefined 2022-01-17 11:34:09 +10:00
Jesper FrickmannandGitHub 0069bcc52f Increased Lua buffer size for standalone and telemetry scripts (#1442) 2022-01-17 10:54:08 +10:00
Jesper FrickmannandGitHub c45b3d7114 Fix: [lua] Do not ever convert name to a number with getFieldInfo(name) (#1423)
Fix for Issue #1346
2022-01-17 10:20:40 +10:00
Jesper FrickmannandGitHub cc316e5a2c fix: Wrong x-coordinate for Lua touchState during sliding on mainviews other than the first screen (#1409)
Fix for issue #1348 as discussed on https://github.com/EdgeTX/libopenui/pull/49
2022-01-11 22:44:54 +10:00
Peter FeerickandPeter Feerick a077f2e325 Change version references to 2.6 2022-01-04 09:51:47 +10:00
jfrickmannandPeter Feerick f2a360c9d3 Addressed the requests in issue #1285
`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.
2022-01-04 09:51:47 +10:00
rotormanandRaphael Coeffic 89517d8bd8 Use ETX instead of OTX (also as a file extension). 2021-12-31 10:53:08 +01: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
3djcandRaphael Coeffic d31482c18b Introduce T-pro and function switches handling 2021-12-17 17:07:48 +01:00
3djcandRaphael Coeffic 6735a42b08 Radiomaster Zorro
Port of opentx/opentx#8791
2021-12-17 15:17:48 +01:00
jfrickmannandPeter Feerick 85bd9d16ea Added Lua constants for logical switch and special/custom functions 2021-12-15 12:24:58 +10:00
jfrickmannandPeter Feerick a66e78fea8 Fixed string option for Lua widgets 2021-12-14 20:12:12 +10:00
jfrickmannandPeter Feerick a9c5365ccb Truncate Mixer Lua script input and output names to 6 chars 2021-12-13 14:51:47 +10:00
jfrickmannandRisto 14f72e1d82 Added new Lua API functions for switches
getSwitchId(positionName)
getSwitchName(switchId)
getSwitchValue(switchId)
getPhysicalSwitches()
2021-12-01 18:41:04 +01:00
Peter FeerickandPeter Feerick 9401e00253 Add missing newline at EOF 2021-11-29 12:00:50 +10:00
jfrickmannandPeter Feerick 81cb94a4bf Added string constants to the read-only tables in Lua 2021-11-29 12:00:50 +10:00
Jesper FrickmannandGitHub a09e318e64 [Lua] Add setStickySwitch and getLogicalSwitchValue (#1056)
[Lua] Add setStickySwitch and getLogicalSwitchValue (#1056)
* Adds setStickySwitch to set the value of a stick logical switch
* Adds getLogicalSwitchValue to get the value of a logical switch by index
2021-11-29 12:48:01 +11:00
jfrickmannandPeter Feerick d4b8717575 Added zone.absx and zone.absy to give position of a Lua widget on the screen 2021-11-27 18:18:44 +10:00
Peter FeerickandGitHub a05cc887b9 Add touch to Standalone Lua scripts (#1082)
Touch events to Standalone Lua scripts
2021-11-25 10:49:44 +10:00
Peter FeerickandGitHub 362a8e435f Add filename to lua model.getInfo() (#1132)
* Add filename to lua `model.getInfo()`

* Make `getModelNumberStr()` globally available

* Move variable extern

* Move constexpr to header, remove externs

* Perhaps .cpp should include its OWN header
2021-11-25 10:38:51 +11:00
Raphael CoefficandRaphael Coeffic 5e3c20b258 Push some dirty hack to give internal CRSF a higher prio
This allows for BF scripts to run on internal CRSF.
2021-11-21 11:18:35 +01:00
Raphael CoefficandRaphael Coeffic 043c1e6a2d Fixed pushing CRSF telem packets to internal module 2021-11-21 11:18:35 +01:00
jfrickmann ce7b408445 Add touch to Standalone Lua scripts 2021-11-19 08:01:28 -05:00
jfrickmann df153b4b1f memset() -> memclear() 2021-11-18 19:51:01 -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 30780d82ec [lua] Add shared memory variables which can be accessed from Lua widgets and other Lua scripts (#1018)
* Issue #132
Added 16 shared memory variables which can be accessed bot from Lua widgets and other Lua scripts.

* Notice Only available on radios with color display
2021-11-13 16:10:33 +11:00
Raphael Coeffic 69c017091a More stringified values 2021-11-10 11:07:01 +01:00
Raphael Coeffic d2ddb2e535 Fix compilation error 2021-11-10 11:06:59 +01:00
Peter FeerickandGitHub 3ad98bacf4 [NV14] Use trim hats to emulate key events when standalone lua script running (#985)
* 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
2021-11-09 12:50:20 +11:00
eshifriandGitHub 4e571c1325 Improvements to time and timer display #911 (#912)
* Fix time display #911

* move TIMEHOUR definition

* change time format

* Refactoring

* rename

* remove unncessary code

* Change hour/minute format

* pack TimerDisplayOptions structure
2021-10-25 12:36:16 +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
jfrickmannandPeter Feerick b316a11bba Per discussion on Discord
https://discord.com/channels/839849772864503828/842693696629899274/894878085210574889
2021-10-06 11:42:05 +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
Raphael Coeffic a17a02c541 Compute SDKROOT and use it 2021-09-16 12:05:41 +02:00