1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 11:29:58 +03:00

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>
This commit is contained in:
Eike Ahmels 2023-08-12 04:10:55 +02:00 committed by GitHub
parent 807a7229c9
commit 083b595617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1650 additions and 803 deletions

View file

@ -4787,7 +4787,7 @@ if (buildKey) {
#ifdef USE_GPS
cliPrint("GPS: ");
if (featureIsEnabled(FEATURE_GPS)) {
if (gpsIsHealthy()) {
if (gpsData.state >= GPS_STATE_CONFIGURE) {
cliPrint("connected, ");
} else {
cliPrint("NOT CONNECTED, ");
@ -4808,7 +4808,7 @@ if (buildKey) {
cliPrint("), ");
}
}
if (!gpsIsHealthy()) {
if (gpsData.state <= GPS_STATE_CONFIGURE) {
cliPrint("NOT CONFIGURED");
} else {
if (gpsConfig()->autoConfig == GPS_AUTOCONFIG_OFF) {
@ -4817,6 +4817,12 @@ if (buildKey) {
cliPrint("configured");
}
}
if (gpsData.platformVersion != UBX_VERSION_UNDEF) {
cliPrint(", version = ");
cliPrintf("%s", ubloxVersionMap[gpsData.platformVersion].str);
} else {
cliPrint("unknown");
}
} else {
cliPrint("NOT ENABLED");
}
@ -4864,15 +4870,15 @@ static void cliTasks(const char *cmdName, char *cmdline)
if (systemConfig()->task_statistics) {
#if defined(USE_LATE_TASK_STATISTICS)
cliPrintLinef("%6d %7d %7d %4d.%1d%% %4d.%1d%% %9d %6d %6d %7d",
taskFrequency, taskInfo.maxExecutionTimeUs, taskInfo.averageExecutionTime10thUs / 10,
maxLoad/10, maxLoad%10, averageLoad/10, averageLoad%10,
taskInfo.totalExecutionTimeUs / 1000,
taskInfo.lateCount, taskInfo.runCount, taskInfo.execTime);
taskFrequency, taskInfo.maxExecutionTimeUs, taskInfo.averageExecutionTime10thUs / 10,
maxLoad/10, maxLoad%10, averageLoad/10, averageLoad%10,
taskInfo.totalExecutionTimeUs / 1000,
taskInfo.lateCount, taskInfo.runCount, taskInfo.execTime);
#else
cliPrintLinef("%6d %7d %7d %4d.%1d%% %4d.%1d%% %9d",
taskFrequency, taskInfo.maxExecutionTimeUs, taskInfo.averageExecutionTime10thUs / 10,
maxLoad/10, maxLoad%10, averageLoad/10, averageLoad%10,
taskInfo.totalExecutionTimeUs / 1000);
taskFrequency, taskInfo.maxExecutionTimeUs, taskInfo.averageExecutionTime10thUs / 10,
maxLoad/10, maxLoad%10, averageLoad/10, averageLoad%10,
taskInfo.totalExecutionTimeUs / 1000);
#endif
} else {
cliPrintLinef("%6d", taskFrequency);