mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Merge branch 'master' into betaflight
Conflicts: src/main/blackbox/blackbox_io.c src/main/drivers/serial_usb_vcp.c src/main/flight/imu.c src/main/mw.c src/main/target/CC3D/target.h
This commit is contained in:
commit
4b3ba927e9
50 changed files with 544 additions and 250 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "common/axis.h"
|
||||
#include "common/color.h"
|
||||
#include "common/filter.h"
|
||||
#include "common/utils.h"
|
||||
|
||||
#include "drivers/sensor.h"
|
||||
#include "drivers/accgyro.h"
|
||||
|
@ -242,14 +243,14 @@ void annexCode(void)
|
|||
}
|
||||
|
||||
if (feature(FEATURE_VBAT)) {
|
||||
if ((int32_t)(currentTime - vbatLastServiced) >= VBATINTERVAL) {
|
||||
if (cmp32(currentTime, vbatLastServiced) >= VBATINTERVAL) {
|
||||
vbatLastServiced = currentTime;
|
||||
updateBattery();
|
||||
}
|
||||
}
|
||||
|
||||
if (feature(FEATURE_CURRENT_METER)) {
|
||||
int32_t ibatTimeSinceLastServiced = (int32_t) (currentTime - ibatLastServiced);
|
||||
int32_t ibatTimeSinceLastServiced = cmp32(currentTime, ibatLastServiced);
|
||||
|
||||
if (ibatTimeSinceLastServiced >= IBATINTERVAL) {
|
||||
ibatLastServiced = currentTime;
|
||||
|
@ -465,16 +466,14 @@ void executePeriodicTasks(void)
|
|||
|
||||
#if defined(BARO) || defined(SONAR)
|
||||
case CALCULATE_ALTITUDE_TASK:
|
||||
|
||||
#if defined(BARO) && !defined(SONAR)
|
||||
if (sensors(SENSOR_BARO) && isBaroReady()) {
|
||||
if (false
|
||||
#if defined(BARO)
|
||||
|| (sensors(SENSOR_BARO) && isBaroReady())
|
||||
#endif
|
||||
#if defined(BARO) && defined(SONAR)
|
||||
if ((sensors(SENSOR_BARO) && isBaroReady()) || sensors(SENSOR_SONAR)) {
|
||||
#endif
|
||||
#if !defined(BARO) && defined(SONAR)
|
||||
if (sensors(SENSOR_SONAR)) {
|
||||
#if defined(SONAR)
|
||||
|| sensors(SENSOR_SONAR)
|
||||
#endif
|
||||
) {
|
||||
calculateEstimatedAltitude(currentTime);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue