Commit Graph
330 Commits
Author SHA1 Message Date
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
Štěpán DaleckýandPeter Feerick 8c6bc67f18 Ghost MSP support 2022-01-27 10:35:56 +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
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
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
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
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
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
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
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 ec1c1ec345 Added LUA file system operations 2021-08-23 14:39:49 +02:00
jfrickmannandRaphael Coeffic 9d878b71ce Improved color handling in Lua
LCD flags can now hold either a theme color index or a RGB value. Hence, values from lcd.RGB() and literal colors like e.g. RED, WHITE etc. can be used interchangeably with theme colors and CUSTOM_COLOR.
Also redesigned drawText, drawNumber and drawTimer, so they now use a common function to implement the party tricks with BLINK and INVERS flags.
2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic d0e4b767d3 Converted literal colors to indices that can be used everywhere.
Also modified lcd.setColor function so it accepts either RGB or index color as new color. That way, literal colors work as before.
2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 23ee5d933c Added back Lua constants for old style them colors 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 95b87db3e0 Did a scripted search and replace to replace 40 existing theme colors with 11 new theme colors. 2021-08-22 19:39:50 +02:00
jfrickmannandRaphael Coeffic 302fcef465 Added OS theme colors as suggested by JimB40 in #506
Amend: trying if tests will pass when I move the new color indices to then end of the enum.
2021-08-22 19:33:03 +02:00
richardclliandGitHub f12e9d4599 Merge pull request #501 from EdgeTX/main
Merge from main
2021-07-26 10:50:32 +08:00
jfrickmann da94cc64ff Merge branch 'VCENTER' into Everything 2021-07-24 17:32:48 -04:00
jfrickmann 1fc59ce31a Merged LuaScriptPreemption 2021-07-24 17:32:41 -04:00
richardclliandGitHub d9d4591008 Merge pull request #495 from EdgeTX/main
Merge from main
2021-07-24 00:23:37 +08: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
jfrickmann 0b9fd82074 Added touch events to Lua widgets 2021-07-22 08:02:33 -04:00
jfrickmann 2e129af9f1 Added VCENTER to lcd flags
Only for COLORLCD
2021-07-21 19:53:13 -04:00
Raphael Coeffic 6d11fa8033 [lua] Fix sensor max and min matching
Resolves #442
2021-07-14 08:45:00 +02:00
richardclliandGitHub 2222ee75e8 Merge pull request #373 from EdgeTX/2.4
Merge from 2.4
2021-06-30 15:14:08 +08:00
Peter FeerickandRaphael Coeffic edbec9f35e Updated getVersion luadoc and example output
Finished updated lua docs for getVersion() api change,
verified functionality and grabbed simulator output,
removed magic string and used a define instead.
2021-06-26 06:36:35 +02:00
PeterandRaphael Coeffic 74222fe74d Lua scripts can detect EdgeTX via getVersion
Add a sixth parameter to getVersion so that scripts 
can detect whether running on EdgeTX or OpenTX. 

i.e. `local ver, radio, maj, minor, rev, osname = getVersion()`
2021-06-26 06:36:35 +02:00
richardclliandGitHub 2f54a629a2 Merge pull request #289 from EdgeTX/2.4
Merge from 2.4 bug fixes
2021-06-21 15:45:44 +08:00
Raphael Coeffic d10563d08b Fixed more zchar / string copy errors
Resolves #224
2021-06-16 18:00:42 +02:00
Richard Li cc92f25046 Fixed NV14 build, added flysky build script and target in build-gh.sh 2021-06-09 16:10:45 +08:00
Raphael Coeffic b0fb80b264 ZChar nightmare / take 2 2021-06-09 09:24:48 +02:00
Raphael CoefficandRaphael Coeffic 6d490bddf0 Sensors don't use ZCHAR in 2.4
Resolves #97
2021-06-02 11:19:11 +02:00
Raphael Coeffic 5030939e4e Added support for LUA pop-up functions 2021-05-30 18:25:35 +02:00
Raphael CoefficandRaphael Coeffic 6b9abe0670 Remove obsoleted code 2021-05-24 16:23:06 +02:00
Raphael Coeffic 2f5b522413 Merge branch '2.3' into 2.4 2021-05-16 12:55:21 +02:00
Lucas1188 c8bd18441a Update api_general.cpp 2021-05-10 21:46:15 -06:00