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

240 commits

Author SHA1 Message Date
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
b7ee04127d Removed the unused setting 'mag_declination'. 2020-05-02 23:30:01 +12:00
Michael Keller
2101326a1d
Merge pull request #9619 from mikeller/add_motor_protocol_disabled
Added 'disabled' motor protocol and made it the default.
2020-04-11 12:41:18 +12:00
mikeller
d1ac12eccd Added 'disabled' motor protocol and made it the default. 2020-04-01 20:33:29 +13:00
ctzsnooze
d63ba914c6 motor output scale
First draft

Change method to percentage compensation

fast sag filter with fast battery updates

Renaming, moving factors to init where possible

Names changed, display update frequency reverted to 50hz as it was

50Hz ESC Voltage sampling, battery sag lowpass for PID compensation.

increment PG_PID_PROFILE, element added to end of batteryConfig_t

all HZ_TO_INTERVALs set back to 200 to match battery task frequency of 200hz.

Add a flag to control vbat comp

Flag vbat_sag_comp_enabled allows battery compensation to be enabled or
disabled from the CLI. When disabled the battery voltage task is run at
50Hz and the battery compensation code is not run. When enabled the
voltage task is run at 200Hz and the compensation code runs. Constants
for the fast and slow rates are added to tasks.h. The default value for
vbat_sag_compensation is changed to 100 as we no longer need to use it
to disable the feature.

Fixed variable task frequency setting.

Added config validation to disable sag compensation unless ADC is used as the voltage data source.

Added conditionals, fixed naming.

Fixed build.
2020-03-22 17:15:08 +13:00
mikeller
db4bd1f186 Cleaned up the scheduler. 2020-03-16 08:35:58 +13:00
Bruce Luckcuck
ad0e7154a7 Split initialization from gyro.c for flash savings
Move low performance requirements initialization code into gyro_init.c and optimize that for size.
2020-03-13 10:08:11 -04:00
Bruce Luckcuck
15ec707a0b Add validation to MSP for the rc_smoothing_auto_factor setting
This is a workaround for a validation bug in configurator 10.6 where the user can enter an invalid value, immediately click "Save" and that value will be stored before the value is range-checked. Added validation to the MSP message processing to constrain the range to prevent a dangerous result.
2020-03-07 18:48:23 -05:00
Michael Keller
aea38be686
Merge pull request #9539 from Asizon/mspDynamicIdle
Add Dynamic Idle to msp
2020-03-07 15:54:00 +13:00
Asizon
9b1f91c5ff idle_min_rpm to msp 2020-03-04 10:47:06 +01:00
mikeller
58c90106d3 Added 'missing acc calibration' flag to board info MSP command. 2020-03-01 21:27:59 +13:00
Asizon
2c8ca3927f Add Rates type to Msp 2020-02-26 12:41:51 +01:00
Asizon
eafa5f6779 Add motor_output_limit settings to msp 2020-02-20 11:21:41 +01:00
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
mikeller
214d378e82 Detect revisions of the STM32H743. 2020-02-15 12:35:57 +13:00
mikeller
39b62cb6c1 Added command to bind RX to MSP. 2020-02-06 13:36:27 +13:00
Bruce Luckcuck
f584780944 Gyro native rate sampling, filtering, and scheduler restructuring 2020-02-04 18:19:35 -05:00
ctzsnooze
7b2e075b3a Simplify and improve Dynamic Notch
Remove prevCenterFreq[axis]
Simpler peak detection:
- cubes, not squares
- only look one bin either side
More accurate frequency determination
Updated annotations and explanations
Whitespace fixes
fftStartBin can't be less than 1
Dynamic PT1 smoothing
biquad filter on centerFreq removed
centerFreq's now floats

Limits and better min max logic

constrain within nyquist limits

If gyro rate was 2khz and dynamic notch range max, this will keep the notch max to 960hz.

Simple fixes

Get lowest min above and below the peak

First go at setting DN range by a maxHz

increment the PG version in gyro.c

MSP correct size

Resolve comments from Mike and Rav.

Fis msp, deprecating range
2020-01-26 13:05:24 +13:00
Michael Keller
3e752af4ac
Merge pull request #9332 from fiam/agh_cf_serial_config
[MSP] Add support for MSP2_COMMON_SERIAL_CONFIG / MSP2_COMMON_SET_SERIAL_CONFIG
2020-01-26 12:44:00 +13:00
Michael Keller
69a3a4ac08
Merge pull request #9315 from hydra/bf-log-disarm-reason
Log disarm reason.
2020-01-17 19:30:37 +13:00
Dominic Clifton
2fead0aedf Log disarm reason. 2020-01-16 20:16:11 +01:00
Alberto García Hierro
2b63d4a060 [MSP] Add support for MSP2_COMMON_SERIAL_CONFIG / MSP2_COMMON_SET_SERIAL_CONFIG
This allows retrieving ports with functionMask with values >= (1 << 16)
while still keeping MSP_CF_SERIAL_CONFIG / MSP_SET_CF_SERIAL_CONFIG
backwards compatible.

The new handler includes the port count at the start of the frame, so
the per-port data size can be extended in a backwards compatible way
in the future.
2020-01-14 14:11:43 +00:00
Alberto García Hierro
65f84f2c86 [MSP] Correctly report the configured and active OSD type
- Tell the OSD driver the type of displayPort, so it can be retrieved
later.
- Use OSD driver code instead of device specific code to handle
MSP_OSD_CONFIG response while minimizing driver specific code.
- Add flag for signaling the use of FrSky OSD (bit 3).
- Rename OSD_FLAGS_MAX7456_DETECTED to OSD_FLAGS_OSD_DEVICE_DETECTED.
Since we only support one OSD device type at a time, we can use the
same bit to signal wether the hardware has been detected.
2020-01-04 12:35:09 +00:00
Michael Keller
4c58889915
Move OSD elements into their own parameter group (#9278)
Move OSD elements into their own parameter group
2019-12-11 09:37:28 +13:00
Bruce Luckcuck
afeb88850f Move OSD elements into their own parameter group
Separates the OSD elements position/visible/profile flags from the `osdConfig` PG and moves them to a new `osdElementConfig` PG. Allows new elements to be added without having to constantly update the PG version for `osdConfig`.
2019-12-09 19:13:08 -05:00
Alberto García Hierro
deeabdbca3 Add support for serial passthrough via MSP
- Rename MSP_SET_4WAY_IF to MSP_SET_PASSTHROUGH
- Keep backwards compatibility with existing uses of the command
- Add 2 new values for the passthrough mode: one that sets up
a serial port given its ID and another one that sets it up from
a function ID.
2019-12-09 15:58:27 +00:00
Bruce Luckcuck
5c3b8c6eb6 Add camera frame OSD element
Adds an adjustable outline element designed to represent the field of view of the pilot's HD camera for visual framing. The width, height and position of the frame are adjustable.
2019-12-04 11:03:41 -05:00
Alberto García Hierro
37e66b3dda Add support for FrSky OSD
- Add displayWriteFontCharacter() for font writing, removing all max7456
specific code.
- Add displayIsReady() for asynchronous display initialization
- Add displayBeginTransaction()/displayCommitTransaction() for display
transactions, which allow performing complex drawing operations without
flickering
- Add displayGetCanvas(), which retrieves the canvas associated with a
display (if it has it)
- Add canvas implementation for pixel based access for a display
- Add FrSkyOSD driver and displayPort driver
- Enable FrSkyOSD driver for targets with flash > 256
- Rename max7456_symbols.h to osd_symbols.h
2019-11-30 22:06:36 +00:00
mikeller
99f77fa88d Moved configuration validation into 'config.c'. 2019-11-24 21:19:26 +13:00
mikeller
cedcf2d7e2 Added calibration menu to CMS. 2019-11-19 13:59:52 +13:00
mikeller
a045a9c672 Improved compass calibration. 2019-11-19 01:08:44 +13:00
mikeller
a21d0f5d31 Fixed potentially incorrect calculation in ACC calibration if non-default cycle number is used. 2019-11-17 10:58:28 +13:00
Bruce Luckcuck
a12ab13462 Prevent font upload if max7456 is not detected
Prevents wedge if a font upload is attempted but the max7456 device wasn't detected during initialization.
2019-11-10 19:17:05 -05:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Nicola De Pasquale
98d6105592 add altitude mode setting to msp 2019-10-23 22:54:33 +02:00
Michael Keller
ca9005de66
Add MSP allowArmingWithoutFix (#9026)
Add MSP allowArmingWithoutFix
2019-10-22 11:44:58 +13:00
Michael Keller
9e44cd3ca5
Renamed 'rxRuntimeConfig' to 'rxRuntimeState'. (#9072)
Renamed 'rxRuntimeConfig' to 'rxRuntimeState'.
2019-10-22 11:27:36 +13:00
mikeller
0a0d3631a7 Renamed 'rxRuntimeConfig' to 'rxRuntimeState'. 2019-10-22 00:12:51 +13:00
kaweksl
861d38a83f combining buffer check 2019-10-21 13:08:11 +02:00
kaweksl
3b8d37e96d MSP Add allowArmingWithoutFix
fixed compatibility and comments
2019-10-21 12:14:29 +02:00
Bruce Luckcuck
e64703308b Revise feature logic to separate runtime and config settings
Isolates and prevents changes to runtime active features. Any changes to enabled features are deferred until after a save/reboot. Simplifies the previous logic.

Prevents potential failures when features are changed at runtime but the underlying code is not capabile of dynamic reconfiguration.
2019-10-21 20:25:03 +13:00
Michael Keller
429f684378
add gps_ublox_use_galileo and gps_set_home_point_once to MSP (#9027)
add gps_ublox_use_galileo and gps_set_home_point_once to MSP
2019-10-18 03:40:02 +13:00
Michael Keller
50ed636e8d
Add ascend and descend rate to MSP (#8977)
Add ascend and descend rate to MSP
2019-10-18 03:32:44 +13:00
jflyper
fb2ec7fe68 Support per MSP source arming disable control 2019-10-16 11:14:25 +09:00
Nicola De Pasquale
0aa05c9a93 add gps_ublox_use_galileo and gps_set_home_point_once to MSP 2019-10-11 14:15:47 +02:00
Nicola De Pasquale
5d86ebffc8 add ascend and descend rate to MSP 2019-10-01 16:13:55 +02:00
Bruce Luckcuck
ad4d46a1f9 Add missing variable initialization in MSP_VTX_CONFIG
If the `vtxDevice` was not valid then the `vtxStatus` variable never got initialized but was still used in the pit mode flag determination - leading to random behavior.
2019-09-11 09:00:51 -04:00
mikeller
7018c81bf1 Fixed 'sd_info' showing incorrect information when SD card not configured. 2019-09-08 13:55:18 +12:00
Michael Keller
1298d3d4c9
Merge pull request #8825 from jflyper/bfdev-fix-MOTOR_MSP-hard-fault-with-no-motors
Provide isMotorEnabled function for motorNullDevice
2019-09-06 19:47:48 +12:00
jflyper
eac1565987 Provide isMotorEnabled function pointer to motorIsEnabledNull for motorNullVTable
Also suppress call to this function from MSP_MOTOR when motors are not
present by inquiring motorIsEnabled first.
2019-09-05 16:24:52 +09:00