Commit Graph
330 Commits
Author SHA1 Message Date
MichaelandGitHub c377aa4890 fix(lua): save telemetry sensor generated by setTelemetryValue() (#5224) 2024-06-28 21:12:52 +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 fb2188cacd fix(lua): getFieldInfo() not returning switch info (#5108) 2024-06-05 18:19:35 +10:00
philmozandGitHub e807ccbebf refactor: key handling (#4849) 2024-05-27 18:33:53 +10:00
philmozandGitHub dc2998e478 feat(lua): add 'mkdir' and 'rename' functions (#4870) 2024-04-28 18:44:55 +10:00
philmozandGitHub f28c1150ed refactor(color): use LVGL styles and objects for UI, legacy cleanup (#4407) 2024-04-05 17:33:14 +10:00
Peter FeerickandGitHub 2bef12996f fix(lua): serialRead is not limited to CLI (#4644) 2024-02-27 09:42:50 +10:00
3ebff87e8f feat(lua): add support for CRSF 'direct command' packets (#4630)
Co-authored-by: Raphael Coeffic <raphaelcoeffic@users.noreply.github.com>
2024-02-15 13:04:36 +10:00
Peter Feerick c7b6a13387 revert: 175ab5e pushed to wrong fork
This reverts commit 175ab5ef96.
2024-02-11 21:36:18 +00:00
JimB40 175ab5ef96 Changes to be committed:
modified:   radio/src/lua/api_general.cpp

changed crsfTelemetryPush to support direct commands
2024-02-11 15:01:47 +01:00
dfaad73070 fix: Throttle idle trim handling for surface, enable MT12 tests (#4520)
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
2024-01-21 13:53:25 +10:00
Raphael CoefficandGitHub 317766dab7 fix(lua): Re-implement luaSetSerialBaudrate (#4501) 2024-01-03 13:29:02 +10:00
Raphael CoefficandGitHub 6b1256db66 chores(lua): Generate keys definitions (#3923) 2023-12-20 21:28:40 +10:00
philmozandGitHub 5e97d1d59b chore: Remove unused LS_FUNC_RANGE, TimersContext (#4267) 2023-11-10 16:35:00 +10:00
ca5355e0c7 feat: Add support for Radiomaster MT12 (#4277)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2023-11-04 18:18:17 +10:00
b48e07026d feat: More flexible ADC inputs (#3870)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
2023-11-02 11:07:53 +10:00
philmozandGitHub 1e3f919146 fix(color): 'SWITCH' widget option logic, enable for Lua widgets (#4190) 2023-10-17 07:22:25 +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
MichaelandGitHub 7400a598a1 feat(lua): Add API for overriding speaker volume (#3784) 2023-10-13 11:37:12 +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
MichaelandGitHub 2d8d2fcf01 feat: MIN constant as a source option (#3639)
* feature request #1635

- added MIN (-MAX -> -1024) as source

* fix rebase

* fix rebase

* change to use language strings for MIN/MAX instead of instance

updated CN and TX language file for MINuse -RESX for MIN instead of magi numbercode cleanup

* updated test sources

* updated JP language

* JP language: changed translation text

* updated HE language translations
2023-08-28 20:16:00 +10:00
MichaelandGitHub c2bebfbbd3 fix: Plurals and indefinite articles in German TTS, plus (#3920)
- fixed no LUA constant for unit dbm
- fixed use plurals and indefinite articles in German TTS
2023-08-26 21:09:41 +10:00
3djcandGitHub c2d8291e49 feat: Add support for RadioMaster Pocket (#3892)
* RM Pocket support

* Further Pocket changes

* Production readiness

* chore: Consistent formatting

* chore: `ENABLE_SERIAL_PASSTHROUGH` enables `CLI`

* chore: Add to Buddy

* fix: merge wtf
2023-08-14 12:10:22 +10:00
Raphael CoefficandGitHub 76423370cd fix(lua): Add missing switch constants (#3803) 2023-07-30 14:03:35 +10:00
3djcandMalte Langermann bff3e653fc Fix Colorlcd navigation 2023-06-25 14:32:39 +02:00
3djcandMalte Langermann 29911c6b23 partial TX16s pgup pgdn key fix 2023-06-25 14:32:39 +02: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
MichaelandGitHub 9378e8e252 fix(lua): GV precision not taken into account (#3540)
changes:
- calculate LUA return value for GVARS taking precision into account
2023-05-05 19:45:06 +10:00
RistoandGitHub 0af86f657e feat(lua): Add serial[Get|Set]Power() to LUA API (#3265) 2023-03-17 11:55:10 +10:00
97c57cf9ee feat(colorlcd): Value widget text alignment options (#3080)
* Adds option to align value widget label and value to left, center or right border of the widget zone.

* Cpn sync

* Typofix thx to @Eldenroot

* fix: Add `TW` translation

* fix: Two spaces for indent

---------

Co-authored-by: elecpower <neilh713@tpg.com.au>
2023-02-20 14:57:58 +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 CoefficandGitHub 72193eda82 chore: New module/serial API (#3055)
* WiP: new module interface

* WiP: softserial timer DMA

* WiP: setup() and send() in one step

and remove methods specific to internal or external module

* fixes and extra port config

* horus targets

* module ports have moved

* T8 support (only internal module)

* fix nv14

* stupid GCC....

* disable BT

* remove nv14 telem driver

* remove old aux serial driver

* Move module buffers out of pulses.h

* Soft serial fixes and PXX1 support

* Fixed PPM module output

* Fixed CLI

* compilation fixes

* Ported bluetooth and flysky gimbal to new serial driver

* Re-enable soft-serial RX

* fixes and cleanup

* nv14 fixes

* Fix flysky gimbals

* Ghost module

* 16 bytes of RAM

* Remove getByte from module API

* Ghost cleanup

* fix: _half_duplex_input() must be called after usart init

* WiP

* more cleanup

* Remove board specific settings from PXX1 / PXX2 drivers

* A bit of PXX2 header cleanup

* Add support for OVER8 and ONEBIT

* Add some support for inverters (NV14 / EL18)

* Support NV14 power fixes in generic board

* Fix polarity handling

* Fix RX DMA

* Fix mixer not running

* Add soft-serial polarity control

* Quick fix for telemetry polling while module port is changed

* Fix bootloader DEBUG

* Fix MPM telemetry

* Fix pulse start

* DSM2 soft-serial fallback

* DSMP async module restart

* Fix CRSF LUA upstream

* Remove global variable telemetryProtocol

* Use HAL/LL constants

* Fix various issue with AFHDS3 and NV14/EL18 internal module

* Fixed S.PORT unit tests

* fix: update widx after writing at current index

* fix: init error condition

* Fix: possible infinite loop in _find_port()

* Add support for bidir S.PORT init

* Add support for "getLastByte" in HW serial driver

* PXX1: Add support for S.PORT based on IDLE callback

* Fix rebase error

* Fix softserial _rx_fifo_push()

* Add softserial support for waitForTxCompleted()

* Fix MPM flashing (internal / external)

* Fixed external MPM

* Activate RX DMA on internal module

Seems to work with serial passthrough without issues, at least on the L3R PRO.

* Fix softserial DMA on stdlcd F4 targets

* Add softserial support for 32bit timers (mostly TIM2)

* More precise soft-serial

* Fix MPM update using inverters & HW uart

* Raise S.PORT DMA/USART IRQ prio to achieve faster switching to input

* Remove useless delays

* Fix flashing external ELRS module

* Added a retry mechanism for FrSky S.PORT update

* Remove useless enableRx()

* External FrSky modules are all flashed via S.PORT

* Remove power management unit update

This was only used on the first batch of X-lite.
2023-02-09 19:44:32 +10:00
RistoandGitHub 6af2bb7173 fix(doc): LUA doc link to units.md
* Minor fix to LUA documentation
2023-01-28 12:59:26 +01:00
3djcandGitHub bc8087cbf1 feat: Add Radiomaster Boxer (#2877)
* Radiomaster Boxer

* chore: Add Build system bits

* chore: `EEPROM_VARIANT` no longer used
2022-12-31 16:45:09 +10:00
Malte LangermannandGitHub d134e1a840 chore: Fix a bunch of compile warnings (#2748)
* chore: fix warnings for simu and firmware, part 1

* chore: fix warnings
2022-12-05 20:41:42 +10:00
becbbac2cb feat(lua): Add getTrainerStatus to Lua API (#2483)
* Initial Commit

* Finished Trainer Status

* fix: Bump version number

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-11-30 20:36:58 +10:00
Raphael CoefficandGitHub 8f3dd7f72e fix(lua): Array indexes for get/setFlightMode and getCurve (#2567)
* Lua array indexes start at 1

* LUA model.setFlightMode: use array index to compute trim index

This allows for providing an incomplete table like this:
```
-- Disable T5 & T6 on FM0
modes = {}
modes[5] = 31
modes[6] = 31
t = {}
t["trimsModes"] = modes
model.setFlightMode(0, t)
```

* Remove warning & cleanup

* Fix trim value constraints in model.setFlightMode()
2022-11-30 15:57:42 +10:00
Raphael CoefficandGitHub 6f494e109c feat(telemetry): extend link quality warnings range (#2251)
* feat(telemetry): extend link quality warnings range

* Set default values to the old legacy FrSky values

* Companion support
2022-10-12 14:28:32 +10:00
Jesper FrickmannandGitHub 83fbf1a7f8 feat(lua): Add getSourceValue (#2316)
* 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
2022-09-28 09:42:16 +10:00
David PHAM-VANandGitHub 155a854131 feat(lua): Add several Lua API funcs and constants (#2279)
* LUA: Add Bitmap.toMask and lcd.drawBitmapPattern functions

* LUA: Add lcd.invertRect function

* LUA: Add Bitmap.resize function

* LUA: Add getOutputValue function

* LUA: Add timer showElapsed configuration

* LUA: Add model extendedLimits configuration

* LUA: Add some global constants

* Add model jitterFilter configuration

* Add model.getSwashRing and setSwashRing functions
2022-09-08 20:03:58 +10:00
4e49ac68be feat(colorlcd): Special Function to set main screen (#2160)
* Special Function to set main screen (#2135)

* chore: Add new SF to LUA constants list

* Companion support

* Formatting

* get rid of magic number

* Add function to get the number of custom screens

* Change screen numbering from 0-based to 1-based.

* Allow SetScreen custom function for Color LCD only

* add range protection

* cleanup

* yet, range protection once again

* fix: paintSpecialFunctionLine can't alter SF param data

* Fix screen initialization in companion

* move screen switching to the UI

* Trigger view change from guiMain()

* chore: Change "SET" to "Set" for consistency

* fix: Somehow missed extra comma in `TW`

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
Co-authored-by: elecpower <neilh713@tpg.com.au>
Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
2022-09-07 21:40:34 +10:00
zhaobingandPeter Feerick 0219426b26 Add LR3PRO as an independent target 2022-08-20 10:59:50 +10:00
XINGandPeter Feerick 299991bc11 Add iFlight Commando8
Add iFlight Commando8 ELRS radio
2022-08-16 18:44:57 +10:00
62692dba6a feat: More rotary encoder options for B&W screens (see #2045)
* First build

* Fix X9

* Update api_general.cpp

* Update translations.h

* clean up translations

* fix: B&W option handling, remove magic numbers, cleanup
- Remove references to invertRotary, change to RotEncDir or similar
- Add compatabilty importing to companion, firmware
- Rename Lua API call
- Move magic numbers to enum
- Improve B&W option handling so it doesn't apply changes while in menu

* chore: yaml regen

* fix: Add missing guards for X9D/X9D+

* fix: Wrong enum name in simu

* fix(cpn): Use correct names for UI elements

* fix: Translations

* fix: Allow `rotEncMode` in all yaml due to x9d var
Of the three X9D variants, the X9D+2019 is the only one that
has a rotary encoder as standard. However, as the base config
file is for the X9D, this meant it wasn't reading or writing the
config value. Rather than add a seperate config file for it for
a single variable, simple to just allow it across all targets.

* fix: Companion string, change colorlcd to `Choice`

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-08-04 20:06:17 +10:00
Raphael CoefficandPeter Feerick 8379b47e2b Fix compilation with MULTIMODULE=NO
And allow for Spektrum telemetry to stay enabled (needed for DSMP module).
2022-07-22 20:45:04 +10:00
3djcandPeter Feerick 6010eff024 TX12MK2 initial (external issue with MPM) 2022-07-20 13:01:31 +10:00
Raphael CoefficandRaphael Coeffic f6988c0870 The return of XXL font 2022-06-14 22:58:15 +02:00
Raphael CoefficandRaphael Coeffic 873b8468bd translations: re-added CJK fonts for CN and TW translations 2022-06-11 15:38:08 +02:00
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