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

18409 commits

Author SHA1 Message Date
Mark Haslinghuis
958f49c35f
Fix MAX7456 clock configuration (#13030) 2023-08-15 04:38:22 +10:00
Cru Waller
632a13b821
AT32F43x: make sure the SRAM configuration is valid (#13031) 2023-08-15 04:37:12 +10:00
Steve Evans
a5791814c0
Allow for F7 UART idle preamble to be sent on startup (#13021) 2023-08-12 14:31:12 +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
807a7229c9
UART enable disable f4 (#13019)
Enable/disable the F4/AT32 UART TX before changing the TX pin mode
2023-08-09 13:10:15 +02:00
Steve Evans
a54bc47e1b
Enable/disable the UART TX before changing the TX pin mode (#13017) 2023-08-08 07:49:51 +02:00
Ivan Efimov
9bbe2836a4
Fix: disable sag compensation if RPM limit is active (#12918) 2023-08-08 08:51:53 +10:00
Mark Haslinghuis
33db707939
Revert 12512 (#12956) 2023-08-08 08:51:22 +10:00
Mark Haslinghuis
bcc7c3fe03
Rename default configuration macro's for vbat divider and multiplier (#12987) 2023-08-08 08:50:48 +10:00
Dominic Clifton
199c0ec99d
Fix escserial for HAL targets. (#12992)
* Fix escserial for HAL targets.

* Remove the code disabling ESCSERIAL for F7.

* Timer/StdPeriph - Add an implementation of 'timerReconfigureTimebase'.

Simply calls the `configTimeBase`, seemed cleaner than adding #ifdef USE_HAL_DRIVER everywhere instead.
2023-08-08 08:49:48 +10:00
Mark Haslinghuis
0eac4df5a4
Remove sdcard include header from usb_io (#13007) 2023-08-07 12:32:23 +02:00
Steve Evans
4831683155
Remove cs lock device (#12999)
Remove csLockDevice as SD card cannot share an SPI bus
2023-08-07 12:30:06 +02:00
Ivan Efimov
dfef3bfb0e
Added throttle flight statistics (#12978)
* Added throttle flight statistics

* Changed rc_stats.c/h license header to a modern one

* rc_stats.c Style fix
2023-08-06 17:32:57 +02:00
Steve Evans
fb9587b2ec
Use coloured fonts if supported (#13005) 2023-08-06 10:06:50 +02:00
Steve Evans
5d29a0be06
Fix MSP_DISPLAYPORT_UART assignment (#13000) 2023-08-02 16:16:58 +02:00
Mark Haslinghuis
438e96c1f0
Rename flight mode (#12983)
* Rename flight mode

* Remove GND mode
2023-08-01 11:24:32 +02:00
J Blackman
d5d3ee88be
Removing STM specific defines from common_pre, and other cleanups (#12982)
Removing STM specific defines from common_pre, and other cleanup
2023-07-27 11:34:28 +02:00
Mark Haslinghuis
0d96c7ec77
Add default port settings for serial port functions (#12986)
* Add default port settings for MSP and ESC_SENSOR

* Add more serial port functions

* Add missing FUNCTION_MSP_DISPLAYPORT
2023-07-26 08:54:26 +10:00
Ivan Efimov
9332248742
Adding OSD quick menu (#12977)
* QUICK CMS menu

* Added RPM LIMIT to quick menu

* rpm_limiter csm step = 100

* Renamings + USE_OSD_QUICK_MENU define

* Small fixes

* Style fixes

* tests makefile fix

* Activate quick menu by default, if defined USE_OSD_QUICK_MENU

* Changed .c/.h license headers to a modern one
2023-07-26 08:54:02 +10:00
Dominic Clifton
2edc5fb7d5
Makefile - use -gddb2, not -gddb3 due to issues with GDB crashing. (#12971)
Makefile - use gddb2, not gddb3 due to issues with GDB crashing.

The cause seems to be the macro debugging information which when generated by the compiler, apparently incorrectly, causes GDB to use excessive amounts of CPU and crash.

Error:
"gdb/utils.c:717\
: internal-error: virtual memory exhausted: can't allocate 4064
bytes.\nA problem internal to GDB ha\
s been detected,\nfurther debugging may prove unreliable."

Reference:

* https://sourceware.org/bugzilla/show_bug.cgi?id=28219#c15
* https://github.com/microsoft/vscode-cpptools/issues/9219#issuecomment-1118034083

Note this crashing behavior is observed with `GCC > 9.3.1`, `9.3.1` itself is OK.
2023-07-26 08:53:10 +10:00
Mark Haslinghuis
293e14e8bd
Revert 12577 change for F4 (#12969) 2023-07-21 13:23:40 +10:00
Mark Haslinghuis
1485438c40
Add H725 target support (#12951)
* Add H725 target support

* H7 - Add more notes regarding VOS and cpu frequency

* Remove H723xG_TARGETS
2023-07-14 11:01:41 +10:00
Mark Haslinghuis
949181e084
Add support for IST8310 compass (#12917)
* Add support for IST8310 compass

* fix read

* Using states

* Fixes after review
2023-07-10 15:47:12 +02:00
Eike Ahmels
214946bc3f
AT32F435 camera control (#12913)
* [AT32] camera control

* remove comments

* change to mcu specific implementation

* fix includes
2023-07-10 15:54:20 +10:00
Steve Evans
be9652923a
Add dshot_telemetry_start_margin setting (#12912) 2023-07-10 15:53:18 +10:00
Eike Ahmels
acb52cba56
add uart 6 and 7 (#12928)
* add uart 6 and 7

* Update src/main/drivers/at32/serial_uart_at32f43x.c

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

* code formatting

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2023-07-10 15:51:52 +10:00
tbolin
90d09e2e5b
Add unfiltered gyro black box field (#12907)
* Add unfiltered gyro black box field

* Rename UFGYRO and GyroUf to gyroUnfilt
2023-07-07 09:37:32 +02:00
ctzsnooze
9186d05468
GPS rescue IMU, velocity iTerm and other fixes (#12900)
* GPS rescue update after merge of IMU fix

imuYawCog boost on error
initial turn radius adjustment
attitude debug changes
rescue velocity iterm fixes
earth referencing of yaw forced to on
sanity check failure time 30s

* vary IMU gain according to groundspeed

* Review suggestions implemented
2023-07-05 17:51:28 +02:00
Steve Evans
1333771140
Handle USART TX pulldown (#12929)
SA is always unidirectional
Only switch AT32 TX line to input when transmission is complete
2023-07-02 22:09:00 +02:00
Dominic Clifton
6ba117d69e
Improve CI target visibility (#12930)
* Add SPRacingH7RF to CI targets.

* It uses memory-mapped flash.
* It uses OctoSPI.
* It uses EXST.

* Add SPRACINGH7EXTREME to CI targets.

* It uses QuadSPI.
* It uses EXST.
2023-06-30 10:02:25 +10:00
Eike Ahmels
0503311498
Fix Serial USB COM port (#12911) 2023-06-23 02:51:56 +10:00
ASDosjani
2eb378c66d
[AT32] Change evaluation order (#12903)
Change evaluation order
2023-06-22 16:05:03 +02:00
Eike Ahmels
3f80b0c8bf
Implement DShot bit bang for AT32 (#12577)
* implement dshot bitbang for AT32

* fix dshot bitbang bidirectional for AT32

* AT32 target features

* implement latest improvements from steve to at32

* generalize AT32 target.h

* Tri-state USART TX output if load due to powered down peripheral is detected

* enable LED STRIP for AT32

* at bitbang timer adjustments

* revert makefile changes

* revert target generalization

* Update src/main/drivers/at32/platform_mcu.h

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

---------

Co-authored-by: Steve Evans <Steve@SCEvans.com>
Co-authored-by: J Blackman <blckmn@users.noreply.github.com>
Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2023-06-22 07:31:16 +10:00
ASDosjani
c243e83de2
Platform target evaluation fix (#12904) 2023-06-21 11:09:38 +02:00
tbolin
96c788c87f
Add (e)RPM field to blackbox logs (#12823)
* Add RPM black box field

* Fix settings table spacing

* Move RPM field to end of FlightLogFieldSelect enum

* Fix various RPM logging related bugs

- change eRPM I frame encoding to UNSIGNED_VB (was SIGNED_VB)
- change eRPM P frame prediction to PREVIOUS (was AVERAGE_2)
- change eRPM log field name to 'eRPM(/100)' (was 'RPM')
- rename rpm field in blackboxMainState_s to erpm
- minor formatting fixes to BlackBoxMainFields spacing and some if clauses

* Remove superfluous parentheses in blackbox.c
2023-06-20 01:41:39 +02:00
Petr Ledvina
8308540932
Refactor imuCalcKpGain (#12859)
Rewrite of old code, shall be functionally identical. Timer wraparound
bugs fixed.
Both original and new version do not match function comments, another
change is necessary.

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2023-06-20 01:03:06 +02:00
Mark Haslinghuis
48be6f26a9
Fix rcSmoothing warning OSD (#12898) 2023-06-19 10:59:15 +02:00
Petr Ledvina
5eaab0226d
IMU - increase gain on large Course over ground error (#12792)
* IMU - increase gain on large Course over ground error
* Fix Cog calculation in IMU

Old code did align CoG antiparallel to Yaw. Cross product stays the
same, but dot product is inverted.

@iNav - this is probably reason for magic numbers in iNav IMU
rewrite (especially wind compensation)

* Update gtest

Copy of debian/stable libgtest-dev

* Add unittest for IMU CoG

Work in progress

* IMU - convert compass to new alignment calculation

* IMU Unittests

- new wrapped EXPECT_NEAR_DEG / EXPECT_NEAR_RAD
- magnetometer testing

* IMU - CoG evaluation based on thrust vector

---------

Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
2023-06-19 09:30:45 +10:00
Andrey Mironov
a98364fa55
Separate resources for SOFTSERIAL_TX & SOFTSERIAL_RX (#11786)
* Addressed review comments

* Unify USE_SOFTSERIAL

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
2023-06-18 02:25:01 +02:00
Mark Haslinghuis
d1eb214332
Fix rcSmoothing warning (#12893) 2023-06-18 01:48:58 +02:00
Schuwi
c1694c2b60
Fix g force calculation (#12892) 2023-06-18 08:45:05 +10:00
Eike Ahmels
ac84115f8d
fix led strip for h7 (#12890)
* fix led strip for h7

* account for cloud build custom defines

* remove unused code
2023-06-17 12:36:10 +02:00
J Blackman
70b9c7fb66
GPIO alternate function initialisation removal for HAL. (#12888)
GPIO alternate function removal for HAL.

The all timer initialisation was actually not required as the initialisation is located where needed (previously required for STD PERIPH / AT32). The previous for loop excluded the actual setup in any case as all the full timer hardware items where TIM_USE_ANY.
2023-06-16 17:53:21 +02:00
Andrey Mironov
b8855d3a71
G4 LPUART rework (#11821)
* Extracted SOTSERIAL_TX & RX resources

* Fixed LPUART1 on G4
2023-06-15 17:18:20 +02:00
Dmytro
7b39d3d296
Rename make folder to get rid of build error. (#12880)
When trying to build firmware with current directory in PATH environment
it scans for make command and generates "Permission denied" error in
case if current directory in PATH precedes /usr/bin/ directory.In my
case it was caused by incorrect pyenv init script.

Rename make folder to avoid errors like this.
2023-06-14 21:48:55 +02:00
Mark Haslinghuis
eb4d95e039
[CONFIG] Add NUCLEOF446 Development Board (#12678)
Add NUCLEOF446 Development Board
2023-06-14 13:42:33 +10:00
Mark Haslinghuis
10aab0236a
Fix MAG redefines (#12882) 2023-06-14 13:36:53 +10:00
Steve Evans
2af7337204
Call updateInit() before writing motor command data (#12865) 2023-06-14 00:09:51 +02:00
Dominic Clifton
646de8c57d
Fix GPIO AF settings being overridden by timerInit(). (#12886) 2023-06-13 19:08:56 +10:00
Mark Haslinghuis
7d1007ea03
Enables retrieval of the RELEASE_NAME using MSP2 (#12878)
Retrieve releasename
2023-06-11 02:28:52 +02:00