mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-12 19:10:32 +03:00
Merge branch 'master' into RP2350
This commit is contained in:
commit
9cc48c36d9
7 changed files with 10 additions and 15 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 7db4179ef7159138deebf5f671373e7a46a8a162
|
||||
Subproject commit 17892ac1bd9bc74f77870c14a2da386a1c614dd3
|
|
@ -625,7 +625,7 @@ static void updateGpsHeadingUsable(float groundspeedGain, float imuCourseError,
|
|||
gpsHeadingConfidence += fmaxf(groundspeedGain - fabsf(imuCourseError), 0.0f) * dt;
|
||||
// recenter at 2.5s time constant
|
||||
// TODO: intent is to match IMU time constant, approximately, but I don't exactly know how to do that
|
||||
gpsHeadingConfidence -= 0.4 * dt * gpsHeadingConfidence;
|
||||
gpsHeadingConfidence -= 0.4f * dt * gpsHeadingConfidence;
|
||||
// if we accumulate enough 'points' over time, the IMU probably is OK
|
||||
// will need to reaccumulate after a disarm (will be retained partly for very brief disarms)
|
||||
canUseGPSHeading = gpsHeadingConfidence > 2.0f;
|
||||
|
|
|
@ -219,7 +219,7 @@ static void calculateThrottleAndCurrentMotorEndpoints(timeUs_t currentTimeUs)
|
|||
throttle = 0;
|
||||
currentThrottleInputRange = rcCommandThrottleRange3dHigh;
|
||||
}
|
||||
if (currentTimeUs - reversalTimeUs < 250000) {
|
||||
if (cmpTimeUs(currentTimeUs, reversalTimeUs) < 250000) {
|
||||
// keep iterm zero for 250ms after motor reversal
|
||||
pidResetIterm();
|
||||
}
|
||||
|
|
|
@ -343,16 +343,13 @@ static void mspFcSetPassthroughCommand(sbuf_t *dst, sbuf_t *src, mspPostProcessF
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Remove the pragma once this is called from unconditional code
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
static void configRebootUpdateCheckU8(uint8_t *parm, uint8_t value)
|
||||
MAYBE_UNUSED static void configRebootUpdateCheckU8(uint8_t *parm, uint8_t value)
|
||||
{
|
||||
if (*parm != value) {
|
||||
setRebootRequired();
|
||||
}
|
||||
*parm = value;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
static void mspRebootFn(serialPort_t *serialPort)
|
||||
{
|
||||
|
|
|
@ -1243,7 +1243,7 @@ STATIC_UNIT_TESTED bool osdProcessStats1(timeUs_t currentTimeUs)
|
|||
|
||||
if (ARMING_FLAG(ARMED)) {
|
||||
osdUpdateStats();
|
||||
timeUs_t deltaT = currentTimeUs - lastTimeUs;
|
||||
int deltaT = cmpTimeUs(currentTimeUs, lastTimeUs);
|
||||
osdFlyTime += deltaT;
|
||||
stats.armed_time += deltaT;
|
||||
#ifdef USE_LAUNCH_CONTROL
|
||||
|
|
|
@ -115,12 +115,10 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
|
|||
|
||||
#ifdef USE_DSHOT
|
||||
if (isTryingToArm() && !ARMING_FLAG(ARMED)) {
|
||||
int armingDelayTime = (getLastDshotBeaconCommandTimeUs() + DSHOT_BEACON_GUARD_DELAY_US - currentTimeUs) / 1e5;
|
||||
if (armingDelayTime < 0) {
|
||||
armingDelayTime = 0;
|
||||
}
|
||||
if (armingDelayTime >= (DSHOT_BEACON_GUARD_DELAY_US / 1e5 - 5)) {
|
||||
tfp_sprintf(warningText, " BEACON ON"); // Display this message for the first 0.5 seconds
|
||||
const int beaconGuard = cmpTimeUs(currentTimeUs, getLastDshotBeaconCommandTimeUs());
|
||||
const int armingDelayTime = MAX(DSHOT_BEACON_GUARD_DELAY_US - beaconGuard, 0) / 100000; // time remaining until BEACON_GUARD_DELAY, in tenths of second
|
||||
if (beaconGuard < 500 * 1000) { // first 0.5s since beacon
|
||||
tfp_sprintf(warningText, " BEACON ON");
|
||||
} else {
|
||||
tfp_sprintf(warningText, "ARM IN %d.%d", armingDelayTime / 10, armingDelayTime % 10);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ int8_t previousThrottlePercent = 0;
|
|||
|
||||
void rcStatsUpdate(timeUs_t currentTimeUs)
|
||||
{
|
||||
uint32_t deltaT = currentTimeUs - previousTimeUs;
|
||||
uint32_t deltaT = cmpTimeUs(currentTimeUs, previousTimeUs);
|
||||
previousTimeUs = currentTimeUs;
|
||||
const int8_t throttlePercent = calculateThrottlePercent();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue