Commit Graph
74 Commits
Author SHA1 Message Date
b22a1b5d32 feat: Support for WS2812 RGB LEDs (#3909)
Co-authored-by: 3djc <lesitewebdejc@hotmail.com>
2023-10-14 14:06:55 +10:00
philmozandGitHub a60cf67fb2 fix(radio): Lua insertMix function not working (#4129) 2023-09-29 11:34:34 +10:00
47ff7284fd fix(radio): Better iteration through mixers on display, sanitize invalid sources (#3999)
* fix: mixer lines with empty source

Fixes #3367

* Fix color mixes display.

---------

Co-authored-by: Phil Mitchell <phil.a.mitchell@gmail.com>
2023-09-24 15:51:18 +10:00
Preston GuilloryandGitHub d8cfa671e5 fix(lua): Include scale in getInput and insertInput (#3772)
* Include scale in getInput and insertInput

When using telemetry as an input, the scale field is used to convert from a
value with units (like volts or meters) to a percentage. I'd like to modify an
input's scale via Lua script. However this field does not seem to be supported
by the Lua API. This seems like an oversight, so I added it.

* chore: Add scale luadoc
2023-08-26 19:52:22 +10:00
Raphael CoefficandGitHub 574369aca4 fix: Use keysGetMaxTrims() instead of MAX_TRIMS (#3860)
* fix: use keysGetMaxTrims() instead of MAX_TRIMS

* feat: add support for virtual trims

This is necessary for radios like X-lite where half of the trims are simulated
2023-07-30 14:18:58 +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
altemanandGitHub 97deeeb4d3 fix(lua): Support changing module type from model.setModule() (#3699) 2023-06-20 19:03:33 +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
Raphael CoefficandGitHub 57bf180a9b feat(mpm): remove FrSky special treatment madness (#3032) 2023-01-26 11:44:46 +10:00
eshifriandGitHub 8e8e78671a feat: Timer Voice & Haptic option, show elapsed speak time value when countdown (#2711)
* fix "odd" elapsed time announcement

* announce elapsed seconds

* Add support for "Beeps and Haptic" and "Voice and Haptic" for timer countdown.
2023-01-23 20:00:12 +10:00
3djcandGitHub 8ee73a5800 fix(lua): Remove faulty carryTrim, replace with trimSource (#2995)
* Fix carryTrim in LUA

* Remove carryTrim
2023-01-15 11:54:57 +10:00
philmozandGitHub 1bffd260a0 fix(lua): Add missing switch and countdownStart properties (#2979)
Add the switch and countdownStart properties to the getTimer and setTimer Lua functions.
2023-01-08 11:02:55 +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
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
Raphael CoefficandRaphael Coeffic 86d1ca4364 Reorganize module type/subType/rfProtocol 2022-03-24 10:40:17 +01: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
rotormanandRaphael Coeffic 89517d8bd8 Use ETX instead of OTX (also as a file extension). 2021-12-31 10:53:08 +01: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
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 56542bf7e8 Some fixes for simu 2021-07-31 17:31:50 +02:00
Raphael Coeffic b0fb80b264 ZChar nightmare / take 2 2021-06-09 09:24:48 +02:00
Raphael Coeffic 493b9aaedc Fixes issue with model LUA API strings 2021-06-04 20:43:02 +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 2f5b522413 Merge branch '2.3' into 2.4 2021-05-16 12:55:21 +02:00
c06b789f5c Multi module config support (#8438)
* Multi module configuration

Co-authored-by: Pascal Langer <pascal_langer@yahoo.fr>
2021-05-05 15:46:29 +02:00
Raphael Coeffic 2f5dd1d4e3 modelDefault() becomes setModelDefaults() 2021-04-09 15:10:11 +02:00
Raphael Coeffic 3464d0d109 clearInputs() has been moved out of defaultInputs()
But we should keep a consistent behaviour in the LUA API.
2021-04-09 08:09:50 +02:00
Bertrand Songis 72feef3911 All my comments from the PR fixed. Still missing the Companion part 2021-02-01 23:02:52 +01:00
Bertrand Songis a02bf3aa0c Merge with latest 2.3 2021-01-12 17:16:15 +01:00
Jesper FrickmannandGitHub a9179d1357 Updated documentation for getSensor (#8161) 2020-12-13 08:19:31 +01:00
Jesper Frickmannand3djc 6ba4187381 Added model.resetSensor(sensor) function
Issue #7562
2020-12-10 13:33:34 +01:00
3djc 19b4c687ee cosmetics 2020-12-09 18:28:44 +01:00
Jesper FrickmannandGitHub b320e9f884 Added model.resetSensor(sensor) function
Issue #7562
2020-12-03 19:53:34 -05:00
3djcGitHub3djc <Th1sisfmyofmyo>
87cd9047b1 2.4 continued (#8092)
Quite a bit of work on 2.4

Co-authored-by: 3djc <Th1sisfmyofmyo>
2020-11-14 14:55:37 +04:00
3djcandGitHub 099d5cb30c Fix insertMix (#8066) 2020-10-30 17:00:17 +01:00
Bertrand Songis 42a3198568 Merge with latest 2.3 2020-10-07 21:01:45 +02:00
3djcandGitHub fcedcb9c56 LUA improvement (#7878)
Add FM handling to LUA
2020-08-28 17:05:40 +02:00
Bertrand Songis bddccb9765 Merge with latest 2.3 2020-05-30 11:57:03 +02:00
3djcandGitHub 8ae2f4f782 Multi channels naming tool (#7538)
Mostly-authored-by: Pascal Langer <planger@mathworks.com>
2020-04-22 19:23:32 +02:00
Bertrand Songis 1d96af49c4 Merge with latest 2.3 2020-03-18 17:09:38 +01:00
3djc e26abb5650 Fix #7428 2020-03-08 11:54:34 +01:00
Bertrand Songis 6878ae4a9f Merge with latest 2.3 2020-03-05 10:43:01 +01:00
3djcandGitHub 40d57a8853 Add name handling to LUA timer functions (#7358)
Add timer name to LUA timer functions
2020-02-06 14:36:21 +01:00
Bertrand Songis ae548b9814 New UI continued 2019-10-05 19:01:57 +02:00
Bertrand Songis 82577ed621 Module subType fixes 2019-09-03 21:04:37 +02:00
Bertrand Songis 1efd3cbefa Cosmetics 2019-06-13 17:14:59 +02:00
lshemsandBertrand Songis 747e6131bc Update api_model.cpp (#6492)
Added carryTrim to input API's
2019-06-13 17:07:07 +02:00
Bertrand Songis d5ce54047c The script for SBEC now searches for a SBEC sensor 2019-04-01 18:48:14 +02:00