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

1041 commits

Author SHA1 Message Date
Steve Evans
3087d10f53 Report task rate/Hz based on execution of whole state machine, not individual states where appropriate 2021-05-20 18:27:27 +01:00
Michael Keller
9f04b506b5
Merge pull request #10687 from SteveCEvans/ledstrip_task_time 2021-05-21 02:11:36 +12:00
Steve Evans
916c3501c5 Fix LEDSTRIP unit test 2021-05-20 00:18:30 +01:00
ctzsnooze
3b62b2e5d4 add PT2 and PT3 lowpass filter options 2021-05-18 09:59:27 +10:00
Michael Keller
55288dc2e1
Merge branch 'master' into tbs/crsfv3 2021-05-18 01:14:38 +12:00
Michael Keller
bcc9ff4f02
Merge pull request #10726 from TonyBlit/osd_sats_none 2021-05-18 00:58:32 +12:00
Michael Keller
dfcd11bd69
Merge pull request #10712 from mikeller/cleanup_matrix_rotation
Cleaned up matrix rotation.
2021-05-18 00:46:04 +12:00
ctzsnooze
636d563abe major rc changes ctzsnooze 2021 2021-05-07 14:40:43 +10: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
tbs-fpv
fbd01551ff support channel resolution configuration for 0x17 2021-04-28 11:21:30 +08:00
tbs-fpv
4d8845b8da Merge remote-tracking branch 'refs/remotes/official_bf/master'
Conflicts:
	src/main/rx/crsf.c
	src/test/unit/rx_crsf_unittest.cc
2021-04-28 11:15:00 +08:00
Hans Christian Olaussen
3177cb3ec0 Update unit tests 2021-04-26 15:14:59 +02:00
mikeller
55cf26ebbc Cleaned up matrix rotation. 2021-04-26 23:10:00 +12:00
tbs-fpv
565f23074f add unit test for crsfFrameCmdCRC 2021-04-26 17:09:32 +08:00
tbs-fpv
daf6043429 fix unit test build errors 2021-04-08 13:08:43 +08:00
Steve Evans
25fcacf4c5 Split rx processing into three states to eliminate cycle time jitter
Allow tasks with state machines to control which state determines task duration

Fix unit tests
2021-03-27 23:28:41 +00: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
Michael Keller
d2867ef9ce
Merge pull request #10540 from etracer65/osd_warnings_msp
Separate OSD warnings from OSD task and make available via MSP
2021-02-17 07:52:37 +13:00
mikeller
ae4c260d74 Fixed use of an enum type in a parameter group. 2021-02-16 01:49:10 +13:00
Michael Keller
aeb2a4f381
Merge pull request #10516 from etracer65/level_mode_expo
Self-level modes expo
2021-02-14 17:25:16 +13: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
Michael Keller
29f6dd0c8d
Merge pull request #10417 from bobbycisneros/master 2021-02-08 16:40:54 +13: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
87f322927a Self-level modes expo
Adds angle setpoint roll/pitch expo for self-level modes.

Previously the angle setpoint was a simple linear calculation based on the stick deflection percentage and the angle limit. This makes control very jumpy around center stick and people would often resort to adding expo in their radios to compensate. This then adds the complication of wanting expo in the radio when in self-level but not when in acro - leading to complicated mixes, virtual switches, etc.

This PR adds separate self-level expo settings for roll/pitch so the user can customize the axis behavior. Yaw is excluded because this axis uses normal rates and expo controlling the rotational rate around the yaw axis and not an angle setpoint. The roll/pitch expo can range from 0 (off) to 100 (max) like other RC expo settings. For example:
```
set roll_level_expo = 30
set pitch_level_expo = 40
```
The default values are 0 which disables any expo and behaves as before.

The settings are available in the CMS rate profile menu.
2021-01-25 19:08:43 -05:00
Bruce Luckcuck
07598d824c Add up/down page indicator to CMS menu display
Often the user doesn't realize that there are more menu items then displayed and the only way to tell was to try and move the selection to the bottom to see if another page appears.

This PR adds page up/down indicators if there are more menu items than those visible on the current display.

Uses the OSD arrow symbols when possible (for OSD supporting devices), otherwise the `^` (carat) and `V` are used for text-only represenatations.

To determine if the device was capable of displaying symbols the `displayPort` structure has a new `deviceType` set when it is initialized. There have been other times when knowing the type of device would have been useful so that's now supported. Then this is abstracted by a new `displaySupportsOsdSymbols()` function. Devices that support OSD are assumed to support the OSD symbols as the OSD element drawing code always uses them. For devices that don't support OSD function we have to presume the sybols aren't available.
2021-01-16 13:57:04 -05: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
fe3f0aee3e Fixed unit tests. 2021-01-10 22:29:23 +13:00
Michael Keller
a702ee1a5b Simplified the OSD blink frequency calculation. 2021-01-02 01:04:13 +01:00
Bruce Luckcuck
01fb3940e7 Fix multiple div-by-zero related to battery cell count
Battery cell count will be 0 if the battery is not detected or the voltage meter is not configured. This exposed multiple div-by-zero risks.
2020-12-25 14:17:00 -05:00
Mark Haslinghuis
d596e259a0 Make test compatible with clang 11 on linux 2020-12-15 21:02:46 +01:00
Michael Keller
ae62f46958
Merge pull request #10303 from SteveCEvans/flash_speed 2020-10-27 13:52:15 +13:00
Steve Evans
41a0ca43d1 Run SPI FLASH at full speed 2020-10-27 00:17:34 +00:00
mikeller
be85489d9a Use clang-10 as default for tests. 2020-10-25 11:19:36 +01:00
Mark Haslinghuis
b88f948004 Fixed test build on Fedora and Ubuntu with native clang 2020-10-23 19:52:37 +02:00
Bruce Luckcuck
b9ed6b4034 Fix and re-enable BMP085 unit test
Since BMP085 is now included in some unified targets it makes sense that the unit test is active.
2020-10-14 10:39:49 -04:00
azol
420764490a fix unitest error 2020-09-28 18:10:27 +08:00
azol
2810b20c83 fix failed on testcase 2020-09-28 16:47:26 +08: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
Sam Lane
4c99ad743d Rename FAST_RAM to FAST_DATA 2020-08-23 08:49:26 +01:00
limonspb
464919c416 Motor output reordering for CLI and MSP
Fixed some code formatting

+fixReorderingArray() for EEPROM load/save and renamings

fix brace new line

moving MOTOR_OUTPUT_REORDERING to MSP2 betaflight specific

validateAndfixConfig now resets reordering motor array to default in case it is invalid
2020-07-27 20:10:37 -05:00
Michael Keller
94cd650472
Merge pull request #9981 from mikeller/fix_max7456_delay_problems
Fixed the MAX7456 loop time problems introduced by #9948.
2020-07-26 15:31:16 +12:00
Michael Keller
0e28a646fd
Merge pull request #9863 from mikeller/cleanup_crsf_tests
Cleaned up separation of CRSF test code.
2020-07-26 15:30:10 +12:00
mikeller
386be8d742 Added registration for bus devices. 2020-07-08 21:34:31 +12:00
Michael Keller
41fa8754bc
Merge pull request #9633 from mikeller/remove_vbat_pid_compensation
Remove vbat pid compensation
2020-07-06 13:41:27 +12:00
mikeller
cfc89c98a8 Fixed the MAX7456 loop time problems introduced by #9948. 2020-07-05 22:00:13 +12:00
Michael Keller
4abc447ffe
Merge pull request #9960 from phobos-/f4-dsmx
Spektrum SPI protocol improvements
2020-06-30 01:03:09 +12:00
Michael Keller
a0f6a91033
Merge pull request #9803 from fgiudice98/blackbox-freq-cms 2020-06-30 00:55:16 +12:00