Commit Graph
93 Commits
Author SHA1 Message Date
philmozandGitHub 8381a68a91 feat(color): Add 'popup' option for GVARs already present on B&W (#4554) 2024-01-26 20:13:42 +10:00
c9334ebda3 refactor: USB HAL conversion + USB lib update (#4207)
Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Richard Li <richard.li@ces.hk>
2023-12-24 11:01:48 +10:00
Raphael CoefficandGitHub 5153aaeea0 refactor: IWDG driver and EM trigger (#3846) 2023-12-04 07:14:25 +10:00
bug400andGitHub 926dc36d51 fix(lua): Do not pass key event that triggered telemetry view to lua (#4168) 2023-11-07 09:08:31 +10:00
philmozandGitHub 7190f00374 chore(radio): Cleanup startup code, fix throttle warning led color, startup haptic option (#4027) 2023-11-05 18:53:26 +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
Raphael CoefficandGitHub 87df8a4f2c refactor: SD card SPI HAL (#3957)
* refactor: SD card SPI driver

* Removed SPI and DMA StdPeriph drivers

* Allow for disabling SPI DMA support

* Disable SPI sdcard CRC support

* Fix 2MHz timer on NV14

* Shared VS1053b driver

* Fix: SPI2 uses PCLK1

* feat: new generic diskio API

* More generic SD_CARD_PRESENT()

* Fixes

* Flush incoming block on token mismatch

* Scratch buffer test

* Incredible hack to re-sync sd card

* fix: SDIO driver
2023-09-23 19:31:56 +10:00
philmozandGitHub 0aff002c8a chore(color): Cleanup and optimise EdgeTxTheme class (#4013) 2023-09-21 19:39:05 +10:00
philmozandGitHub 69338ab0ab chore(color): Libopenui refactor (#3614)
* Refactor object creation logic.
Remove unused LVGL features.

* Remove unused files.
Fix height for widgets.

* Rename 'OpenTxTheme' class to 'EdgeTxTheme'.
Cleanup commented out code.
Cleanup unused code from 'etx_lv_theme.cpp'.

* More cleanup.

* Move more style code to etx_lv_theme.cpp

* Update license

* Make default button height match other controls.

* Fix curve edit layout.

* Fix layouts.

* FormWindow and FormGroup provided identical functionality - rename FormGroup to FormWindow and remove duplicate.

* Simplify menu icon handling.
Remove unused 'flysky.cpp' file.

* Fix window size change.

* Simplify page header code.
Fix statistics view page.

* Remove unused file.
Replace redundant 'Subtitle' class with a macro.
Fix compiler warnings.

* Fix compiler warning in LvglWrapper.cpp.
Remove unused code in static.h.
Simplify about page.

* Rename ICON_OPENTX to ICON_EDGETX.

* Fix github build error.

* Fix github build error (attempt 2).

* Move ButtonMatrix styling to etx_lv_theme.cpp.

* Scroll bar consistency.

* Use styles for ButtonMatrix text color.

* Use 'active' color for selected USB advanced setup buttons. Move error message to bottom of page.

* Create style for popup window title bar.
Simplify advanced USB setup code.
Remove unused libopenui/carousel.* files.

* Add style for modal popup content.

* Remove unused BUTTON_BACKGROUND flag.

* Replace GridLayout with FormWindow. Remove unused gridlayout.h file.

* Fix rebase.

* Merge ChoiceEx class into Choice class code.
Remove unused CurveKeyboard.

* Use LVGL bar for progress indicator.
Update only style colors when theme changes (don't recreate all style settings).

* Move ProgressDialog class to dlalog.h/dialog.cpp files.

* Simplify trim and slider code in main view.
Simplify the hardware inputs code.
Fix dialog size.
Remove unused code in layout factory.

* Cleanup unused code.

* Add style for FormWindow class.
Merge BaseNumberEdit class into NumberEdit class and remove BaseNumberEdit.
Remove more unused files.
Cleanup libopenui_config.h files.

* Re-organise libopenui include files to fix build error.

* Fix build error.

* Add missed styles to etx_lv_theme.cpp.
Delete commented out #includes.
More cleaning up of libopenui_xxx.h files and dependencies.
Re-enable LVGL CHECKBOX feature.

* Merge libopenui_helpers.h into opentx_helpers.h file.

* Fix firmware build.

* Use object constructors for LVGL object creation as suggested by gagarinlg.
Add style for number edit text alignment.
Fix background color for focussed control.

* Move color related stuff from libopenui_defines.h to colors.h.
Remove need for libopenui_depends.h file.

* Merge libopenui_types.h content into opentx_types.h file.

* Rename CheckBox class to ToggleSwitch.

* Restore code to update flight mode text color when theme changes.

* Cleanup some more unused code.

* Remove redundant theme.h file.

* Fix rebase.

* Fix button matrix style.

* Fix rebase

* Fix rebase

* Ensure correct initialisation of Choice object.

* Fix rebase.

* Make the slider control bigger to make touch activation easier.

* Fix build error.

* Fix slider logic and cleanup code.

* Use ACTIVE theme color for inputs, mixes, LS, GV and SF.

* Improved border width consistency and focussed state consistency.

* Remove duplicate copy of the default theme colors.
2023-08-04 11:04:54 +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
philmozandGitHub e0fad3d122 fix(color): Popup telemetry warning can crash radio (#3439)
Also fixes issue where simulator does not close cleanly if popup showing.
2023-04-16 18:25:29 +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
MichaelandGitHub ce8cc0b540 Fix missing log steps at 0.1s period (#1967)
fixed issued where log steps would be missed due to 10ms timer resolution
- simulator: allow for one get_tmr10ms() tick (10ms) deviation
- radio: switched to FreeRTOS software timer at user requested period

code cleanup
log.cpp: made variable lastLogTime static
log.cpp: deleted unused variable g_logError
functions.cpp, logs.cpp, sdcard.h: renamed variable logDelay to logDelay100ms to show it is scaled to 100ms increments
2022-06-27 20:12:47 +02:00
Raphael CoefficandRaphael Coeffic ac84ac1397 Fix & simplify fatal screens 2022-06-17 05:34:47 +02:00
Raphael CoefficandRaphael Coeffic 479e8ad244 Fix direct drawing for special cases 2022-06-17 05:34:47 +02:00
Raphael CoefficandRaphael Coeffic e75ec459f1 Cleanup 2022-06-13 22:43:45 +02:00
Raphael CoefficandRaphael Coeffic a013fccc78 fix: full screen dialogs 2022-06-11 15:38:08 +02:00
gagarinlgandRaphael Coeffic 809480bc6a fix fatal error screens with LVGL 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
gagarinlgandRaphael Coeffic 9633f3cfeb use updated libopenui
fix libopenui/lvgl run order
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
Raphael Coeffic e5f7da0802 Start VCP serial according to config 2022-03-20 16:30:59 +01:00
Raphael Coeffic b39baa2360 Use USB VCP as a normal serial driver as well 2022-03-20 16:22:14 +01:00
Raphael Coeffic 530d395204 WiP 2022-03-20 16:22:14 +01:00
Raphael CoefficandPeter Feerick 09c49e24ee Remove SKY9X target 2022-01-29 14:40:17 +10:00
Raphael Coeffic f93cac3b1d Make USB serial dependent on USB_SERIAL rather than DEBUG 2021-12-17 15:17:49 +01:00
Raphael CoefficandRaphael Coeffic 6b94c2f45d Small fixes for TX16S 2021-11-21 11:18:35 +01:00
Raphael CoefficandRaphael Coeffic b1b3423844 Use stream buffer for CLI 2021-11-21 11:18:35 +01:00
gagarinlgandPeter Feerick ced9df9510 started implementing backlight tracking (unfinished)
horus touch driver internally tracks touch state and returns the state on read to make in independed of the mainwindow touchState
2021-11-16 11:21:04 +10:00
Raphael Coeffic 72859ad6d1 WiP 2021-11-10 11:06:59 +01:00
c59f579bbe Add special function to disable the touch screen (#942)
* added a new special function to disable the touch screen

* Bump libopenui

* Don't try to disable touch if no hardware touch

* Disable processing of SF if no touch hardware

Co-authored-by: Peter Feerick <peter.feerick@gmail.com>
2021-10-25 23:20:57 +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 0e4201f25d WiP 2021-07-31 18:46:38 +02:00
jfrickmann c62aac7bde Lua task preempts long running scripts instead of killing them
Ported to EdgeTX from https://github.com/opentx/opentx/pull/8194
2021-07-22 14:41:53 -04:00
Raphael Coeffic 430902ae6f Prevent USB pop-up items to be added multiple times
Resolves #184
2021-06-11 07:01:15 +02:00
Raphael CoefficandRaphael Coeffic 5960d0aac2 Moved MPM failsafe check to the UI task
Resolves #87
2021-05-26 23:21:34 +02:00
Raphael CoefficandRaphael Coeffic b96faad908 Clean-up + fix + debug 2021-05-24 16:23:06 +02:00
Raphael CoefficandRaphael Coeffic 0bb9994ac5 Allow disabling USB connection by discarding the pop-up menu 2021-05-24 16:23:06 +02:00
Raphael CoefficandRaphael Coeffic 6b9abe0670 Remove obsoleted code 2021-05-24 16:23:06 +02:00
Raphael CoefficandRaphael Coeffic 95aa02cedd Switch the framebuffer address rather than using 2 LTDC layers 2021-05-23 08:19:56 +02:00
Raphael Coeffic 728ed13c7e Added "USB plugged" screen 2021-05-09 15:56:19 +02:00
Raphael CoefficandRaphael Coeffic 1fa99fdeb2 Glider wizard running in simu
Text fields are still displayed as a black box (needs to be fixed)
2021-05-06 12:55:59 +02:00
Raphael Coeffic ef6f2d0c57 Scrolling from view to view works now
And quite some bugs & crashes fixed.
2021-04-18 07:57:42 +02:00
3djc 70d24506da Merge branch '2.3' into 2.4
# Conflicts:
#	radio/src/fonts/480x272/font_dblsize.png
#	radio/src/fonts/480x272/font_xxlsize.png
#	radio/src/gui/128x64/model_setup.cpp
#	radio/src/gui/128x64/radio_setup.cpp
#	radio/src/gui/480x272/model_receiver_options.cpp
#	radio/src/gui/480x272/model_setup.cpp
#	radio/src/gui/480x272/radio_calibration.cpp
#	radio/src/gui/480x272/radio_hardware.cpp
#	radio/src/gui/common/stdlcd/draw_functions.cpp
#	radio/src/gui/gui_common.cpp
#	radio/src/keys.h
#	radio/src/lua/interface.cpp
#	radio/src/pulses/afhds3.h
#	radio/src/rtos.h
#	radio/src/switches.cpp
#	radio/src/targets/common/arm/stm32/aux_serial_driver.cpp
#	radio/src/targets/horus/CMakeLists.txt
#	radio/src/targets/horus/lcd_driver.cpp
#	radio/src/targets/horus/startup_stm32f42_43xxx.s
#	radio/src/targets/taranis/CMakeLists.txt
#	radio/src/telemetry/crossfire.h
#	radio/src/telemetry/multi.cpp
#	radio/src/translations.cpp
#	radio/src/translations/it.h.txt
#	radio/src/translations/untranslated.h
#	radio/util/font2png.py
#	tools/commit-tests.sh
2021-04-08 11:42:28 +02:00
Bertrand Songis 889f645c1a pushEvent insteado of putEvent 2021-03-12 11:07:31 +01:00
3djcandGitHub 1f01fa6d47 Radiomaster T8 (#8219) 2021-01-15 17:19:25 +01:00
Bertrand Songis 0f87115dc4 Update to latest libopenui 2020-12-04 16:37:42 +01: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
3djc 49aefb49c9 Default to screen baclight ON 2020-10-08 18:53:01 +02:00
3djc 3fc62fff83 Default to screen baclight ON 2020-10-08 09:31:46 +02:00