Commit Graph
95 Commits
Author SHA1 Message Date
Phil MitchellandMalte Langermann b31180ee52 Fix wrong names being written to radio YAML file for pots & sliders. 2023-06-29 20:50:54 +02:00
Phil MitchellandMalte Langermann 38ec5e4a11 Revert all trim names in YAML files to original values. 2023-06-29 20:50:54 +02:00
Phil MitchellandMalte Langermann f3adc00de0 Add mapping for all old trim switch names. 2023-06-29 20:50:54 +02:00
Phil MitchellandMalte Langermann 5d57afc193 Fix to load old names for trim switches in model files. 2023-06-29 20:50:54 +02:00
3djc 0743b338ae Fix TR shift in yaml reader 2023-06-26 10:17:59 +02:00
3djcandMalte Langermann 784bfa7b7a Fix function switch yaml parser 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 04359757c4 fix: Update built-in Multi-protocol module protocol lists, single source for firmware and cpn (#3435)
* - Concentrated Multi protocol definitions into a consistent single source. Actually two .h files, one for the protocol list and names, the other for subtypes and capababilites, see comments in .h files as to why

- updated available protocols reflecting 1.3.3.20 (15+ protocols)
- fixed Companion always showing f/s and channel map options in model setup disregarding the protocol capability

* Following @pfeerick's review: changed heaeders and typos

fixed Ubuntu runtime error on assert
fixed change of Multi protocol not triggering writing yaml file

* corrected copy/paste error

* fixed FrSky index juggling

* Updated Multiprotocol database to current MPM project status (ref. MPM Multiprotos.ino)

- changed protocol name FX816 to FX
- added Flysky AFHDS2A options PPM and PPWM SBUS 16ch subtypes "PWM,SB16" and  "PPM,SB16
- added V761 option to select TOPRC
- added FX options "816" and "620"
- added FRSKYR9 option "-- 8ch"

* MPM protocol scan excludes some protocols which are not meant to be selected. For Companion and Simualtor (and for radios if there is no MPM connected) this was handled in different places with outdated information. Harmonized and centralized the handling of non-selectabale protocols into the single source for all companion, Simulator and all gui types.

* More cleanup:

- changed some MPM protocol names to the ones the MPM delivers with MPM protocol scan to harmonize names between CPN/Simulator/radio
- added XN2927DUMP and MOULDKG to the list of excluded MPM protocols just like the MPM does with MPM protocol scan
- added new option value limits and moved definitions to single source
- adapted CPN and radio to use common definitions of option values for all GUI types
- moved distributed MPM (as far as possible) to one coherent place under a single #if defined (MULTIMODULE)
- fixed option value not reset at change of protocol
- some editorial stuff

Note: There is still some work to be done on CPN GUI option values. DSM2 servo rates are hard coded, BAYANG telemetry options are only shown by index and not by text as in radio code, AFHDS2A servo update rate is shown as index too which is to no use for users.

I'll try to fix all this in the next session, but request to get rid of BAYANG telemetry options translations. It is much easier to define a common string list by using untranslated.h

* rebase due to fr.h

* resolve merge conflict with main fr.h

* more cleanup:

- deleted multiple definition of MM_RF_CUSTOM_SELECTED in favor of single source define
- bw radios: change to only allow defined protocols rather than a fixed 127 protocols

* Changes:

- magic sentinel number 0xfe as define
- add 10 NN protocol entries for future use of new MPM protocols not yet defined in ETX (still recommend timely ETX maintenance update if MPM releases new firmware)

* Changes by @elecpower:

- align field labels to radio
- change servo update frequency from combo box to spin box with edit only via up/down arrows to stop invalid values being entered via keyboard. Remove frequency list used to populate combo box as only used by Companion.
- add validation to module yaml decode checking for unsupported multi protocols and/or multi protocol sub types and if unsupported set module to OFF just to be safe.

* Changes:

- radio: added validation to module yaml decode checking for unsupported multi protocols and/or multi protocol sub types and if unsupported set module to OFF just to be safe.

* CPN: use sentinel define

* cpn: Sort multi protocols list (courtesy @elecpower)

* fixes #3480

changes:
- moved FrSky subtype defines to MultiProtoDefs.h
- updated bind_button_driver.cpp

* missed replacing one instance of setMultiProtocol()

* changes:

- editorial change
- added multi option to OMP protocol (ref #2713)

* rather go for STR_MULTI_RFTUNE because MPM manual talks about RF tune

* made XN297_DUMP selectable (available with MPM debug fw only)

* corrected merge mistakes
2023-05-22 20:07:29 +10:00
MichaelandGitHub 5db37e2a2b feat: Support for ext. Multiplex MLink JR type module (#3352)
* introducing external MLink module telemetry as module PPM subtype

* implemented fix for sensor discovery display not showing all detected sensors (is in separate PR too)

implemented PPM subtypes in Companion

* add PPM subtype to model printer

finalize subtypes for PPM in Companion

* added logic to try to use HW UART with inverters turned off first (e.g. NV14), then, if not successfull use soft serial inverted (== uninverted data due to HW inverters on PCB)

changed start bit detection IRQ priority from 5 to the previous 0 (also in separate PR)

* extended telemetry timeout to 2s due to slow Mlink RSSI update rate

* changed the "NOTLM" sub-type texts to:

- "No Telem" for 128x64 (this is the max numbers of characters it can take)
- "No Telemetry" everything else including Companion

* Companion:

- lower case 1st charachter on PpmSubTypeStrings to ppmSubTypeStrings
- added telemetry hooks for ppmSubTypeStrings stringx

* simplified serial port initialization for MLink telemetry

* editorial change: corrected obsolete comment
2023-05-16 11:22:47 +10:00
philmozandGitHub 227780d784 feat: Add 'repeat' option to 'Lua Script' special function (#3338)
* Add support for the '1x' repeat option for 'Play Script' special functions.

* Add Companion and B&W radio support.

* Fix B&W radio logic and layout.

* Add translation hooks.
2023-04-10 11:00:50 +10:00
Malte LangermannandGitHub ae6dc8ea27 fix(yaml): Potential unaligned access when reading/writing switch warning positions (#3232)
It IS unaligned for the X9E
2023-02-22 20:44:32 +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
46cc979875 fix: Regenerate yaml, carryTrim => trimSource cleanup (#3121)
PR #2995 didn't take into account the data model storage actually does change when you change a variable name. 
Boxer yaml generation was missed in earlier PR. 

* chore: Run `generate-yaml.sh`

* chore(cpn): carryTrim -> trimSource

* fix(build): Boxer missing from `generate-yaml`

* dodgy attempt to read old carryTrim

* fix: Don't break the byte boundary + reorder

* fix(yaml): indentation for attributes that should not be output

* chore: Regenerate YAML after rebase

---------

Co-authored-by: raphaelcoeffic <raphael.coeffic@frafos.com>
2023-02-05 13:46:02 +10:00
Raphael CoefficandGitHub 57bf180a9b feat(mpm): remove FrSky special treatment madness (#3032) 2023-01-26 11:44:46 +10:00
philmozandGitHub 7dc2f89917 fix(ui,cpn): Error in value conversion when loading LS data (#3026)
* Fix error in value conversion when loading logical switch data from YAML files (for 'Edge' and 'Timer' functions).

* Remove debug print.

* Fix handling of telemetry sensors in Companion.
2023-01-17 14:35:13 +10:00
Raphael CoefficandGitHub f9bac7ba9b chore: Remove support for binary storage format (#2900) 2022-12-23 13:05:57 +10:00
Raphael CoefficandGitHub 06c359f096 feat(ACCESS): Configure AUX serial port as "External module" (#2562)
* Enable RX DMA on external module USART

* feat(ACCESS): configure AUX serial port as "External module" (#2562)

This allows configuring the external access mod on runtime rather than by compilation option.

* fix: fetch external module driver
2022-12-14 18:41:32 +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
RistoGitHubNiel Horne (elecpower), Raphael Coeffic (raphaelcoeffic) and Peter Feerick (pfeerick).
9dc4065525 feat: Add support for SpaceMouse mod (6D input knob) (#1853)
Use `-DSPACEMOUSE=YES` CMake option to activate on Horus color targets.
Co-authored-by: Niel Horne (elecpower), Raphael Coeffic (raphaelcoeffic) and Peter Feerick (pfeerick).
2022-09-18 09:23:48 +02: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
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 CoefficandGitHub c2dc4e6c0b YAML: avoid forcing to add parser for non-existing old format v220 (#2068) 2022-06-21 06:45:35 +02:00
rotorman ae265b6f94 Bugfix missing YAML padding. 2022-04-20 19:32:23 +02:00
rotorman b1a3bc834f User controllable serial port power.
Thx to @raphaelcoeffic for numerous tips with YAML.
Tested with TX16S mkII.
2022-04-18 13:19:33 +02:00
Raphael CoefficandGitHub b9077c7e5a fix: Quote Stick, Pot, Slider and Switch names (#1754)
* Quote stick names

Resolves #1749

* Fix pot, slider and switch names as well.
2022-03-31 10:39:39 +10:00
Raphael CoefficandRaphael Coeffic 2c6bd12c6e Fix module YAML format 2022-03-24 10:40:17 +01:00
Raphael CoefficandRaphael Coeffic 9d5cd1876c Added support for Lemon-Rx DSMP 2022-03-24 10:40:17 +01:00
Raphael CoefficandRaphael Coeffic 86d1ca4364 Reorganize module type/subType/rfProtocol 2022-03-24 10:40:17 +01:00
Peter Feerick e0a1dca5cc Read telemetryBaudrate into internalModuleBaudrate 2022-03-22 15:48:59 +10:00
3djcandRaphael Coeffic 4039069bb7 YAML fixes 2022-03-21 11:48:50 +01:00
Raphael Coeffic 6b9c4fe165 Split UART_MODE_NONE and UART_MODE_DEBUG 2022-03-20 16:30:59 +01:00
Raphael Coeffic 73cfa8402e Fixed serial port YAML writing 2022-03-20 16:30:59 +01:00
Raphael Coeffic de43d7e77c Try to fix the trainer mode mess 2022-03-20 16:30:59 +01:00
Raphael Coeffic f1dc564c76 Read old auxSerialMode & aux2SerialMode 2022-03-20 16:30:58 +01:00
Raphael Coeffic b5779f2a6a More generic serial port config 2022-03-20 16:30:58 +01:00
Raphael CoefficandGitHub 610326f216 Write 'semver' tag with the current firmware version (#1695)
And remove `version`/`variant`.
2022-03-20 19:18:01 +10:00
a1e7d70722 chore: Clean up some issues introduced in #1363
* Clean up some errors introduced in PR #1363

- Cleaning up bad YAML definitions
- Reverted renaming of 'jitterfilter' radio setting in storage/conversions/yaml/ files

* Add a custom attribute to allow for backward compatibility

* Prevent custom attributes without a 'write' function to output a tag

* companion - read but don't write old name

Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-03-16 18:07:26 +10:00
Jesper FrickmannandGitHub d427817363 fix: Negative GVs being misread and written on transmitter (#1516) 2022-02-01 10:22:26 +10:00
Raphael Coeffic 257d25b5eb Updated generated YAML parser files
And added the "ghost" union member to the selector.
2022-01-22 13:43:30 +01:00
Raphael Coeffic 91a676b64f Fix compiling with DSM2=OFF and MULTIMODULE=OFF 2022-01-10 16:23:32 +01:00
Raphael Coeffic eb1e3078c8 Fix index for negative GVARs 2022-01-01 12:35:29 +01:00
Raphael Coeffic 8e69976dbb Skip calibration data for invalid analogs 2021-12-31 18:41:59 +01:00
Raphael Coeffic 7a66c3413a Fixed YAML GVAR based values 2021-12-31 10:53:11 +01:00
Raphael Coeffic d98a697aca Add "board" field and remove a few useless ones 2021-12-31 10:53:09 +01:00
rotormanandRaphael Coeffic 89517d8bd8 Use ETX instead of OTX (also as a file extension). 2021-12-31 10:53:08 +01:00
Raphael Coeffic 20961e460b Use double quotes around switches to avoid escaping with backslash
Escaping with backslash arbitrary characters seems to be an issue with most YAML parsers.
2021-12-31 10:52:20 +01:00
Raphael Coeffic 587e64f76a Fix potential YAML format issue by enclosing "def" value in double quotes 2021-12-30 13:55:06 +01:00
Raphael Coeffic 710677a1f7 Use existing function to generate switch name in YAML switch warning field 2021-12-17 11:02:51 +01:00
Raphael Coeffic 865cf06b0d Revamped switch state checking 2021-12-09 09:20:01 +01:00
Raphael CoefficandGitHub 995e41469e Fixed "lua(...,...)" source (#1208)
Resolves #1205
2021-12-04 14:37:03 +11:00