1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 05:15:25 +03:00
Commit graph

117 commits

Author SHA1 Message Date
Brian Ledbetter
f8bd0b5388
Fix OSD_X macro to correctly load the high bit (#12038)
Resolves #12037
2022-12-04 13:56:24 +01:00
ctzsnooze
341d65becf remove gps_required and gps_minimum sats and revert to gps_rescue_min_sats 2022-10-20 21:44:01 +11:00
Mathias Rasmussen
9957ceb275 Fix function brace style 2022-10-12 16:31:55 +02:00
Jon Mahoney
a2d356dc78 Watt Hours Drawn OSD Element and Post Flight Stat
The Watt hours used element was added per a feature request to give
another way of interpreting the battery usage. It was also added as a
post flight stat to show consumption similar to the mAh post flight
stat. This once again is just giving pilots another option that some may
find useful.
2022-09-19 23:36:23 -04:00
ctzsnooze
09ee27cd97 Refactor sat count checks and GPS trust code
single minimum GPS satellite setting
single required GPS satellite setting
CLI Baro vs GPS trust user interface
GPS trust refactoring
allow arming with GPS_FIX even if not enough sats
required sats must be present to arm
set required sat count to 8
add blackbox headers
2022-09-07 09:55:35 +10:00
Štěpán Dalecký
f85ebba6a4 Refactoring of IMU and ACC 2022-06-28 18:26:10 +02:00
Steve Evans
2e8d026b4e Add OSD_STATE_GROUP_ELEMENTS state to osdUpdate() and optimise DMA vs polled MAX7456 SPI access 2022-01-28 00:26:32 +00:00
Dominic Clifton
e2c0388a6a OSD - Add support for async screen clearing to display API.
No screen clearing is actually done asynchronously yet.
2022-01-22 18:59:11 +01:00
Steve Evans
db904b4a75 Add expediting of OSD task 2022-01-14 13:28:48 +00:00
Steve Evans
b29ee58e0a Display stats on disarm 2021-12-28 01:48:45 +00:00
Steve Evans
29d221502e Use peak tracking as default for task duration estimation rather than a moving average 2021-12-17 22:09:52 +00:00
Steve Evans
ab1baccc66 Track state execution time for OSD, baro, rx and GPS tasks and inform scheduler of next state execution time 2021-12-17 15:40:01 +00:00
Steve Evans
d5f62be013 Trigger gyro SPI DMA reads in EXTI handler if supported and lock gyroTask loop to gyro to eliminate missed updates and jitter 2021-09-28 01:38:18 +13:00
Tony Cabello Miguel
56cb320be0 OSD Test for Sats indicator fixed 2021-05-05 15:26:41 +02:00
Tony Cabello Miguel
561b15be70 WIP: Unit test for OSD Sats element 2021-05-05 10:27:03 +02:00
Tony Cabello Miguel
c56d81457f Fixed tests, replaced hyphen with NC 2021-05-05 08:55:50 +02:00
Hans Christian Olaussen
3177cb3ec0 Update unit tests 2021-04-26 15:14:59 +02:00
Bruce Luckcuck
b5bf9c2b4c Add a common function used to print formatted floats in the OSD
Updated the OSD element and stats rendering code to use this fuction to print floating point values of varying precisions.

Will make adding OSD element variants that provide different decimal precisions (like voltage, amperage, etc.) easy to implement since all that needs to change is the `decimalPlaces` passed to the function. As an example, see the `osdFormatAltitudeString()` function.

If at some later date a more capable `printf` package is inplemented, then the guts of the `osdPrintFloat()` function could just be simplified while leaving the abstraction in place.
2021-02-17 08:09:52 -05:00
Bruce Luckcuck
84b6730cdd Separate OSD warnings from OSD task and make available via MSP
Provides a properly implemented way for MSP query type OSD implementations (like DJI) to display OSD warnings. Separates the warnings generation from the OSD task and shares common code to make the text available for the OSD and/or via MSP. Eliminates the need to implement hacks and workarounds like using the `CRAFT_NAME` field to display warnings. Since the warnings logic is now separate, the OSD task does not need to be running unlike other hacks.

Adds the `MSP2_GET_OSD_WARNINGS` message formatted as follows:
```
byte  description
0     Display attributes including blink (see displayPortAttr_e in drivers/display.h)
1     Length of warning text
2-n   Warning text characters
```
2021-02-13 14:11:38 -05:00
Robert Cisneros
9e5cdbf2be Enable Up/Down reference for artificial horizon in OSD
This mod adds an arrow symbol showing the location of the up/down on the OSD.  The arrow direction points in the direction of up or down.

Update osd_elements.c

Making the Up/Down OSD reference its own element

Removing the Up/Down reference from the artificial horizon and making a specific element for this feature.  Activation via CLI (for now)

Updates to Up/Down refernce OSD element

Changed the up/down reference so that it is its own separarte element.  The position is absolute on the screen and immutable by the user for consistent operation. Updated settings to include CLI option for turning the feature on and off.

Update cms_menu_osd.c

Updated file to add Up/Down reference selection from OSD menu

Updates to simplify/correct Up/Down OSD element

Simplified/corrected logic and removed arcsine function.  OSD up/down reference is now positionable by the user in the configurator.

Tweaks and codestyle updates

Feedback from Michael Keller

Updates to Up/Down OSD indicator

Created a bounding box of +/- 25 degrees for indicator

Coding style correction

minor correction to match BF coding style

Enable Up/Down reference in OSD

This mod adds an arrow symbol showing the location of the up/down on the OSD.  The arrow direction points in the direction of up or down.

Update osd_elements.c

Making the Up/Down OSD reference its own element

Removing the Up/Down reference from the artificial horizon and making a specific element for this feature.  Activation via CLI (for now)

Updates to Up/Down refernce OSD element

Changed the up/down reference so that it is its own separarte element.  The position is absolute on the screen and immutable by the user for consistent operation. Updated settings to include CLI option for turning the feature on and off.

Updates to simplify/correct Up/Down OSD element

Simplified/corrected logic and removed arcsine function.  OSD up/down reference is now positionable by the user in the configurator.

Tweaks and codestyle updates

Feedback from Michael Keller

Enable Up/Down reference for artificial horizon in OSD

This mod adds an arrow symbol showing the location of the up/down on the OSD.  The arrow direction points in the direction of up or down.

Update osd_elements.c

Making the Up/Down OSD reference its own element

Removing the Up/Down reference from the artificial horizon and making a specific element for this feature.  Activation via CLI (for now)

Updates to Up/Down refernce OSD element

Changed the up/down reference so that it is its own separarte element.  The position is absolute on the screen and immutable by the user for consistent operation. Updated settings to include CLI option for turning the feature on and off.

Updates to simplify/correct Up/Down OSD element

Simplified/corrected logic and removed arcsine function.  OSD up/down reference is now positionable by the user in the configurator.

Tweaks and codestyle updates

Feedback from Michael Keller

Coding style correction

minor correction to match BF coding style

Enable Up/Down reference for artificial horizon in OSD

This mod adds an arrow symbol showing the location of the up/down on the OSD.  The arrow direction points in the direction of up or down.

Update osd_elements.c

Making the Up/Down OSD reference its own element

Removing the Up/Down reference from the artificial horizon and making a specific element for this feature.  Activation via CLI (for now)

Updates to Up/Down refernce OSD element

Changed the up/down reference so that it is its own separarte element.  The position is absolute on the screen and immutable by the user for consistent operation. Updated settings to include CLI option for turning the feature on and off.

Updates to simplify/correct Up/Down OSD element

Simplified/corrected logic and removed arcsine function.  OSD up/down reference is now positionable by the user in the configurator.

Tweaks and codestyle updates

Feedback from Michael Keller

Corrections to unit tests

Corrected unit tests link failing due to not being able to find rMat[3][3]
2021-02-08 16:03:45 +13:00
Michael Keller
a702ee1a5b Simplified the OSD blink frequency calculation. 2021-01-02 01:04:13 +01:00
mikeller
7836bc220c Fixed motorOutputLimitLow in blackbox and OSD. 2020-08-31 22:00:23 +12:00
mikeller
d79dcbb388 Fixed broken tests after #10080. 2020-08-25 01:17:16 +12:00
Michael Keller
924fd3414f
Merge pull request #9319 from mikeller/fix_osd_tests_for_real
Removed wonkiness and interdependencies from OSD unit tests.
2020-01-14 12:58:40 +13:00
Alberto García Hierro
65f84f2c86 [MSP] Correctly report the configured and active OSD type
- Tell the OSD driver the type of displayPort, so it can be retrieved
later.
- Use OSD driver code instead of device specific code to handle
MSP_OSD_CONFIG response while minimizing driver specific code.
- Add flag for signaling the use of FrSky OSD (bit 3).
- Rename OSD_FLAGS_MAX7456_DETECTED to OSD_FLAGS_OSD_DEVICE_DETECTED.
Since we only support one OSD device type at a time, we can use the
same bit to signal wether the hardware has been detected.
2020-01-04 12:35:09 +00:00
Michael Keller
df778d6ba1 Removed wonkiness and interdependencies from OSD unit tests. 2019-12-27 16:57:38 +13:00
Bruce Luckcuck
afeb88850f Move OSD elements into their own parameter group
Separates the OSD elements position/visible/profile flags from the `osdConfig` PG and moves them to a new `osdElementConfig` PG. Allows new elements to be added without having to constantly update the PG version for `osdConfig`.
2019-12-09 19:13:08 -05:00
Michael Keller
9425831756
Refactored 'WAS_EVER_ARMED' arming flag to be only enabled on f… (#9248)
Refactored 'WAS_EVER_ARMED' arming flag to be only enabled on first disarm.
2019-12-01 15:14:02 +13:00
mikeller
c7b16d2f3d Fixed seat-of-pants OSD unit tests. 2019-12-01 13:09:18 +13:00
Alberto García Hierro
37e66b3dda Add support for FrSky OSD
- Add displayWriteFontCharacter() for font writing, removing all max7456
specific code.
- Add displayIsReady() for asynchronous display initialization
- Add displayBeginTransaction()/displayCommitTransaction() for display
transactions, which allow performing complex drawing operations without
flickering
- Add displayGetCanvas(), which retrieves the canvas associated with a
display (if it has it)
- Add canvas implementation for pixel based access for a display
- Add FrSkyOSD driver and displayPort driver
- Enable FrSkyOSD driver for targets with flash > 256
- Rename max7456_symbols.h to osd_symbols.h
2019-11-30 22:06:36 +00:00
mikeller
cc8b8d3bf6 Improved detection of upright / 'SMALL_ANGLE' state. 2019-11-18 14:09:06 +13:00
mikeller
53955a4a6b Show blackbox log number in OSD only when available. 2019-11-03 02:29:38 +13:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Tony Cabello
0ddcfc097c Feature: show 3d speed on OSD 2019-08-30 08:21:19 +02:00
Bruce Luckcuck
b962416333 Remove settings parameter; update to use the new kilometer and miles symbols 2019-06-27 10:14:14 -04:00
Bruce Luckcuck
2e9e99ff42 Simplified leading symbol logic and change setting to default to ON 2019-06-25 18:38:27 -04:00
Bruce Luckcuck
865515113e Add dynamic distance formatting for OSD elements
Optionally format distance as meters/kilometers or feet/miles based on overal distance. For metric, distance will be displayed as:

0-999m: display meters
1000-9999m: display as kilometers with 2 decimals (ie. 1.23K)
10000m and above: display as kilometers with 1 decimal (ie. 10.5K)

Similar for imperial units except that will display feet up to 1 mile (5280ft), miles with 2 decimals from 1-9.99 miles, and with 1 decimal over 10 miles.

Configured with `osd_dynamic_distance_units = OFF | ON`. If off (the default) then the behavior is unchanged and the distance will be only displayed in meters or feet depending on the units selection.

There are currently no OSD font symbols for kilometers or miles so "K" and "M" are used at this time.
2019-06-24 19:57:14 -04:00
Miguel Angel Mulero Martinez
f759ba75d7 Remove remaining blank overwrite in OSD elements 2019-06-12 08:48:29 +02:00
Miguel Angel Mulero Martinez
f27a93b767 Move the Altitude alignment left in the OSD 2019-05-24 09:51:51 +02:00
laz2wiringpi
e9a406f447 Link Quality without Aux
fix indent , move unused
remove premature optimisation
Use prior code for osd element calc
unit test add crsf for scaleCrsfLq
unittest typo
rx 0-100
elements simplify osdElementLinkQuality refactor
share  one 16 bit var
2019-05-20 18:10:37 -04:00
Bruce Luckcuck
d62a4f4b18 Add tenths of a second OSD timer precision option
Currently the timers support full second and hundredth of a second display precision. This adds a tenth of a second option.
2019-05-17 14:25:30 -04:00
Michael Keller
3651bbc03a
Added altitude symbol in OSD. (#8184)
Added altitude symbol in OSD.
2019-05-06 22:49:26 +12:00
mikeller
05f5449d04 Made temperature OSD display consistent. 2019-05-05 22:30:07 +12:00
mikeller
bd03951ca4 Added altitude symbol in OSD. 2019-05-05 22:26:53 +12:00
root
6885d27400 comment out unused symbols, use some symbols
Also turns out the Core Temperature widget is subjected to unit tests
2019-05-01 22:17:56 +00:00
jirif
5d30b3f437 Show only 3 significant digits in vbat OSD element 2019-04-14 15:41:44 +02:00
Bruce Luckcuck
138f403204 Fix OSD stats alignment and formatting
Fixes the alignment and formatting of the following stats:
* Max altitude
* Max speed
* Max ESC temperature
2019-03-26 13:37:21 -04:00
Bruce Luckcuck
30672a37c5 Refactor OSD element display code
Remove the giant `select` block that contained all the code to generate the elements and transition them to individual functions called only when the element is active. Simplifies the code and results in a performance improvement as it's not necessary to fall through the large `select` statement for every element that will be drawn. The individual functions and the element to function mapping are moved to a new `osd_elements.c` file.

Moved the OSD related code files to a new `osd/` directory.

Also pre-analyze the active elements and only process those that are active. This also saves processing as it's not necessary to loop through all 50 or so elements when only a couple are active.

Various other cleanup and removal of stale or unnecessary code.

In the default configuration the element drawing phase of the OSD task is reduced from ~51us to ~35us - resulting in about a 30% decrease in processing time.
2019-02-21 14:03:25 -05:00
mikeller
95eb87b678 Changed OSD stick overlay to use custom symbols. 2019-01-28 00:53:02 +13:00
Tony Cabello
a0604dd1a5 Reordered Max Altitude and Total Distance in stats screen 2019-01-22 17:08:55 +01:00