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

71 commits

Author SHA1 Message Date
Petr Ledvina
866191dfad
Refactor gps (#13853) 2024-10-24 06:45:17 +11:00
ctzsnooze
776e8c7b3c
Refactor Rx code and better support 25Hz links (#13435)
* RX task update rate to 22Hz, to improve 25Hz link stability

* modified Rx code

* add LQ to debug

* use max of frameAge or FrameDelta

* Require a dropouit of 200ms, not 100ms, before RXLOSS

* remove FrameAge, use 150ms timeout 50ms checks

* fix tests and tidy up the comments

* Handle NULL input as before, log frame time

* possible solutions to review comment about names

* Remove rxFrameTimeUs

- prepare for direct use of lastRcFrameTimeUs
- refactor rx_spi callback

* remove global currentRxRateHz

* simplify updateRcRefreshRate

* re-name to recheck interval, return frame time debug

* Calculate RxRate only once

* use rxReceivingSignal for consistency

* use signalReceived not rxDataReceived for consistency

* suggestions from review PL

* move defines, thanks K

* fixes from review, thanks MH

* review changes, undo task interval change

rename bool rxIsReceivingSignal to isRxReceivingSignal
thanks Steve for resolving that tasks changes are not needed
thanks PL for your feedback also

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2024-10-01 09:23:24 +10:00
Jan Post
f71170db1b
Vector library expansion (#12968) 2024-09-16 07:03:32 +10: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
ctzsnooze
4528fc2b70 use PWM_RANGE consistently 2022-10-23 21:52:36 +11:00
Mathias Rasmussen
90e792e243 Use ARRAYLEN macro where applicable 2022-10-12 13:14:51 +02:00
Steve Evans
cc3552b032 Report true average task execution time in tasks report 2022-03-02 21:30:02 +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
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
Krzysztof Kuczek
fd7f1e6991 cosmetic changes 2 2021-01-19 20:05:52 +01:00
Krzysztof Kuczek
78049955dd cosmetic changes 2021-01-19 20:03:05 +01:00
Krzysztof Kuczek
4cd1f4efb4 new dashboard OLED page for Black Box 2021-01-16 20:06:07 +01:00
John Polstra
72f6934202 Fix a format/argument mismatch in a call to tfp_sprintf(). The call
contained an extra argument for which there was no corresponding format
specification.
2020-08-06 10:51:34 -07:00
Thomas Stibor
bcc8a05978 Determine correct size of TICKER_CHARACTER_COUNT
Since tickerCharacters is a char pointer rather than a char array the
result is: sizeof(8) / sizeof(1).
However, desired
result is: sizeof(5) / sizeof(1).

See also following example:

const char *tickerCharacters = "|/-\\";
const char _tickerCharacters[] = "|/-\\";

int main(void)
{
	printf("%zu\n", (sizeof(tickerCharacters) / sizeof(char)));
	printf("%zu\n", (sizeof(_tickerCharacters) / sizeof(char)));

	return 0;
}

> gcc test.c -o test && ./test
8
5
2020-04-13 19:21:22 +02:00
mikeller
db4bd1f186 Cleaned up the scheduler. 2020-03-16 08:35:58 +13:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
mikeller
0a0d3631a7 Renamed 'rxRuntimeConfig' to 'rxRuntimeState'. 2019-10-22 00:12:51 +13:00
jflyper
f9bd71f9be Remove bogus pg/pg.h and pg/pg_ids.h from driver files 2019-06-29 02:21:51 +09:00
mikeller
b5908f5bab Applied 'USE_ACC' consistently. 2019-02-08 09:51:48 +13:00
fgiudice98
9d5fb85474 Increased vbat precision 2018-12-25 12:00:45 +01:00
jflyper
f43dc4e294 Fix buffer overruns in dashboard.c 2018-11-14 12:09:28 +09:00
mikeller
a03f30efa0 Converted 'SKIP_' defines to 'USE_'. 2018-10-25 00:38:05 +13:00
mikeller
6de1c32d9d Added shadow copies for CLI and MSP. 2018-08-21 00:36:47 +12:00
mikeller
c99629bbf1 Removed calls to (latching) 'feature()'. 2018-08-21 00:35:55 +12:00
jflyper
041bfb22c6 Create a pg for rxConfig 2018-05-27 09:13:04 +09:00
s0up
ac6b8088c9 add gps rescue mode 2018-05-20 16:28:17 -07:00
s0up
de5fa47c4c navigation feature / reference removal 2018-05-09 10:28:36 -07:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
jflyper
93ce6e542a Separate pg related to pg directory 2018-02-09 16:46:12 +09:00
Adrian Miriuta
b21d681153 Introduced cli parameter <gyro_offset_yaw>
It allows to manually compensate gyro drift over time.
rebased squashed.
2018-01-25 12:45:38 +01:00
mikeller
ee65eba88d Added selectable RaceFlight rates. 2018-01-19 00:38:14 +13:00
Martin Budden
d90b42970c Acc fn/variable renames to align with iNav 2017-12-29 10:23:51 +00:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
mikeller
a8d34dabb0 Changed defines for GYRO/ACC/MAG/BARO/GPS/SONAR/OSD/BLACKBOX/CMS to conform to the USE_ convention. 2017-11-05 10:15:24 +13:00
Martin Budden
53f5e87c7a Add void to function declarations/definitions where required 2017-09-24 09:22:48 +01:00
Martin Budden
c0961d7f4c Fixed some comparion sign warnings in MAX macros 2017-08-16 08:55:12 +01:00
brucesdad13@gmail.com
3c010c98d0 @jflyper gave a recommendation to improve PR #3568 to remove hardcoded strings for firmware revision--implemented.
~ Charlie Stevenson
2017-07-19 23:47:44 -04:00
brucesdad13@gmail.com
78ded9e6f7 * OLED display showed CLEANFLIGHT V3.2.0... cahnged to BETAFLIGHT
~ Charlie Stevenson
2017-07-19 21:01:20 -04:00
jflyper
af4059e0ca dashboard & oled conversion 2017-07-15 23:27:24 +09:00
Martin Budden
0d2239ddd6 Dashboard tidy 2017-06-28 21:00:02 +01:00
Martin Budden
3d7145b088 Fix as per @jflyper's comments 2017-06-28 14:40:42 +01:00
Martin Budden
c00ffe0427 Changed bus to be a pointer variable 2017-06-28 13:37:18 +01:00
Martin Budden
82be9ecd78 For discussion - Reconfigurable OLED display alternative 2017-06-28 13:37:18 +01:00
Martin Budden
564e0c94b8 Move some GPS variables into struct. Some alignment with iNav 2017-06-25 14:44:04 +01:00
Dominic Clifton
15a786d7f1 Merge pull request #2839 from cleanflight/cleanup-dashboard-1
Cleanup some dashboard code.
2017-06-05 09:55:32 +12:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Martin Budden
71546410de Rearrange PID array to be array of PIDs 2017-05-06 11:06:47 +01:00
Hydra
2b1dac4c6d CF/BF - First cut of allow building of the OSD SLAVE board without all
the flight controller code.

Likely the dependencies can be further improved.  This is a
minimal-impact solution while there are a lot of other Betaflight PR's
still pending.
2017-04-12 00:39:27 +01:00
Hydra
067d3c0ac2 CF/BF - First cut of Current/Voltage/Battery cleanup.
many refactorings, bugs squished, concerns separated,
single-responsibility violations fixed and performance optimizations.
2017-03-19 10:40:03 +00:00