1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 04:45:24 +03:00
Commit graph

96 commits

Author SHA1 Message Date
Ivan Efimov
bb33c65f11 Changes in crash flip OSD warnings:
1. Show "ARMED"<new line>"> CRASH FLIP <" when arming in crash flip
2. Show "CRASH FLIP SWITCH" when disarmed, but in crash flip.
3. Hide the disarmed stats screen if "CRASH FLIP SWITCH" is activated.
2022-05-27 02:06:16 -05:00
Hans Christian Olaussen
7cc4c448b7 FIx OSD visual beeper 2022-04-18 14:32:06 +02:00
Steve Evans
07f6bea174 Fix failsafe timings and behaviour to match Failsafe.md 2022-03-30 18:29:21 +01:00
haslinghuis
fc8318f54b
Merge pull request #11359 from alexeystn/fix_visual_beeper
Fix visual beeper
2022-01-30 02:29:42 +01:00
haslinghuis
8701d9141f
Merge pull request #11340 from SteveCEvans/osd_peak_task
Increase number of element groups and use peak hold task estimation for OSD
2022-01-30 02:29:12 +01:00
Steve Evans
cc67b2e87c Naming changes suggested by Hydra 2022-01-28 20:31:47 +00:00
Alexey Stankevich
da0a42aeda Fix visual beeper 2022-01-28 22:35:26 +03: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
1c3e562ac5 OSD - Use async screen clear in OSD_STATE_UPDATE_CANVAS. 2022-01-27 16:31:38 +01:00
Steve Evans
28e596a500 Increase number of element groups and use peak hold task estimation for OSD 2022-01-26 22:24:21 +00:00
Dominic Clifton
765afa35b7 OSD - Fix code-style. 2022-01-23 15:31:50 +01:00
Dominic Clifton
023a7e5b00 OSD - Always use specifically named stats refresh phases in. 2022-01-23 15:29:15 +01:00
Dominic Clifton
e0f27197ff OSD - Remove unneeded call to schedulerIgnoreTaskExecTime in stats
refresh.
2022-01-23 15:26:01 +01:00
Dominic Clifton
2a9f0a50bb OSD - Prevent RX task starvation by drawing each stats row on a separate
iteration.
2022-01-22 18:59:11 +01:00
Dominic Clifton
2fe5947290 OSD - Prevent RX loss on stats display by using async screen clearing
and multiple phases.
2022-01-22 18:59:11 +01: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
e7b61a928f Still update duration of next anticipated state even is current execution time is ignored 2022-01-14 03:22:52 +00:00
Steve Evans
c05ad2ec9b Fix issues impacting RX_STATE_MODES state duration and add DEBUG_RX_STATE_TIME 2022-01-12 23:38:03 +00:00
Steve Evans
d492257f41 Fix refresh stats scheduling 2022-01-06 01:18:19 +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
KarateBrot
450cee3e08 Removed dynamic notch from features 2021-11-10 23:03:43 +01: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
KarateBrot
8649f1003f Dynamic notch refactoring
+ added new parameter group for Dyn Notch
2021-09-01 12:39:21 +12:00
Michael Keller
cd2c098a80
Merge pull request #10816 from Asizon/frskyosd_fix 2021-08-27 00:46:36 +12:00
Asizon
775e00e133 Fix non working Frsky OSD
Fix declaration

Add comment
2021-08-04 07:33:27 +02:00
Steve Evans
87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12: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
Davor Kustec
78e4e930a4 Code optimization by request
Moved setting to the end of the struct

osd.c optmization

Changed bool into uint8t to mainatin fixed PG size
2021-02-17 12:06:45 +01: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
Bruce Luckcuck
e7b9828c3b Add option to display OSD menus over a solid gray background
Improves menu readability by changing the background from a transparent display of the camera image to a static opaque gray background.

The behavior is controlled with the `osd_menu_background` parameter which defaults to `TRANSPARENT` to preserve the previous behavior. Other opaque options are available:
```
osd_menu_background = TRANSPARENT
Allowed values: TRANSPARENT, BLACK, GRAY, LIGHT_GRAY
```

The background setting is available in the CMS OSD menu and the user can cycle through the various options with the display updating in real-time.

Currently only the onboard MAX7456-based OSD is supported, but the implementation adds `displayPort` support so it can easily be extended to other OSD devices if those manufacturers want to add support. Also can be extended to other background types (like colors, varying transparency, etc.) for future device support.

Makes use of the built-in MAX7456 feature to display all transparent pixels as "gray". The MAX7456 display area seems to be a few scan lines smaller than the actual camera video image so it's normal for some of the camera image to "leak" at the top/bottom of the display. The OSD display area can be adjusted up/down using the `vcd_v_offset` setting if desired.
2021-01-10 18:19:59 -05:00
Michael Keller
a702ee1a5b Simplified the OSD blink frequency calculation. 2021-01-02 01:04:13 +01:00
Bruce Luckcuck
f7d992b2bd Improve OSD blink logic
Changes the blink logic to be OSD task loop based instead of time based.

The previous logic used a 200ms time interval for the blinking which didn't align well with the default 12hz OSD update frequency resulting in the logic periodically missing intervals resulting in an inconsistent blinking.

As the revised logic is now tied to the OSD task iterations the blinking will be consistent. However due to the timing the blink will be slightly faster - 167ms (6hz) vs. the previous 200ms (5hz) intervals. Technically the blinking was 6hz before but stuttered every 5th blink.

Since the OSD task rate can be changed from the default 60hz, the logic will fall back to the time-based implementation for non-default task rates.
2020-12-25 12:41:44 -05:00
anthonycake
8c6fcf2995 Implement RSSI (dBm and Pct), LQ, in GHST driver
Issue #10336

Fix Typo in Ghost driver

Update src/main/osd/osd.c

Co-authored-by: haslinghuis <mark@numloq.nl>

Update src/main/rx/ghst.c

Co-authored-by: haslinghuis <mark@numloq.nl>

Update src/main/rx/rx.c

Co-authored-by: haslinghuis <mark@numloq.nl>

Future-proof GHST driver, while adding RSSI and LQ support

Ensure that future packet types which contain 4 channels of data, plus auxiliary data, are correctly handled by BF releases that predate them.

Implement changes suggested by reviewers

Cosmetics
2020-11-22 18:47:20 +01:00
Alexey Stankevich
6bab981ff5 Move OSD task frequency logic to tasks.c 2020-10-05 22:08:58 +03:00
Alexey Stankevich
c40174d2eb Change 'osd_high_framerate' parameter to 'osd_task_frequency' 2020-10-05 13:22:24 +03:00
Alexey Stankevich
03e878306b Add optional high framerate OSD 2020-10-04 14:09:16 +03:00
Bruce Luckcuck
44dafd57ec Remove unnecessary drawScreen() calls for MSP displayPort OSD
The previous logic runs the OSD task at 60hz with a logical update rate of 12hz. The structure is based around an "update" (draw the elements) phase followed by 4 "drawScreen" phases that are designed to spread out the flushing of the screen buffer over SPI and reduce the OSD task delay.

The problem with MSP displayport is that is has no buffering aspect. The data is sent immediately to the external device as the elements are "drawn". Later only a single "drawScreen" call is needed to tell the external device to render. So because the same logical structure was used as for the max7456, there were 3 unnecessary drawScreen calls resulting in 36 messages and ~250 bytes/second sent over the serial line.

Discovered while testing with an external application that emulates a MSP displayPort serial device (reads the serial data, renders the OSD). Found the application was needing excessively high processing power because it was being told to render the display 4 times too often.
2020-10-01 12:48:07 -04:00
haslinghuis
9ae3adaa51 Measurement units for OSD elements and FRSKY hub telemetry. 2020-08-23 16:23:57 +02:00
mikeller
cfc89c98a8 Fixed the MAX7456 loop time problems introduced by #9948. 2020-07-05 22:00:13 +12:00
mikeller
98efe1a972 Fixed reporting of configured / detected OSD device. 2020-05-17 03:56:20 +12:00
phobos-
ad39dc4839 Fixed max esc rpm osd statistic when dshot telemetry is enabled 2020-05-04 13:50:13 +02:00
Bruce Luckcuck
24849bce0e Fix link_quality_alarm range
This was missed during the transition to CRSF using a 0-100 range instead of 0-300.
2020-04-12 20:46:47 -04:00
mikeller
d0cf12a52b Added option to display RX SNR dB for CRSF instead of RSSI dBm. 2020-03-07 17:29:21 +13:00
Roy van der Veen
89fad8dc7f Add 'low capacity' warning shown when exceeding configured cap_alarm value 2020-02-14 09:52:29 +01: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
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
mikeller
be48054b5f Fixed missing parameter group version increment for 'osdConfig' after #9261. 2019-12-08 14:51:59 +13:00
Bruce Luckcuck
5c3b8c6eb6 Add camera frame OSD element
Adds an adjustable outline element designed to represent the field of view of the pilot's HD camera for visual framing. The width, height and position of the frame are adjustable.
2019-12-04 11:03:41 -05:00