Commit Graph
159 Commits
Author SHA1 Message Date
3djcandPeter Feerick dc1bc4cef2 fix: MPM update timings due to faster F4 MCUs (#5124) 2024-06-05 07:42:32 +00:00
3djcandGitHub 4628ccce9e feat: only allow flash when target matches (#4770) 2024-03-25 10:42:29 +10:00
Raphael CoefficandGitHub 5153aaeea0 refactor: IWDG driver and EM trigger (#3846) 2023-12-04 07:14:25 +10:00
Raphael CoefficandGitHub 6d3aa573d4 fix(yaml): Do not limit to static MPM protocol definitions (#4146) 2023-10-18 19:24:21 +10:00
3djcandGitHub 2295148ed9 fix: Missing OTA option for newer Archer receivers (#4185) 2023-10-10 10:12:28 +10:00
Raphael CoefficandGitHub 3cbcc6b7bf feat: Automatic soft-serial fallback for module ports (#3823) 2023-10-07 12:23:51 +10:00
Raphael CoefficandGitHub 99f4e4816b fix: iXJT firmware update (#4068) 2023-09-20 05:48:04 +02:00
MichaelandGitHub ec5ab0b87c fix: Reset proto scan software timer to MULTI_PROTOLIST_START_TIMEOUT (#3763)
reset proto scan software timer to MULTI_PROTOLIST_START_TIMEOUT if timer already exists (from previous scan)
2023-07-10 20:29:34 +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
MichaelandGitHub fa490e5adb fix: external MPM flash (#3671) 2023-06-20 11:39:43 +10:00
MichaelandGitHub 8893db2726 fix: MPM protocol options missing for some protocols (#3504)
* fixes #2713

changes:
- use getMultiOptionTitle() instead of rfproto->getOptionStr() as getMultiOptionTitle() takes updated MPM status in account

* code cleanup: removed obsolete functions

* fix #3046

* fixed my complete misunderstanding of how the chosen protocol is updated in Multi DSM auto mode

* removed obsolete check

* update subType list only on rf protocol change

added some comments

* reconsidered implementation utilizing  LV_EVENT_REFRESH to avoid sporadic loss of update

* editorial change

* fix problem where a successful MPM DSM2 auto bind would reset the receiver ID

* reset DSM2autoUpdated just in case
2023-05-23 10:05:12 +10: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
Raphael CoefficandGitHub cb43cf75b9 fix: Flashing internal ISRM and via S.PORT connector (#3374)
* fix: re-enabled flashing via S.PORT connector

* fix: remove check for productId on internal module
2023-03-26 11:30:01 +10:00
Raphael CoefficandGitHub e016598b56 fix: Various mostly X10E soft serial issues (#3382)
* fix: pulse driver with 32bit timers

* fix(mpm): clear RX buffer before signature

* fix: add some debouncing on soft-serial start bit detection

This helps coping with spurious impulses on S.PORT created by payload sent over PPM pin (X10E).

* fix: whenever the RXNE bit is set, read the register

... regardless of errors. That allows for reducing the effect of detected errors.
2023-03-26 11:23: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
Raphael CoefficandGitHub 57bf180a9b feat(mpm): remove FrSky special treatment madness (#3032) 2023-01-26 11:44:46 +10:00
Raphael CoefficandGitHub acd95dfad4 fix(B&W): Avoid having constants in SRAM (#2993)
fix constness to avoid having constants in data segment 
.... and thus free some precious RAM
2023-01-18 20:12:35 +10:00
Raphael CoefficandGitHub 2067140552 fix(isrm): flashing internal ISRM module (#2596)
Fixes #1552
2022-10-19 21:13:48 +10:00
Raphael CoefficandGitHub c7e77ccd36 fix(mpm): update internal module (#2314)
* Internal MPM update: UART context must be removed last

This fixes the crash / reboot observed in issue #2310

* Fix DMA fifo clear() method
2022-09-14 11:58:01 +10:00
b4e1ceb4f8 fix(MPM): Various UI elements for MPM opts weren't updating correctly (#2209)
* fix: Get current values for MPM options

* fix: Don't show sub-proto dropdown when empty

* Add suggested call to `update()`

* Add callback to refresh when subtype changed

* Trip `SetValueHandler` rather than setting value
Thank you to @raphaelcoeffic for the hint ;)

* fix: Saving values when changed is a good idea!

* Load option flags properly when using internal proto list

* NumberEdit fields don't implement LV_EVENT_VALUE_CHANGED, use update() instead

* Fix checkbox behaviour

* Fix autobind checkbox after switching away from DSM

* Fix more parameter needing update on MPM sub-proto changes

* fix: Also update servo rate if present

* fix: Channel mapping needs updating also

Co-authored-by: Raphael Coeffic <raphael.coeffic@frafos.com>
2022-09-05 21:56:24 +10:00
Raphael CoefficandRaphael Coeffic 66e08da1b8 Fixes for targets without external module 2022-08-11 12:15:46 +02:00
Raphael CoefficandRaphael Coeffic 8f85097c90 MPM proto scan: use RTOS timers instead of polling for timeout 2022-08-11 12:15:46 +02:00
Raphael CoefficandRaphael Coeffic f952c5f7c7 Internal and external module buffers are now private 2022-08-11 12:15:46 +02:00
Raphael CoefficandRaphael Coeffic 0a38120024 Fixed MPM protolist after rebase 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic f6565c6826 Horus fixes 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic f39f7a87ed Use static MPM protolist on simu
Resolves #1793
2022-04-18 10:18:17 +02:00
Raphael Coeffic d318f6d9bd MPM firmware update again... 2022-03-27 17:19:05 +02:00
Raphael Coeffic 1017172350 Fix MPM firmware update 2022-03-27 17:03:41 +02:00
Raphael Coeffic a994fc708a WiP internal module buffer 2022-03-25 18:15:56 +01:00
Raphael Coeffic 59191f37c3 Use software timers to trigger telemetry processing 2022-03-25 16:50:00 +01:00
Peter FeerickandGitHub c327c6c0db fix: TPro FS showing in global funcs and MPM protocol list updates (#1705)
* Init contrast earlier for 128 B&W screens
https://github.com/opentx/opentx/pull/8882

* fix: TPro - No FS in global functions
https://github.com/opentx/opentx/pull/8845

* Missing IS_SWITCH_FS defintions

* Update MPM fallback SUBTYPE and OPT strings

* Custom MPM proto should not be processed
2022-03-21 20:57:04 +10:00
Raphael Coeffic 530d395204 WiP 2022-03-20 16:22:14 +01:00
Raphael Coeffic 025659ac36 Add support for RX DMA 2022-03-20 16:22:14 +01:00
Raphael Coeffic e5c852ab37 Fixed some compilation issues 2022-03-20 16:22:12 +01:00
Raphael Coeffic ffefd0f6dd External serial driver moved to a separate driver 2022-03-20 16:22:12 +01:00
Raphael Coeffic 803b472c85 Move all serial internal module functions into proper drivers 2022-03-20 16:22:12 +01:00
Raphael Coeffic f733810c79 WiP: refactor serial ports 2022-03-20 16:22:12 +01:00
WilhelmandGitHub 67d4a29e31 chore: Replace fixed strings with translation for device-flash-dialogs (#1372)
* replaced fix strings with translations

* additional strings

* replaced wrong german string to english in all but german translations

* fixed spelling
2022-02-11 10:27:05 +10:00
Peter FeerickandGitHub 6e51c70aa7 Reduce code repetition for sd browser firmware update handling, add some .frsk entries (#543)
* Hacky port of FRSKY_FIRMWARE_EXT update menu
More work is needed to integrate/test the remaining menu items
May just ba a matter of correct parameters for deviceFirmwareUpdate

* Functionalise, of sorts

* Formatting

* Functionalise more repeated update code
2021-11-22 17:01:22 +11:00
Raphael CoefficandRaphael Coeffic 1fe4876786 Revert ModuleFifo size to original (PXX2_FRAME_MAXLENGTH = 64) 2021-11-21 11:18:35 +01:00
Raphael CoefficandRaphael Coeffic 73790c1654 Use FreeRTOS stream buffers and task notifications 2021-11-21 11:18:35 +01:00
Raphael CoefficandRaphael Coeffic 59f2b5e8b0 Temporary boosting the ModuleFifo to 128 bytes
This is to better cope with the CRSF frames that need to contain 64, whereby Fifo has a maximum content length of (N-1).
2021-11-21 11:18:35 +01: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 CoefficandPeter Feerick f401cd4a12 [color] use own protocol counter
Overloading the frame counter causes aa race condition with the UI thread (see SEND_FAILSAFE_1S()).
2021-09-18 11:57:23 +10:00
Raphael Coeffic c2588efbca Prevent proto list to be fetched when started in anything but "normal" mode 2021-09-17 11:15:33 +02:00
Raphael Coeffic 34677d0148 Invalidate MPM cached proto list on firmware upgrade 2021-09-11 12:10:05 +02:00
Raphael Coeffic ba906e1d5d [color] Dynamic MPM proto list 2021-09-11 11:10:00 +02:00
Raphael CoefficandRaphael Coeffic 351173a509 Various fixes around flashing bootloader 2021-05-29 13:34:25 +02:00
Raphael CoefficandRaphael Coeffic 8e57090d66 Use real bootloader size when flashing 2021-05-29 13:34:25 +02:00
Raphael CoefficandRaphael Coeffic 954758c770 Allow flashing a bootloader which does not end on 1KB boundary or is shorter than the maximum size
Resolves #75
2021-05-29 13:34:25 +02:00