mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Merge pull request #4175 from mikeller/fix_crsf_halfduplex_check
Fixed check for halfduplex mode in CRSF.
This commit is contained in:
commit
c4e47ddede
4 changed files with 8 additions and 1 deletions
|
@ -233,7 +233,7 @@ void crsfRxSendTelemetryData(void)
|
|||
if (telemetryBufLen > 0) {
|
||||
// check that we are not in bi dir mode or that we are not currently receiving data (ie in the middle of an RX frame)
|
||||
// and that there is time to send the telemetry frame before the next RX frame arrives
|
||||
if (CRSF_PORT_OPTIONS & SERIAL_BIDIR) {
|
||||
if (rxConfig()->halfDuplex) {
|
||||
const uint32_t timeSinceStartOfFrame = micros() - crsfFrameStartAt;
|
||||
if ((timeSinceStartOfFrame < CRSF_TIME_NEEDED_PER_FRAME_US) ||
|
||||
(timeSinceStartOfFrame > CRSF_TIME_BETWEEN_FRAMES_US - CRSF_TIME_NEEDED_PER_FRAME_US)) {
|
||||
|
|
|
@ -26,6 +26,8 @@ extern "C" {
|
|||
|
||||
#include "build/debug.h"
|
||||
|
||||
#include "config/parameter_group.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
#include "common/crc.h"
|
||||
#include "common/utils.h"
|
||||
|
||||
|
@ -47,6 +49,8 @@ extern "C" {
|
|||
extern uint32_t crsfChannelData[CRSF_MAX_CHANNEL];
|
||||
|
||||
uint32_t dummyTimeUs;
|
||||
|
||||
PG_REGISTER(rxConfig_t, rxConfig, PG_RX_CONFIG, 0);
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
|
|
@ -77,6 +77,7 @@ extern "C" {
|
|||
PG_REGISTER(batteryConfig_t, batteryConfig, PG_BATTERY_CONFIG, 0);
|
||||
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);
|
||||
|
||||
extern bool crsfFrameDone;
|
||||
extern crsfFrame_t crsfFrame;
|
||||
|
|
|
@ -49,6 +49,7 @@ extern "C" {
|
|||
#include "io/gps.h"
|
||||
#include "io/serial.h"
|
||||
|
||||
#include "rx/rx.h"
|
||||
#include "rx/crsf.h"
|
||||
|
||||
#include "sensors/battery.h"
|
||||
|
@ -68,6 +69,7 @@ extern "C" {
|
|||
PG_REGISTER(batteryConfig_t, batteryConfig, PG_BATTERY_CONFIG, 0);
|
||||
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);
|
||||
}
|
||||
|
||||
#include "unittest_macros.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue