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

16053 commits

Author SHA1 Message Date
Bruce Luckcuck
1148ea16a1 Prevent possible buffer overrun in MSPv2 message parsing
The MSPv2 parsing was missing a check (present in v1) to prevent a possible buffer overrun if the payload exceeded the buffer size.

Also some code formatting cleanup.
2020-05-08 10:51:04 -04:00
nickdbate
02f23a6120 Added QMC-5883 magnetometer support to SPRACING H7 ZERO target
Added QMC-5883 magnetometer support to SPRACING H7 ZERO target. Duplicating pull request #9531
2020-05-07 16:38:11 +01:00
mikeller
9bace5b9d1 Fixed condition for the 'ANTI GRAVITY' mode switch to hide it wen anti-gravity is disabled. 2020-05-08 01:14:45 +12:00
Michael Keller
b2e99c6651
Merge pull request #9771 from shellixyz/fix/frsky_crc 2020-05-07 23:39:01 +12:00
Michel Pastor
347483250b Fix CRC algo for FrSky S.Port and F.Port 2020-05-07 01:25:51 +02:00
nickdbate
f5cf84a5d6 Added QMC-5883 magnetometer support to SPRACING H7 NANO target
Added QMC-5883 magnetometer support to SPRACING H7 NANO target. Duplicating pull request #9531
2020-05-06 20:53:37 +01:00
Michael Keller
061f379654
Merge pull request #9765 from etracer65/gyro_driver_size_optimization 2020-05-07 02:17:36 +12:00
Michael Keller
0723691030
Merge pull request #9758 from phobos-/osd-rpm-fix 2020-05-07 02:16:50 +12:00
Michael Keller
aece9a226a
Merge pull request #9764 from mikeller/added_test_target_instructions 2020-05-07 01:32:09 +12:00
Bruce Luckcuck
f3c1e4e07f Change gyro driver initialize-only files to size-optimized
The following driver files only contain initialization and configuration fuctions and were erroneously set up for speed-optimization. Moving them to size-optimization saves significant space. They all share common runtime functions contained in `drivers/accgyro/accgyro_mpu.c` which is correctly speed-optimized.

```
drivers/accgyro/accgyro_mpu6050.c
drivers/accgyro/accgyro_mpu6500.c
drivers/accgyro/accgyro_spi_mpu6000.c
drivers/accgyro/accgyro_spi_mpu6500.c
drivers/accgyro/accgyro_spi_mpu9250.c
drivers/accgyro/accgyro_spi_icm20689.c
```

Also added explicit `#ifdef USE_` around the code of some of the drivers missing it. Doesn't result in any space savings as the compiler optimizes out the unused functions. But better in the long-term as it will flag any cases where the code might be called without proper bounding.

Saves 10704 bytes on STM32F7X2.
2020-05-04 16:43:47 -04:00
mikeller
103712855c Added instructions for how to add test targets to pull requests. 2020-05-05 00:24:51 +12:00
phobos-
ad39dc4839 Fixed max esc rpm osd statistic when dshot telemetry is enabled 2020-05-04 13:50:13 +02:00
Michael Keller
8d45795375
Merge pull request #9751 from mikeller/fix_cms_git_revision_display 2020-05-04 22:43:04 +12:00
Michael Keller
f7087dca8c
Merge pull request #9757 from mikeller/add_clean_to_unified_zip 2020-05-04 22:42:34 +12:00
Bruce Luckcuck
c06106e2d1 Split initialization from pid.c for flash savings
Move low performance requirements initialization code into pid_init.c and optimize that for size.

Saves 2688 bytes for target STM32F7X2.
2020-05-03 13:58:55 -04:00
mikeller
b1d2c4483e Add 'clean' target to 'unified_zip' Makefile target. 2020-05-03 15:55:46 +12:00
mikeller
f8d17032cf Added metric for consumption in mAh to LTM telemetry. 2020-05-03 13:23:50 +12:00
mikeller
b7ee04127d Removed the unused setting 'mag_declination'. 2020-05-02 23:30:01 +12:00
mikeller
a90147cefb Fixed the display of lowercase characters in the git revision string in CMS. 2020-05-02 19:10:35 +12:00
Michael Keller
3271ee3e13
Merge pull request #9742 from mikeller/fix_spi_transaction_support 2020-05-02 16:38:04 +12:00
Your Name
c766ff4fae I2C3_SCL and I2C3_SDA pins were mixed up 2020-05-02 04:26:09 +03:00
mikeller
da43a39e3e Fixed support for USE_SPI_TRANSACTION. 2020-05-01 00:21:42 +12:00
Michael Keller
b480103d42
Merge pull request #9739 from etracer65/fix_bootgrace_reset 2020-04-29 20:02:23 +12:00
Michael Keller
65c562eee3
Merge branch 'master' into fix_bootgrace_reset 2020-04-29 19:39:03 +12:00
Bruce Luckcuck
9ce1e6ddc3 Fix BOOTGRACE arming disabled reset when motor protocol is DISABLED 2020-04-28 09:22:08 -04:00
Michael Keller
65fb16eb37
Merge pull request #9735 from mikeller/fix_ms5611_spi_baro 2020-04-28 23:06:37 +12:00
mikeller
278ebf3aea Fixed the MS5611 baro in SPI mode. 2020-04-27 00:52:11 +12:00
Michael Keller
212dab7ecd
Merge pull request #9686 from Daemon42/patch-1
Fix rssi_scale formula.
2020-04-25 17:04:55 +12:00
Michael Keller
35e95b2eb7
Merge pull request #9718 from mikeller/added_unified_target_testing_instructions 2020-04-25 17:02:55 +12:00
Michael Keller
8d2e97e529
Merge pull request #9730 from etracer65/fix_arming_disable_rpmfilter_bitbang 2020-04-25 16:59:54 +12:00
Michael Keller
393a432927
Merge pull request #9728 from etracer65/dynamic_idle_rpmfilter_check 2020-04-25 12:56:23 +12:00
Bruce Luckcuck
62adae7374 Fix ARMING_DISABLED_RPMFILTER when DSHOT bitbang is enabled
The function that checks for each motor having valid telemetry broke with the implementation of bitbang. Effectively the motor count was zero and this caused the logic to fall through with a false-positive. The check relied on a local motor count that was set when the PWM dshot was initialized. When bitbang is active this initialization no longer runs and the motor count was defaulting to zero. This was missed in the bitbang implementation.

Fixed to get the motor count from a common source initialized by both timer and bitbang dshot.

Also changed the logic to prevent a false-positive fallthrough if the motor count is zero (shouldn't happen).
2020-04-23 19:50:35 -04:00
Bruce Luckcuck
5b3fd2d08f Disable dynmaic idle if RPM filter is not enabled
The addition of previous checks of bidirectional DSHOT being enabled were not sufficient. Additionally RPM filter must also be active (harmonics > 0) for dynamic idle to determine the minimum motor RPM and function correctly.
2020-04-22 20:36:54 -04:00
Michael Keller
bf9cc615c5
Merge pull request #9720 from codecae/crsf_displayport_init_fix
Relocated CRSF CMS display port init from telemetry to fc
2020-04-23 00:39:08 +12:00
Michael Keller
1d8a0e9fd6
Merge pull request #9723 from rvdveen/lagged-avg-init-fix
Zero the movingSum and buffer for laggedMovingAverage to fix ff_interpolate_sp switches
2020-04-22 01:47:16 +12:00
Bruce Luckcuck
13068b50b5 Correct gyro scaling factors
Just a very minor correction to the gyro scaling factor. All gyro drivers were using the hardcoded value of 16.4 msb/dps which is actually a rounded value of the true factor of 16.384 msb/dps. This value actually comes from the `abs(INT16)` range divided by the full scale. So 32768 / 2000. To be fair the Invensense gyro datasheets list this 16.4 rounded value so they're the cause of the mistake. Other manufacturers correctly list the scale as `(1 << 15) / 2000`.

The actual variance is trivial (about 0.1%) and only accounts for 2dps error at full scale so the situation is not dire. iThis variance is the reason we only see +-1998dps maximum rate in logging for example. But since we're already using a float for the scaling factor there's no reason not to use the more accurate value.
2020-04-20 13:35:23 -04:00
Roy van der Veen
0d2920423b Zero the movingSum and buffer for laggedMovingAverage to prevent persistent error from being introduced on re-initialization 2020-04-20 17:21:01 +02:00
Michael Keller
10bac1fd17
Merge pull request #9719 from etracer65/dyn_idle_change_profile_fix
Fix dynamic idle safety issues
2020-04-20 23:13:52 +12:00
Michael Keller
e060a0d507
Merge pull request #9712 from etracer65/fix_blocking_dshot_command
Fix blocking DSHOT commands
2020-04-20 23:07:40 +12:00
Michael Keller
4e3d93f44c
Merge pull request #9715 from mikeller/fix_pull_request_template
Fixed pull request template.
2020-04-20 23:05:35 +12:00
Curtis Bangert
d76465e23a Relocated CMS Displayport init from telemetry to init 2020-04-19 15:48:56 -04:00
Michael Keller
7a856bfe23
Merge pull request #9698 from etracer65/link_quality_alarm_range
Fix osd_link_quality_alarm range
2020-04-20 02:15:42 +12:00
Michael Keller
50fa2b4d71
Merge pull request #9695 from jflyper/bfdev-fix-i2c2-sda-on-F446RE
Fix I2C2 SDA pin def for F446
2020-04-20 02:05:09 +12:00
Michael Keller
0fcd8e9250
Merge pull request #9701 from tstibor/fix_sizeof_ticker_chr_count
Determine correct size of TICKER_CHARACTER_COUNT
2020-04-20 01:47:03 +12:00
Michael Keller
ee5df72916
Merge pull request #9702 from tstibor/fix_declaration
Make sure function declaration and definition are equal
2020-04-20 01:42:10 +12:00
Bruce Luckcuck
52d0764d17 Fix dynamic idle safety issues
Fixes a problem with dynamic idle not checking for bidirectional DSHOT being enabled. So the code would run but have no RPM data available leading to elevated motor idle.

Fixes a problem with dynamic idle not resetting accumulated static variables that continue to be used when dynamic idle is switched off via a PID profile change. Depending on the state of the variables this could cause excessive motor idle speed. In some cases enough to cause the quad to spontaneously take off on arming or be unable to descend in flight.

Fixes a problem with dynamic idle inappropriately modifying the static `motorOutputLow` that is set based on the chosen motor protocol. Downstream code that relies on this value to determine the acutal motor output range was adversely affected.
2020-04-19 09:12:45 -04:00
Michael Keller
9ae3845919
Merge pull request #9705 from ctzsnooze/Increase-default-yaw-P
Increase default Yaw P to 45
2020-04-20 01:10:37 +12:00
Michael Keller
2451a615ff
Merge pull request #9706 from ctzsnooze/Increase-TPA-start-point-to-1350-from-1250
Increase TPA start point to 35% throttle
2020-04-20 01:09:50 +12:00
Michael Keller
5bf1a1d849
Merge pull request #9707 from ctzsnooze/Enable-expo-on-D-by-default-at-5
Enable expo on the D lowpass filter at 5
2020-04-20 01:08:57 +12:00
Michael Keller
18cc54992d
Merge pull request #9716 from mikeller/add_translators_to_readme
Added instructions for new translators to README.md.
2020-04-20 01:03:01 +12:00