1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00
Commit graph

178 commits

Author SHA1 Message Date
Steve Evans
73b26168cd
OSD background rendering (#13897)
* Ensure display severity attribute is set to defaults for background items

* MAX7456 doesn't have a background layer
2024-09-13 22:20:18 +02:00
ctzsnooze
254da8f460
Altitude hold for 4.6 (#13816) 2024-09-04 20:29:03 +10:00
Steve Evans
16827f0270
Split OSD element rendering into draw and display states (#13813) 2024-08-23 05:57:33 +10:00
Steve Evans
665a42e295
Add OSD display of 2nd block of debug values (#13800)
Add OSD display of 2nd blocks of debug values
2024-08-05 15:48:41 +02:00
Mark Haslinghuis
0686b74197
Add altitude variant for OSD (#13716) 2024-06-27 06:19:06 +10:00
Steve Evans
565de1b68b
Use the cached value of useDshotTelemetry to ensure consistent runtime use if dshot_bidir is changed (#13589) 2024-04-28 09:31:50 +10:00
ctzsnooze
5457032838
Use PDOP consistently, since it replaces HDOP (#13477) 2024-04-04 09:08:40 +11:00
Steve Evans
dc00d34bfd
Render spec screen over normal OSD (#13460) 2024-03-21 18:59:18 +01:00
Steve Evans
af51e00773
Fix OSD task timing when using MSP (#13388)
Add uartWriteBuf() to improve performance
Optimised transmit buffer space check
Tidy up group duration calculations
Add uartBeginWrite, uartEndWrite and serialWriteBufNoFlush
Remove OSD grouping and check on the fly. Implement multi-pass artificial horizon rendering.
Fix rendering of camera frame
Fix stick overlay background rendering
Fix channel rendering
Fix ESC information rendering
Make Spec Prearm Display deterministic

Co-authored-by: Petr Ledvina <ledvinap@gmail.com>
2024-03-11 17:46:06 +00:00
Mark Haslinghuis
435fe2750e
Add gate to HD OSD elements (#13347)
Update osd_elements.c
2024-02-11 21:09:21 +01:00
Ivan Efimov
bc69a92b86
Added d_min for PID osd elements (#13227)
* Added d_min for PID osd elements

* Update src/main/osd/osd_elements.c

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

---------

Co-authored-by: Jan Post <Rm2k-Freak@web.de>
2023-12-15 23:00:35 +01:00
Ivan Efimov
31c5beaf78
OSD spec prearm screen if defined USE_SPEC_PREARM_SCREEN (#13210)
* OSD spec prearm screen if defined USE_SPEC_PREARM_SCREEN

* osd spec prearm PR suggestions

* OSD_SPEC karatebrot logic suggestion

* Update src/main/osd/osd.c

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

---------

Co-authored-by: Jan Post <Rm2k-Freak@web.de>
2023-12-10 01:50:31 +01:00
Jan Post
5769b3021e
Dshot RPM Telemetry Refactoring (#13012) 2023-12-03 15:16:35 +11:00
Cru Waller
5f2d8da3b9
Fix OSD VTX band/channel info when direct frequency is used (#13032)
Fix OSD VTX band/channel when direct frequency is used
2023-08-16 11:31:39 +02:00
Eike Ahmels
083b595617
M10 ValSet support, unit connection and reconnect stability (#12799)
* WIP

* start of implement m10 code

* Fetch MON-VER from unit to check for unit version

* test nav5 m10 command

* missing empty lines

* offload detect to config file

* copy from hasli and organization

* fix platform.h include

* fix cli_unittest gps include

* fix cli_unittest for gps calls

* guard ublox version in gpsData

* print human readable hw version

* add utc_standard param and transfer with nav5 set
add nav5x message for autonomous mode for m10

* fix typo

* revert order structure, remove functions and reduce flash size

* revert order structure, remove functions and reduce flash size

* fix gps init and navx5 message

* generalized nav5 message

* remove unguarded debug

* change ubx version detection, baud rate negotiation fix and save found baud

* revert indentation

* revert indentation and refactorings

* the new code works with faster baud rate changes

* remove unguarded debug statement

* fix cli commands, major space reduce finished, removed extensions for now

* ubx version checks, add valset for M10

* beta of valset, change suggestions from ledvinap and macgivergim

* valset helper function and combine set nav rate valsets

* more valset refactoring

* remove big array and replace with macro

* remove assert, as it can stop bf completely

* refactoring to offsetof

* making reconnect more resilient, reorganize rate setup, so it doesnt get missed on init

* improved lost communcation detection, dont rely on ACK/NACK anymore

* paket rate debug

* adding debug mode, fixing major flight mode bug

* revert fake flight "isConfiguratorConnected"

* fixed proto detection, fixed reconfigure on too low updaterate

* valset doesnt always send ACK, so we dont wait for it

* size optimization, debug mode rename, minor fixes

* implemented some requested changes

* changed wait delay millisecond based

* fixes from ctzsnooze and zzXyz

* timer fixes

* CamelCase new settings names

* indent

* Fix failure to enter flight model on GPS Fix

* remove old commented out debugs

* simplify timeouts

* Clarify skip_acc and remove development valset code

* accept PL's advice to remove  >> (8 * 0

* Simplify package counter, remove reconfiguration based on packet count

* fix error in package count introduced in previous commit

* Fix delay detecting Configurator, ANA disable (for another PR)

* address payload comments and fix logical error

* indentation edits

* delete old enum

* log gps and firmware nav interval times

* fix payload size, inc Rx buffer to 256, ifDef for sw_proto

* remove token parsing (Petr suggestions)

* fixes from reviews

* Basic NMEA improvements

* Address comments from karate

* only check platform version - thanks zzyzx

* Fix for too many sats problem - thanks zzyzx

* tidy up comments, ifdef some ublox definitions

* Use Nav packet intervals, NMEA and UBX, for time delta

* Resolve comments and flatten conditionals

* editorial change

* single function for gpsSol.navIntervalMs

* adam-ah suggestion for payload optimisation

* ACK/NAK & polled message timer fixes

* Revert timer fixes - unexpected side effects

* Revert adam-ah suggestion for payload optimisation"

This reverts commit 42fc8c04fdbc436c9ef196b88f0764ffcbb9239f.
Broke the display of sat info when more than 32 sats in view

* implement a number of comments

* Fast task rate on new data, don't spam at the start

thanks adam-ah

* include PDOP for M10 via NAV-PVT

* Address some of PL's recent comments

* don't recalculate millis so many times

* tidy up baudrate connect code

* Split receiving of GPS bytes from processing by adding GPS_STATE_PROCESS_DATA

* Split receiving of GPS bytes from processing by adding GPS_STATE_PROCESS_DATA

* Preserve state whilst processing packets

* Set gpsData.state directly as gpsSetState() clobbers gpsData.state_position

* Restore original read time check

* Schedule gpsUpdate() to run immediately again when a packet is received for processing

* add debugs to display scheduler valuesl

* simpler scheduler solution

* minor debug change

* FIxes: M10 connection, pDop, NMEA disable; thanks zzyxz

NB: Breaks unit's neat reconnection methods
M8 need a lot of settling time before using the serial port

* ubx parse length sanity + cleanup + dashboard conditional compiles

* Address recent comments from PL

---------

Co-authored-by: ctzsnooze <chris.thompson@sydney.edu.au>
Co-authored-by: ZzyzxTek <zzyzx@zzyzxtek.com>
Co-authored-by: Steve Evans <Steve@SCEvans.com>
2023-08-12 12:10:55 +10:00
Steve Evans
fb9587b2ec
Use coloured fonts if supported (#13005) 2023-08-06 10:06:50 +02:00
SpencerGraffunder
aad197f791
Add GPS Lap Timer (#11856)
* Add gps lap timer

* change timing to GPS time instead of local time

* rebase and minor changes

* implement KarateBrot's suggestions

* follow ledvinap's suggestions, some OSD symbol changes

* move platform.h include to the top

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* fix osd elements not showing, remove useless block

* cleanup, move pg stuff to pg folder

* cleanup from review

* minor mods to gps lap timer update, add number of laps tracked

* rename time variable

* add const to timeMs

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* Update licenses, add is_sys_element macro

* update licenses

* round to nearest centisecond

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

---------

Co-authored-by: Jan Post <Rm2k-Freak@web.de>
2023-05-25 02:31:22 +02:00
Steve Evans
445758f3ec
Fix handling of attribute byte (#12701) 2023-04-21 00:15:04 +02:00
Mark Haslinghuis
1e1d12277b
Update RSSI_DBM to include diversity antenna in OSD element (CRSF) (#12359)
Add diversity antenna element for CRSF
2023-03-27 23:44:00 +02:00
Steve Evans
23602e6a89
Add HD OSD system elements for VTX temp and goggle fan speed (#11999)
* Add HD OSD system elements for VTX temp and goggle fan speed

* Update src/main/osd/osd_elements.c

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

Co-authored-by: haslinghuis <mark@numloq.nl>
2022-12-05 14:23:15 +11:00
Steve Evans
c508b6644d
Apply OSD severity (#11996) 2022-11-20 12:24:09 +01:00
Steve Evans
3e51d15559
Add HD OSD support (#11964) 2022-11-15 12:58:14 +11:00
haslinghuis
51588424c4
Fix getRssiDbm compiler error (#11982) 2022-11-15 01:59:52 +01:00
TonyBlit
22c5bf4eb3
Added RSNR to the OSD (#11062)
* Added RNSR to the OSD

* filtering with pt1

* update pgconfig ver

* rssi_smoothness and proper define wrapping

* missing define wrap

* smoothing moved to updateRSSI

* minor comment update

* fixed rx tests

Co-authored-by: Tony Cabello <>
Co-authored-by: J Blackman <blckmn@users.noreply.github.com>
2022-11-10 04:53:15 +01:00
Jan Post
6ed96f9adb
Parse GPS DOP values (#11912)
This is part 2 of a series to prepare for altitude estimations (and
later on full 3-dimensional estimations) with a new sensor fusion model.

This is a PR to get access to relevant dilution of precision values of
the GPS signal.
- `pDOP`: positional (3D) - for positional dilution in space
- `hDOP`: horizontal (2D) - for positional dilution above ground
- `vDOP`: vertical (1D) - for dilution of altitude
2022-11-02 16:00:34 +11:00
Krasiyan Nedelchev
e7df32f020 Rename 'display_name' to 'pilot_name'; rename 'name' to 'craft_name'; Add the 'MSP2_GET_TEXT' and 'MSP2_SET_TEXT' MSP commands
- add the 'MSP2_GET_TEXT' and 'MSP2_SET_TEXT' MSP2 commands

  - Support getting/setting the 'MSP2TEXT_PILOT_DISPLAY_NAME' config prop ('pilotConfigMutable()->displayName')

- rename 'display_name' to 'pilot_name'

  - Add the new 'OSD_PILOT_NAME' OSD element in place of the
  'OSD_DISPLAY_NAME' one (as they are semantically identical)
  - Add the 'osd_pilot_name_pos' cli prop in place of 'osd_display_name_pos'

- rename 'pilotConfigMutable()'s 'name' to 'craftName'

  - remove the legacy 'GET_NAME' / 'SET_NAME' MSP commands
  - replace the 'name' CLI prop for 'craft_name'
  - add the 'MSP2TEXT_CRAFT_NAME' constant for 'MSP2_GET_TEXT' and 'MSP2_SET_TEXT'
2022-10-25 23:03:46 +02:00
Jon Mahoney
d3c824d6b7 Ready Mode
By giving a mode that signals the pilot is ready other than armed props
at a race event it will be easier to determine when all pilots are ready
to race.
2022-10-23 23:00:00 -04: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
haslinghuis
7e441b5f4f
Merge pull request #11887 from KarateBrot/styledef
Remove old style definitions
2022-10-16 00:22:02 +02:00
haslinghuis
b84b8c1ca5
Merge pull request #11097 from mathiasvr/stdlib-abs
Use std abs() instead of ABS() macro
2022-10-14 00:37:29 +02:00
haslinghuis
ec32baa955
Merge pull request #10789 from alexeystn/osd_aux_channel
Add AUX channel value to OSD (e.g. for Pilot's Heart Rate)
2022-10-13 21:07:40 +02:00
KarateBrot
ddf1d46549 Remove old style definitions 2022-10-13 03:33:54 +02:00
Mathias Rasmussen
61ded491cd Use std abs() instead of ABS() macro
Changes uses of ABS() macro to <stdlib.h> abs() and <math.h> fabsf()
2022-10-12 19:49:03 +02:00
Mathias Rasmussen
9957ceb275 Fix function brace style 2022-10-12 16:31:55 +02:00
Alexey Stankevich
3984dd9e39 Rebase to master 2022-10-04 22:43:07 +03: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
J Blackman
c50372019d
Merge pull request #11275 from P-I-Engineer/VTX-power-OSD 2022-09-18 09:09:02 +10:00
iso9660
0dd6d4d47a Unified all eRPM calculations into one single function
Fixed some review findings

Unified dshot average rpm calculations into one single function

Renamed calcEscRpm to erpmToRpm, and moved function to dshot.c

Removed unused esc_sensor.h header file from dshot.c

Removed esc_sensor.h header from modules that no longer needs it

Average RPM calculated by demmand only when rpm data is updated

Renamed rpm to averageRpm and fixed a bug

Update average rpm when telemetry data is received

Removed blank line

Fixed review findings

Fixed return values for erpmToRpm and getDshotAverageRpm so rpm value doesn't truncate

Restored osd_esc_rmp_alarm setting. This setting is used to set an alarm to notify when rpm  goes down a specified threshold. Rpm can go over 109krpm (1s 26kv motors setup), but a low rpm alarm doesn't have to be set to a so high value so at this time [0-32767] seems an acceptable range

Rebased to master
2022-09-17 00:26:17 +02:00
danmos
21b3fc15b7 Extended Bidir DShot
Extended DSHOT telemetry
Fixed broken unit testing

Rebased to master

Extended DSHOT telemetry

Added DSHOT ESC fail to OSD warnings

Initial extended DSHOT implementation

DSHOT telemetry ranges readjusted

Added shot_telemetry_data to cli

Added DSHOT telemetry warnings

Added extended DSHOT telemetry temperature data to osd elements

Fixed DSHOT telemetry osd warnings

Make cli dshot telemetry types human readable

Fixed ESC temperature OSD element

Added extended dshot telemetry enable command to dshot command queue to enable it in tryArm function.

Fixed broken automated unit testing

Fixed text output for dshot_telemetry_data cli command

Decode extended telemetry only when it has been activated in the ESC

DSHOT extended telemetry is only enabled when an extended telemetry enable frame is being processed

Fixed broken automated unit testing

Update tail's dshot command in queue when running blocking commands, so extended dshot telemetry command responses can be associated to their corresponding extended dshot telemetry enable/disable command request

Added clariffication to dshot_get_telemetry_type_to_decode to explain mechanish used for processing DSHOT_CMD_EXTENDED_TELEMETRY_ENABLE response

Tabs cleanup
Added dshot motor stop fix when writting blocking commands

Added extended DSHOT telemetry to osd warnings
Fixed extended DSHOT telemetry in osd elements

Implemented msp extended dshot telemetry
Optimized osd warnings

Fixed code style

Added max temp to osd stats

Fixed automated unit testing

Fixed broken automated unit testing

Fixed missing extended dshot telemetry voltage and wrong current
Fixed unadverted change in gitignore file

Print esc number besides max esc tempetature in osd stats

issues and some other minor issues

ESC temperature is coded as an uint8 going from 0 to 255. Updated osd config esc_temp_alarm from int8_t to uint8_t to match esc temperature coding

issues and some other minor issues

Enable extended dshot telemetry when no esc sensors avaliable and dshot telemetry is enabled

Arranged dshot.h header and removed unnecessary headers from dshot.c

Updated dshot_telemetry_data cli command output

Fixed dshot_telemetry_data command

motor_output_unittest fixed

Fixed motor number printing in dshot_telemetry_data cli command

fixed motor_output_unittest

Merged dshot_telemetry_data into dshot_telemetry_info cli command

Fixed tabs

Fixed motor_output_unittest

Support extended DSHOT telemetry on DJI FPV

Fixed Compiling fails without USE_ESC_SENSOR and USE_DSHOT_TELEMETRY defines.

Fixed whencompiling without USE_ESC_SENSOR and USE_DSHOT_TELEMETRY

Reworked so code can be compiled with USE_ESC_SENSOR and USE_DSHOT_TELEMETRY separately

Enabling EDT the correct way

Removed unecessary conversions

Changed motorIndex datatype to uint8_t in dshot functions
2022-09-14 20:11:58 +02: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
howels
07f882aed1 Lower max CraftName length to avoid inadvertent data loss 2022-08-16 12:17:56 +01:00
J Blackman
2bb3fef844
Merge pull request #11761 from SteveCEvans/semicolon
Remove superfluous double ;
2022-08-05 08:28:20 +10:00
howels
04994e5439 Add USE_CRAFTNAME_MSGS to insert additional data into CraftName when osd_craftname_msgs is true 2022-08-04 21:59:49 +01:00
Steve Evans
cf3615938b Remove superfluous double ; 2022-07-24 14:49:35 +01:00
J Blackman
40900658fc
Merge pull request #11670 from limonspb/osd_toupper_refactoring
Extract function toUpperCase for osd elements
2022-06-28 00:47:44 +10:00
Ivan Efimov
191294aad0 Extract function toUpperCase for osd elements 2022-06-23 05:00:30 -05:00
ctzsnooze
f7c645bfcd update GPS code 2022-06-13 09:43:52 +10:00
Robert Cisneros
874911c359 Update for Battery Efficiency Fix Issue #11277 2022-02-13 07:32:47 -06: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
p-i-engineer
5cf79f0b2b added vtx osd channel variant element 2022-01-12 16:59:40 -08:00