1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00
Commit graph

38 commits

Author SHA1 Message Date
Tony Cabello Miguel
518bc1b165 Small doc enhancements 2021-04-16 07:49:25 +02:00
Bruce Luckcuck
c19fade76a Fix mspSerialPush() selected serial port logic
Logic error would cause the MSP data to be written to every port that had MSP enabled if the selected port was -1 (`SERIAL_PORT_NONE`). Since the (correct) default for `displayport_msp_serial` is -1, this was causing MSP displayPort traffic to be "spammed" to every UART with MSP enabled. Since MSP displayPort is the fallback when no other OSD device is detected (in "AUTO" mode) this could cause large amounts of unnecessary MSP traffic - for example in cases with flight controllers with no MAX7456 and using the DJI air unit connected via MSP. This "might" be related to earlier reports of the DJI OSD no longer working with softserial (even though that's not really a recommended configuration) because of the extra serial traffic.

This was not so much a "bug" but instead a shortsighted design. The only other thing using `mspSerialPush()` is the MSP-based current sensor. In that case the logic does in fact want to "spam" all the MSP ports with the current sensor request. So it was using the `SERIAL_PORT_NONE` identifier to mean "every port". But this conflicts with MSP displayPort logic which really needs a "no ports" identifier. So this PR adds a `SERIAL_PORT_ALL` identifier to explicitly differentiat "all" from "none" and this is used for the current sensor.
2021-01-17 13:31:17 -05:00
Bruce Luckcuck
175e6200b4 Fix possible div-by-zero in current meter
Prevents div-by-zero if current meter scale is set to 0. Can't prevent with parameter ranges because scale ranges from -16000 to 16000.
2021-01-10 10:43:35 -05:00
mikeller
e7e46c578b Changed 'mspSerialPush()' to not check displayPort when requesting current data. 2019-10-26 22:05:10 +13:00
Hans Christian Olaussen
62fafe8041 Change current/voltage filters from biquad to pt1 2019-02-12 22:34:16 +01:00
Michael Keller
933fb0b6b4
Merge pull request #7475 from mikeller/fix_debug_names
Aligned debug mode names with debug enum value names for more fun when debugging.
2019-01-28 20:16:11 +13:00
mikeller
38e1ce04df Reorganised interfaces, putting them where they are used. 2019-01-27 13:38:22 +13:00
mikeller
118e92c8b2 Aligned debug mode names with debug enum value names for more fun when debugging. 2019-01-27 12:04:38 +13:00
mikeller
3e1e467079 Make battery voltage / current filter cutoffs configurable. 2019-01-22 22:45:59 +13:00
Hans Christian Olaussen
6770bbafca Increase voltage/current cutoff frequencies
Increase IBAT_LPF_FREQ  and VBAT_LPF_FREQ
2019-01-13 17:41:48 +01:00
jirif
0111949c63 Define macro HZ_TO_INTERVAL_US() and remove unneeded comments 2018-07-27 20:59:19 +02:00
rav
e43fc41f6a fix voltage and current sensor filter frequencies 2018-07-25 12:39:37 +02:00
mikeller
670cd49bd6 Added offset parameter to ESC sensor current calculation to compensate for non-ESC consumption. 2018-05-30 00:38:33 +12:00
mikeller
2feae20c32 Replaced instances of '#include <platform.h>' with '#include "platform.h"'. 2018-05-24 23:46:19 +12:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
Michael Keller
e0dcea4d48
Added checks for ESC_SENSOR feature being enabled when reading ESC sensor data. (#5663) 2018-04-11 23:31:14 +12:00
conkerkh
742cb5f93b Add current sensor debug option. (#5260)
Allows for easy calculation of required scale and offset.

0 - miliVolts
1 - centiAmps
2 - amperageLatest
3 - mahDrawn
2018-03-04 11:42:41 +13:00
Dan Nixon
22874d8ba2 CMS power menu
Menu including:
- Voltage meter selection
- Current meter selection
- Max cell voltage (moved from MISC menu)
- Voltage scale adjust (moved from MISC menu)
- ADC current scale and offset adjust
- Virtual current scale and offset adjust
2018-02-01 15:31:45 +00:00
Martin Budden
740234c909 Fix F1 builds 2018-01-11 09:35:08 +00:00
jflyper
a03b85025c Internal ADC support, full task polling version 2018-01-10 11:49:56 +09:00
mikeller
09d396c05c Cleaned up parameter group handling.
Fixed missing include.
2017-12-31 10:51:01 +13:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
DESKTOP-JI9AKHT\Dimand
bcd5752a12 Changed the scaling factor of the curent sensor to be in the form of y=mx+b. Altered the scaling to be in mV/10A, this means that for you average 50mOhm shunt resistor you will have a scale factor of 500, plenty of integre adjustability and the default 400 used will be fine as a first guess in most cases. Offset is adjusted to mA to give greater adjustability as an integer value. Builds successfully to OMNIBUSF4SD. 2017-12-14 15:19:16 +11:00
Martin Budden
e3ee9a5588 Created new interface directory 2017-11-12 12:20:58 +00:00
Michael Keller
1388c3ee82 Merge pull request #2863 from rosek86/master
Read current from ESC fixed.
2017-06-17 12:24:53 +12:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Hydra
22147105fb CF/BF - First cut of MSP current sensor.
How it works:
1. Current Meter Source on FC is set to MSP/OSD Slave by user.
2. On reboot FC sends MSP_ANALOG to OSD Slave.
3. OSD Slave listens for incoming MSP as usual.
4. OSD responds to MSP as usual.
6. The FC recevies the data from the OSD Slave and updates the MSP
Current Meter.
2017-04-29 20:57:08 +01:00
Hydra
be063ebbbf CF/BF - Remove usage of USE_FC based on PR discussion decisions. Add
USE_VIRTUAL_CURRENT_METER.
2017-04-12 00:39:27 +01:00
Hydra
cb34c5b1d7 CF/BF - Further reduce osd slave dependencies on FC code. 2017-04-12 00:39:27 +01:00
Hydra
1f4644557d CF/BF - Ensure that ESC voltage/current meters do not read random memory
when reading data from unconfigured motors.
2017-04-02 19:57:35 +01:00
Hydra
4554019c52 CF/BF - fix naming of currentMeterVirtualState_t 2017-03-19 10:40:25 +00:00
Hydra
01732f4523 CF/BF - improve const correctness by declaring iBatSample as const. 2017-03-19 10:40:20 +00:00
Hydra
9482a12677 CF/BF - declare variable at point of first usage (code style) 2017-03-19 10:40:19 +00:00
Hydra
1cd4227823 CF/BF - separate the virtual and adc current sensor configuration.
update the MSP configuration of current and voltage sensors to use IDs.

revert the i2s_bst changes, since TBS won't be updating their firmware
there is no point adding new features to it, we just need to keep it
compatible
2017-03-19 10:40:12 +00:00
Hydra
2f99749003 CF/BF - add support for reading all voltage and current meters via MSP.
Refactored current meter API and state, now it's more closely aligned
with the the voltage meter API.
2017-03-19 10:40:11 +00:00
Hydra
dbd819c85a CF/BF - move adc current sensor default scale and offset to target.h instead of
target specific config.c
2017-03-19 10:40:08 +00:00
Hydra
067d3c0ac2 CF/BF - First cut of Current/Voltage/Battery cleanup.
many refactorings, bugs squished, concerns separated,
single-responsibility violations fixed and performance optimizations.
2017-03-19 10:40:03 +00:00