Commit Graph
885 Commits
Author SHA1 Message Date
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
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
MichaelandGitHub 34ea422e39 chore: freeRTOS task stack diagnostics (#2976)
* migrated stack diagnostics (available, free) to using built in FreeRTOS builtin function

Note: main stack must be and is treated differently as it is not under FreeRTOS control. main stack is painted by the STM32 startup routine. free main stack is calculated checking the remaining painted stack area.

* corrected my merge error

* missed a blank
2023-01-15 11:48:04 +10:00
Raphael CoefficandRaphael Coeffic 042d5091f2 HAL/LL: Generic EXTI & trainer driver
Changes:
- generic EXTI driver
- generic trainer driver
- relocated rotary encoder timer (simple 100us delay) from TIM4 to TIM12
- taranis & horus use now TIM4 for trainer pulses
- serial driver handles periph clocks for UARTs

TODO:
- SBUS on heartbeat pin (USART or soft-serial)
2022-12-10 13:37:31 +01:00
Raphael Coeffic d6764ca0f8 fix: prevent out of bounds access if g_eeGeneral.templateSetup has an invalid value 2022-09-20 08:05:34 +02: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
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
RJMcIntyandGitHub 7cff5ef97a feat: Audio prompt when min and max trim reached (#1955)
- Plays "Minimum/Maximum trim reached" audio every when trim limit reached and when repeatedly pressed
- Partially fixes issue where extended trims were not being reset when option changed
2022-07-14 19:36:01 +10:00
Raphael CoefficandRaphael Coeffic 0b8d93ca88 WiP: support for LSM6DSxx 2022-06-25 16:09:04 +02:00
Raphael CoefficandRaphael Coeffic df83a82285 EEPROM & Digital Volume I2C driver using generic I2C HAL driver 2022-06-25 16:09:04 +02:00
Raphael CoefficandRaphael Coeffic ac84ac1397 Fix & simplify fatal screens 2022-06-17 05:34:47 +02:00
Raphael CoefficandRaphael Coeffic 3ae39a3050 Add inactivity counter reset to LVGL device drivers 2022-06-13 22:43:45 +02:00
Raphael CoefficandRaphael Coeffic e31a1cc1fc Input & Mixer edit pages: flex layout rework 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic c5160d8102 fix: disable rotary encoder polling in per10ms() only for stdlcd targets 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic 4c8bb99e73 Replaced focus handling with LVGL groups 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic 12f51350ce Scrolling is now handled 100% by LVGL 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic f6565c6826 Horus fixes 2022-06-11 15:38:08 +02:00
gagarinlgandRaphael Coeffic 89ff8c53f4 fix shutdown animation 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic 56bec5ca3a WiP: String arrays for translations
DE, EN, FI, FR are done, now we need all the other languages
2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic ee0c37157d Remove legacy fonts and make the bootloader compile with LVGL 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic 86152da85d Remove scratch buffer 2022-06-11 15:38:08 +02:00
Raphael CoefficandRaphael Coeffic b40441f0c0 WiP: remove legacy fonts 2022-06-11 15:38:08 +02:00
kkoenig1@optonline.comandRaphael Coeffic fd276bb2fc 1. Included mroe fonts
2. change order of initialization.  Lvgl has to be before ViewMain
3. Basic support for layers, but they are still broken when Menu's are used
4. Register input driver in lvglwrapper
2022-06-11 15:38:08 +02:00
gagarinlgandRaphael Coeffic fb7a7364a4 just something to play with lvgl
simu is working partially
TX16S has worked, is now broken, due to changes to make simu work

working means, lvgl shows something on the display and handles touch events

to stop libopenui from interfering this is needed in libopenui:

diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 09cc3d3..cda095f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -79,7 +79,7 @@ void MainWindow::checkEvents()
   if (touchPanelEventOccured()) {
     short lastDeltaX = touchState.lastDeltaX;
     short lastDeltaY = touchState.lastDeltaY;;
-    touchState = touchPanelRead();
+    //touchState = touchPanelRead();
     touchState.lastDeltaX = lastDeltaX;
     touchState.lastDeltaY = lastDeltaY;
   }
@@ -177,6 +177,7 @@ void MainWindow::invalidate(const rect_t & rect)

 bool MainWindow::refresh()
 {
+return false;
   if (invalidatedRect.w) {
     if (invalidatedRect.x > 0 || invalidatedRect.y > 0 || invalidatedRect.w < LCD_W || invalidatedRect.h < LCD_H) {
       TRACE_WINDOWS("Refresh rect: left=%d top=%d width=%d height=%d", invalidatedRect.left(), invalidatedRect.top(), invalidatedRect.w, invalidatedRect.h);

add eclipse projetc files and helper scripts

some cleanup and fix simu

NV14 simu and TX16s simu are working with lvgl
no more magic numbers
added files for a lvgl wrapper class for initialization

moved lvgl initialization to LvglWrapper
code cleanup
started implementing a widget as a drawing target for libopenui

with some additional changesin libopenui, the libopenui ui can be displayed on a lvgl canvas

fix lvgl full screen canvas

update personal project files

add file with patch instructions for libopenui

works on NV14 with a canvas as the drawingtarget for libopenui and direct touch handling by libopenui

fix indentation

enabled double buffering for LVGL using the LCD frame buffers
transparancies are broken on TX16s
simulator does not work
untested on NV14

simu for NV14 and TX16S run and work mostly
works mostly on NV14 and TX16S

some pop ups (e.g. USB) flicker
LUA full screen apps won't display anything

touch handling still done by libopenui
on TX16S lvgl widgets are rotated by 180°

untested on all other radios

fix using of commeted out function. No touch handling for LVGL right now

rotate screens, so that libopenui and LVGL have the same screen rotation

removed the need to rotate images and fonts when using LVGL
currently the changes can be easily reverted

deleted lvgl copy

building with lvgl as unmodified submodule works

move lv_conf to radio/src

delete eclipse project files

use specific branch for lvgl

use libopenui lvgl branch
remove now unneeded help.txt

add missing file to colorlcd CMakelist

fix image display problems in TX16S simulator

just something to play with lvgl
simu is working partially
TX16S has worked, is now broken, due to changes to make simu work

working means, lvgl shows something on the display and handles touch events

to stop libopenui from interfering this is needed in libopenui:

diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 09cc3d3..cda095f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -79,7 +79,7 @@ void MainWindow::checkEvents()
   if (touchPanelEventOccured()) {
     short lastDeltaX = touchState.lastDeltaX;
     short lastDeltaY = touchState.lastDeltaY;;
-    touchState = touchPanelRead();
+    //touchState = touchPanelRead();
     touchState.lastDeltaX = lastDeltaX;
     touchState.lastDeltaY = lastDeltaY;
   }
@@ -177,6 +177,7 @@ void MainWindow::invalidate(const rect_t & rect)

 bool MainWindow::refresh()
 {
+return false;
   if (invalidatedRect.w) {
     if (invalidatedRect.x > 0 || invalidatedRect.y > 0 || invalidatedRect.w < LCD_W || invalidatedRect.h < LCD_H) {
       TRACE_WINDOWS("Refresh rect: left=%d top=%d width=%d height=%d", invalidatedRect.left(), invalidatedRect.top(), invalidatedRect.w, invalidatedRect.h);

add eclipse projetc files and helper scripts

some cleanup and fix simu

NV14 simu and TX16s simu are working with lvgl
no more magic numbers
added files for a lvgl wrapper class for initialization

moved lvgl initialization to LvglWrapper
code cleanup
started implementing a widget as a drawing target for libopenui

with some additional changesin libopenui, the libopenui ui can be displayed on a lvgl canvas

fix lvgl full screen canvas

update personal project files

add file with patch instructions for libopenui

works on NV14 with a canvas as the drawingtarget for libopenui and direct touch handling by libopenui

fix indentation

enabled double buffering for LVGL using the LCD frame buffers
transparancies are broken on TX16s
simulator does not work
untested on NV14

simu for NV14 and TX16S run and work mostly
works mostly on NV14 and TX16S

some pop ups (e.g. USB) flicker
LUA full screen apps won't display anything

touch handling still done by libopenui
on TX16S lvgl widgets are rotated by 180°

untested on all other radios

fix using of commeted out function. No touch handling for LVGL right now

rotate screens, so that libopenui and LVGL have the same screen rotation

removed the need to rotate images and fonts when using LVGL
currently the changes can be easily reverted

deleted lvgl copy

building with lvgl as unmodified submodule works

move lv_conf to radio/src

delete eclipse project files
2022-06-11 15:38:08 +02:00
d9b51f8ecf feat: Deadzone option for NV14 sticks (#1777)
Imported from open-flysky/Flysky-OpenTX-Test-Branch

* companion: Don't nuke `stickDeadZone` setting

* Implement data storage properly

* Add missing check for NV14 storage struct sizes

* Formatting

* Use one less byte in the packed data struct
Thanks @raphaelcoeffic :)

* Move setting of stickDeadZone default

* Use a Choice combo rather than NumberEdit

* Good riddance magic number

* Also set default stick zone if setting is missing

* Teach tests about `STICK_DEAD_ZONE`

* Tweak choice width

* Cpn NV14 add stick dead zone to hardware and section labels

* Cpn NV14 align default pot names to radio

Co-authored-by: elecpower <neilh713@tpg.com.au>
2022-04-06 10:30:20 +10:00
Peter FeerickandGitHub d7d1e446bd fix: Only use delayed failsafe check with MPM (#1786) 2022-04-03 09:17:07 +10:00
MichaelandGitHub 06585a0736 feat: Reset inactivity alarm timer for touch events (#1774) 2022-03-31 11:46:32 +10:00
Raphael Coeffic 530d395204 WiP 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
Raphael CoefficandGitHub 610326f216 Write 'semver' tag with the current firmware version (#1695)
And remove `version`/`variant`.
2022-03-20 19:18:01 +10:00
kobatanandGitHub 7ba936bb96 fix: PXX2 radios were initialising default ownerRegistrationID incorrectly 2022-03-18 10:51:43 +10:00
Peter FeerickandGitHub 7abc59e626 feat: Pressing power button resets backlight timeout (depending on opts) (#1676)
* Power button resets backlight timer on colorlcd

* Link to backlightMode opt, and not just colorlcd
2022-03-16 21:21:33 +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
bf931a5097 feat: Add facilty for custom throttle warning position (#1395)
* replace magic number for throttle idle with correct define

* settings for custom throttle warning position

* settings fixed not to break byte-aligment of bit-fields

* evaluate custom throttle warning position

* add requested throttle value to warning text

* comment about field alignment in ModelData struct

* Menu for editing custom throttle warning for 128x64 radios
Tested on RM TX12

* Improoved menu display

* move displayed strings to translation

* translation template added for each language

* support for 212x64 B&W radios

* menu for colorlcd
not tested

* corrected translation entry for TW

* corrected handling of padding bits in ModelData structure

* Companion support for custom throttle warning position

* Rebase catchup

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-01-30 15:04:40 +10:00
Raphael CoefficandPeter Feerick a052ba63c2 Remove COPROCESSOR 2022-01-29 14:40:17 +10:00
Raphael CoefficandPeter Feerick 09c49e24ee Remove SKY9X target 2022-01-29 14:40:17 +10:00
c3c8a2e3f1 feat: Model level ADC Jitter filter option (#1363)
* ADC Filter - On/off state configurable at the model level

* Updated YAML configuration to match change from ADC Filter feature commit

* Companion changes to support ADC jitter filter to be a model configuration item.

* Renamed jitterFilter field to noJitterFilter.

This better describes the semantic, which is inverted.

* Updated after review

* Re-run generate-yaml

* Changed ADC Jitter filter control on Model to be tri state.
Off, On or use the radio setting

* Adde NOBACKUP() to the added field

* Re-generate yaml_datastructs

* Making the default state to use radio setting/Global value

* Updated after review:
Changing to more consistent naming across firmware and companion.

* Reverted  files that was accidently added to the commit.

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-01-26 20:54:23 +10:00
1b66af88af [colorlcd] Warn on model change if telemetry-enabled model connected (#1467)
* Warn on connected model (#1466)

* Make it so not confirming aborts model change

* add delay before accepting disconnected telemtry

* Add power off delay

* Remove whitespace + time unit in name

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-01-23 10:45:20 +10:00
Raphael CoefficandGitHub 4048983ce5 Add a "No SD card" screen on boot (#1451)
This prevents certain issues related to SD card being now mandatory to run EdgeTx.
2022-01-21 20:18:27 +10:00
RistoandGitHub 60bbe52f63 feat: More analog diagnostics screens on B&W colorlcd (#1421)
* Show true unscaled and unfiltered analogs for diagnose purpose on the analog diagnose screen.
Tested on physical RM TX16S, not yet tested on B/W targets.

* Changed to decimal display also on B/W targets. Tested now with RM Zorro as well.

* 5 fps refresh rate of the raw analog values. Much nicer to look at.

* Time-changing 3 views for color radios: std., filtered raw with deviation, unfiltered raw.

* Corrected deviation view output to not use old values.

* Changed analogs diagnose page to user navigatable TabsGroup with 3 tabs.

* Added fourth analog diagnose tab to show minimum and maximum values and the range (difference between min and max).
Left touch screen and IMU output tests only on first page (should also move in the future to their respective dedicated pages).

* Use Std. JitterAlpha filtering for Deviation screen to minimize delay, omit filtering for FlySky digital hall gimbals - not necessary, the signal is stable enough.

* 2 analog diagnose pages for 128x64 B/W radios: calibrated analogs and raw values with display output limited to 5 frames-per-second due to visibility reasons.

* Added 2 analogs diagnose pages also for 212x64 display B/W radios.
I was only able to simulate it, not tested on real hardware.

* Support also radios that do not have PageUp/PageDn keys, but only Page key (e.g. X7).

* Better key handling and improved style thx to @pfeerick
2022-01-21 14:45:56 +10:00
Malte LangermannandGitHub 37ee8a68f8 fix: Force a valid min "backlight on" setting on color lcd radios (#1386)
* always have aat least a 5s backlight timeout and some backlight enabled when backlightshould be on on color lcd radios

* for backlight timeout to be at least 5s on color lcd radios under all circumstances

* fix indentation

* the backlight value is inverted on color lcd radios, so the calculation was wrong

* fix typos
2022-01-11 22:44:13 +10:00
piotrvaandGitHub 192ca87afb fix: rotary encoder movement should not close throttle warning (#1408) 2022-01-11 11:44:21 +10:00
Raphael CoefficandPeter Feerick 9afae09f31 Load radio settings before power on delay is evaluated
Resolves #1366
2022-01-10 11:10:49 +10:00
d30c5f46bc feat: Stuck key test for COLORLCD (#1289)
* Stuck key test for COLORLCD #1271

* always start with the first button, no matter what this button is.

* Add LED  error

* Move LED_ERROR_END to ensure runs after dlg close

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2022-01-09 12:24:43 +10:00
Peter FeerickandPeter Feerick f8c01c3988 Show warning LED with switch and throttle alerts
Show warning LED for switch, throttle and ALERTS generally
i.e. MULTI failsafe not set, low RTC battery, storage warning
2022-01-08 14:12:26 +10:00
3djcandRaphael Coeffic d31482c18b Introduce T-pro and function switches handling 2021-12-17 17:07:48 +01:00
Raphael Coeffic 998af78f19 Remove MENUS_LOCK 2021-12-09 09:11:00 +01:00
Peter FeerickandPeter Feerick 15a6b6f1d4 Ensure stock internal module is set where possible
e.g. where before a complete wipe or unsupported upgrade path failure
failed to enable NV14 internal module by default.
2021-12-07 18:32:31 +10:00