mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Added conditions to test for accelerometer configuration before sending telemetry
This commit is contained in:
parent
36c91c76f6
commit
99f02ffdd0
3 changed files with 8 additions and 1 deletions
|
@ -56,6 +56,7 @@
|
|||
#include "telemetry/msp_shared.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
#include "sensors/sensors.h"
|
||||
|
||||
#define CRSF_CYCLETIME_US 100000 // 100ms, 10 Hz
|
||||
#define CRSF_DEVICEINFO_VERSION 0x01
|
||||
|
@ -350,7 +351,9 @@ void initCrsfTelemetry(void)
|
|||
#endif
|
||||
|
||||
int index = 0;
|
||||
if (sensors(SENSOR_ACC)) {
|
||||
crsfSchedule[index++] = BV(CRSF_FRAME_ATTITUDE_INDEX);
|
||||
}
|
||||
crsfSchedule[index++] = BV(CRSF_FRAME_BATTERY_SENSOR_INDEX);
|
||||
crsfSchedule[index++] = BV(CRSF_FRAME_FLIGHT_MODE_INDEX);
|
||||
if (feature(FEATURE_GPS)) {
|
||||
|
|
|
@ -59,6 +59,7 @@ extern "C" {
|
|||
#include "telemetry/telemetry.h"
|
||||
#include "telemetry/msp_shared.h"
|
||||
#include "telemetry/smartport.h"
|
||||
#include "sensors/acceleration.h"
|
||||
|
||||
bool handleMspFrame(uint8_t *frameStart, uint8_t *frameEnd);
|
||||
bool sendMspReply(uint8_t payloadSize, mspResponseFnPtr responseFn);
|
||||
|
@ -78,6 +79,7 @@ extern "C" {
|
|||
PG_REGISTER(telemetryConfig_t, telemetryConfig, PG_TELEMETRY_CONFIG, 0);
|
||||
PG_REGISTER(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 0);
|
||||
PG_REGISTER(rxConfig_t, rxConfig, PG_RX_CONFIG, 0);
|
||||
PG_REGISTER(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG,0);
|
||||
|
||||
extern bool crsfFrameDone;
|
||||
extern crsfFrame_t crsfFrame;
|
||||
|
|
|
@ -54,6 +54,7 @@ extern "C" {
|
|||
|
||||
#include "sensors/battery.h"
|
||||
#include "sensors/sensors.h"
|
||||
#include "sensors/acceleration.h"
|
||||
|
||||
#include "telemetry/crsf.h"
|
||||
#include "telemetry/telemetry.h"
|
||||
|
@ -70,6 +71,7 @@ extern "C" {
|
|||
PG_REGISTER(telemetryConfig_t, telemetryConfig, PG_TELEMETRY_CONFIG, 0);
|
||||
PG_REGISTER(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 0);
|
||||
PG_REGISTER(rxConfig_t, rxConfig, PG_RX_CONFIG, 0);
|
||||
PG_REGISTER(accelerometerConfig_t, accelerometerConfig, PG_ACCELEROMETER_CONFIG, 0);
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue