mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Disabled MSP over telemetry for F1, re-enabled SERVOS.
This commit is contained in:
parent
6bf755d0bd
commit
3bce54186c
8 changed files with 40 additions and 9 deletions
|
@ -190,6 +190,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(void)
|
||||||
// TODO: CRC CHECK
|
// TODO: CRC CHECK
|
||||||
scheduleDeviceInfoResponse();
|
scheduleDeviceInfoResponse();
|
||||||
return RX_FRAME_COMPLETE;
|
return RX_FRAME_COMPLETE;
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
} else if (crsfFrame.frame.type == CRSF_FRAMETYPE_MSP_REQ || crsfFrame.frame.type == CRSF_FRAMETYPE_MSP_WRITE) {
|
} else if (crsfFrame.frame.type == CRSF_FRAMETYPE_MSP_REQ || crsfFrame.frame.type == CRSF_FRAMETYPE_MSP_WRITE) {
|
||||||
// TODO: CRC CHECK
|
// TODO: CRC CHECK
|
||||||
uint8_t *frameStart = (uint8_t *)&crsfFrame.frame.payload + 2;
|
uint8_t *frameStart = (uint8_t *)&crsfFrame.frame.payload + 2;
|
||||||
|
@ -198,6 +199,7 @@ STATIC_UNIT_TESTED uint8_t crsfFrameStatus(void)
|
||||||
scheduleMspResponse();
|
scheduleMspResponse();
|
||||||
}
|
}
|
||||||
return RX_FRAME_COMPLETE;
|
return RX_FRAME_COMPLETE;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,3 +50,9 @@
|
||||||
#undef USE_BARO_MS5611
|
#undef USE_BARO_MS5611
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
|
#if !defined(TELEMETRY_SMARTPORT) && !defined(TELEMETRY_CRSF)
|
||||||
|
#undef USE_MSP_OVER_TELEMETRY
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -102,6 +102,7 @@
|
||||||
#define TELEMETRY_LTM
|
#define TELEMETRY_LTM
|
||||||
#define TELEMETRY_SMARTPORT
|
#define TELEMETRY_SMARTPORT
|
||||||
#define USE_RESOURCE_MGMT
|
#define USE_RESOURCE_MGMT
|
||||||
|
#define USE_SERVOS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (FLASH_SIZE > 128)
|
#if (FLASH_SIZE > 128)
|
||||||
|
@ -117,7 +118,6 @@
|
||||||
#define USE_RX_MSP
|
#define USE_RX_MSP
|
||||||
#define USE_SERIALRX_JETIEXBUS
|
#define USE_SERIALRX_JETIEXBUS
|
||||||
#define USE_SENSOR_NAMES
|
#define USE_SENSOR_NAMES
|
||||||
#define USE_SERVOS
|
|
||||||
#define USE_VIRTUAL_CURRENT_METER
|
#define USE_VIRTUAL_CURRENT_METER
|
||||||
#define VTX_COMMON
|
#define VTX_COMMON
|
||||||
#define VTX_CONTROL
|
#define VTX_CONTROL
|
||||||
|
@ -126,6 +126,7 @@
|
||||||
#define USE_CAMERA_CONTROL
|
#define USE_CAMERA_CONTROL
|
||||||
#define USE_HUFFMAN
|
#define USE_HUFFMAN
|
||||||
#define USE_COPY_PROFILE_CMS_MENU
|
#define USE_COPY_PROFILE_CMS_MENU
|
||||||
|
#define USE_MSP_OVER_TELEMETRY
|
||||||
|
|
||||||
#ifdef USE_SERIALRX_SPEKTRUM
|
#ifdef USE_SERIALRX_SPEKTRUM
|
||||||
#define USE_SPEKTRUM_BIND
|
#define USE_SPEKTRUM_BIND
|
||||||
|
|
|
@ -63,7 +63,9 @@
|
||||||
|
|
||||||
static bool crsfTelemetryEnabled;
|
static bool crsfTelemetryEnabled;
|
||||||
static bool deviceInfoReplyPending;
|
static bool deviceInfoReplyPending;
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
static bool mspReplyPending;
|
static bool mspReplyPending;
|
||||||
|
#endif
|
||||||
static uint8_t crsfFrame[CRSF_FRAME_SIZE_MAX];
|
static uint8_t crsfFrame[CRSF_FRAME_SIZE_MAX];
|
||||||
|
|
||||||
static void crsfInitializeFrame(sbuf_t *dst)
|
static void crsfInitializeFrame(sbuf_t *dst)
|
||||||
|
@ -280,6 +282,7 @@ typedef enum {
|
||||||
static uint8_t crsfScheduleCount;
|
static uint8_t crsfScheduleCount;
|
||||||
static uint8_t crsfSchedule[CRSF_SCHEDULE_COUNT_MAX];
|
static uint8_t crsfSchedule[CRSF_SCHEDULE_COUNT_MAX];
|
||||||
|
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
void scheduleMspResponse() {
|
void scheduleMspResponse() {
|
||||||
if (!mspReplyPending) {
|
if (!mspReplyPending) {
|
||||||
mspReplyPending = true;
|
mspReplyPending = true;
|
||||||
|
@ -298,7 +301,8 @@ void crsfSendMspResponse(uint8_t *payload)
|
||||||
sbufWriteU8(dst, CRSF_ADDRESS_BETAFLIGHT);
|
sbufWriteU8(dst, CRSF_ADDRESS_BETAFLIGHT);
|
||||||
sbufWriteData(dst, payload, CRSF_FRAME_TX_MSP_PAYLOAD_SIZE);
|
sbufWriteData(dst, payload, CRSF_FRAME_TX_MSP_PAYLOAD_SIZE);
|
||||||
crsfFinalize(dst);
|
crsfFinalize(dst);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void processCrsf(void)
|
static void processCrsf(void)
|
||||||
{
|
{
|
||||||
|
@ -341,7 +345,9 @@ void initCrsfTelemetry(void)
|
||||||
crsfTelemetryEnabled = crsfRxIsActive();
|
crsfTelemetryEnabled = crsfRxIsActive();
|
||||||
|
|
||||||
deviceInfoReplyPending = false;
|
deviceInfoReplyPending = false;
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
mspReplyPending = false;
|
mspReplyPending = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
crsfSchedule[index++] = BV(CRSF_FRAME_ATTITUDE_INDEX);
|
crsfSchedule[index++] = BV(CRSF_FRAME_ATTITUDE_INDEX);
|
||||||
|
@ -384,8 +390,10 @@ void handleCrsfTelemetry(timeUs_t currentTimeUs)
|
||||||
crsfFrameDeviceInfo(dst);
|
crsfFrameDeviceInfo(dst);
|
||||||
crsfFinalize(dst);
|
crsfFinalize(dst);
|
||||||
deviceInfoReplyPending = false;
|
deviceInfoReplyPending = false;
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
} else if (mspReplyPending) {
|
} else if (mspReplyPending) {
|
||||||
mspReplyPending = sendMspReply(CRSF_FRAME_TX_MSP_PAYLOAD_SIZE, &crsfSendMspResponse);
|
mspReplyPending = sendMspReply(CRSF_FRAME_TX_MSP_PAYLOAD_SIZE, &crsfSendMspResponse);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
processCrsf();
|
processCrsf();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
#ifdef TELEMETRY
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
|
|
||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,9 @@ typedef struct smartPortFrame_s {
|
||||||
static smartPortFrame_t smartPortRxBuffer;
|
static smartPortFrame_t smartPortRxBuffer;
|
||||||
static uint8_t smartPortRxBytes = 0;
|
static uint8_t smartPortRxBytes = 0;
|
||||||
static bool smartPortFrameReceived = false;
|
static bool smartPortFrameReceived = false;
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
static bool smartPortMspReplyPending = false;
|
static bool smartPortMspReplyPending = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void smartPortDataReceive(uint16_t c)
|
static void smartPortDataReceive(uint16_t c)
|
||||||
{
|
{
|
||||||
|
@ -327,9 +329,11 @@ void checkSmartPortTelemetryState(void)
|
||||||
freeSmartPortTelemetryPort();
|
freeSmartPortTelemetryPort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
void smartPortSendMspResponse(uint8_t *payload) {
|
void smartPortSendMspResponse(uint8_t *payload) {
|
||||||
smartPortSendPackageEx(FSSP_MSPS_FRAME, payload);
|
smartPortSendPackageEx(FSSP_MSPS_FRAME, payload);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void handleSmartPortTelemetry(void)
|
void handleSmartPortTelemetry(void)
|
||||||
{
|
{
|
||||||
|
@ -352,6 +356,8 @@ void handleSmartPortTelemetry(void)
|
||||||
smartPortFrameReceived = false;
|
smartPortFrameReceived = false;
|
||||||
// do not check the physical ID here again
|
// do not check the physical ID here again
|
||||||
// unless we start receiving other sensors' packets
|
// unless we start receiving other sensors' packets
|
||||||
|
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
if (smartPortRxBuffer.frameId == FSSP_MSPC_FRAME) {
|
if (smartPortRxBuffer.frameId == FSSP_MSPC_FRAME) {
|
||||||
|
|
||||||
// Pass only the payload: skip sensorId & frameId
|
// Pass only the payload: skip sensorId & frameId
|
||||||
|
@ -361,6 +367,7 @@ void handleSmartPortTelemetry(void)
|
||||||
smartPortMspReplyPending = handleMspFrame(frameStart, frameEnd);
|
smartPortMspReplyPending = handleMspFrame(frameStart, frameEnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
while (smartPortHasRequest) {
|
while (smartPortHasRequest) {
|
||||||
|
@ -370,11 +377,13 @@ void handleSmartPortTelemetry(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
if (smartPortMspReplyPending) {
|
if (smartPortMspReplyPending) {
|
||||||
smartPortMspReplyPending = sendMspReply(SMARTPORT_PAYLOAD_SIZE, &smartPortSendMspResponse);
|
smartPortMspReplyPending = sendMspReply(SMARTPORT_PAYLOAD_SIZE, &smartPortSendMspResponse);
|
||||||
smartPortHasRequest = 0;
|
smartPortHasRequest = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// we can send back any data we want, our table keeps track of the order and frequency of each data type we send
|
// we can send back any data we want, our table keeps track of the order and frequency of each data type we send
|
||||||
uint16_t id = frSkyDataIdTable[smartPortIdCnt];
|
uint16_t id = frSkyDataIdTable[smartPortIdCnt];
|
||||||
|
|
|
@ -101,7 +101,9 @@ void telemetryInit(void)
|
||||||
#ifdef TELEMETRY_IBUS
|
#ifdef TELEMETRY_IBUS
|
||||||
initIbusTelemetry();
|
initIbusTelemetry();
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(USE_MSP_OVER_TELEMETRY)
|
||||||
initSharedMsp();
|
initSharedMsp();
|
||||||
|
#endif
|
||||||
|
|
||||||
telemetryCheckState();
|
telemetryCheckState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,6 +214,13 @@ telemetry_crsf_unittest_SRC := \
|
||||||
$(USER_DIR)/common/typeconversion.c \
|
$(USER_DIR)/common/typeconversion.c \
|
||||||
$(USER_DIR)/fc/runtime_config.c
|
$(USER_DIR)/fc/runtime_config.c
|
||||||
|
|
||||||
|
telemetry_crsf_unittest_DEFINES := \
|
||||||
|
FLASH_SIZE=128 \
|
||||||
|
STM32F10X_MD \
|
||||||
|
__TARGET__="TEST" \
|
||||||
|
__REVISION__="revision"
|
||||||
|
|
||||||
|
|
||||||
telemetry_crsf_msp_unittest_SRC := \
|
telemetry_crsf_msp_unittest_SRC := \
|
||||||
$(USER_DIR)/rx/crsf.c \
|
$(USER_DIR)/rx/crsf.c \
|
||||||
$(USER_DIR)/common/crc.c \
|
$(USER_DIR)/common/crc.c \
|
||||||
|
@ -227,12 +234,8 @@ telemetry_crsf_msp_unittest_SRC := \
|
||||||
$(USER_DIR)/telemetry/msp_shared.c \
|
$(USER_DIR)/telemetry/msp_shared.c \
|
||||||
$(USER_DIR)/fc/runtime_config.c
|
$(USER_DIR)/fc/runtime_config.c
|
||||||
|
|
||||||
|
telemetry_crsf_msp_unittest_DEFINES := \
|
||||||
telemetry_crsf_unittest_DEFINES := \
|
USE_MSP_OVER_TELEMETRY
|
||||||
FLASH_SIZE=128 \
|
|
||||||
STM32F10X_MD \
|
|
||||||
__TARGET__="TEST" \
|
|
||||||
__REVISION__="revision"
|
|
||||||
|
|
||||||
|
|
||||||
telemetry_hott_unittest_SRC := \
|
telemetry_hott_unittest_SRC := \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue