mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Review comment fixes
This commit is contained in:
parent
9d70ed5079
commit
4ca3b9428f
6 changed files with 44 additions and 46 deletions
|
@ -100,28 +100,30 @@ Other devices can be added starting from id 50.
|
||||||
|
|
||||||
### 2. Serial Port Function
|
### 2. Serial Port Function
|
||||||
|
|
||||||
| Function | Value |
|
| Function | Value | Bit |
|
||||||
| ---------------------------- | ------ |
|
| ---------------------------- | ------ | --- |
|
||||||
| FUNCTION_NONE | 0 |
|
| FUNCTION_NONE | 0 | 0 |
|
||||||
| FUNCTION_MSP | 1 |
|
| FUNCTION_MSP | 1 | 1 << 0 |
|
||||||
| FUNCTION_GPS | 2 |
|
| FUNCTION_GPS | 2 | 1 << 1 |
|
||||||
| FUNCTION_TELEMETRY_FRSKY_HUB | 4 |
|
| FUNCTION_TELEMETRY_FRSKY_HUB | 4 | 1 << 2 |
|
||||||
| FUNCTION_TELEMETRY_HOTT | 8 |
|
| FUNCTION_TELEMETRY_HOTT | 8 | 1 << 3 |
|
||||||
| FUNCTION_TELEMETRY_LTM | 16 |
|
| FUNCTION_TELEMETRY_LTM | 16 | 1 << 4 |
|
||||||
| FUNCTION_TELEMETRY_SMARTPORT | 32 |
|
| FUNCTION_TELEMETRY_SMARTPORT | 32 | 1 << 5 |
|
||||||
| FUNCTION_RX_SERIAL | 64 |
|
| FUNCTION_RX_SERIAL | 64 | 1 << 6 |
|
||||||
| FUNCTION_BLACKBOX | 128 |
|
| FUNCTION_BLACKBOX | 128 | 1 << 7 |
|
||||||
| FUNCTION_TELEMETRY_MAVLINK | 512 |
|
| NOT USED | 256 | 1 << 8 |
|
||||||
| FUNCTION_ESC_SENSOR | 1024 |
|
| FUNCTION_TELEMETRY_MAVLINK | 512 | 1 << 9 |
|
||||||
| FUNCTION_VTX_SMARTAUDIO | 2048 |
|
| FUNCTION_ESC_SENSOR | 1024 | 1 << 10 |
|
||||||
| FUNCTION_TELEMETRY_IBUS | 4096 |
|
| FUNCTION_VTX_SMARTAUDIO | 2048 | 1 << 11 |
|
||||||
| FUNCTION_VTX_TRAMP | 8192 |
|
| FUNCTION_TELEMETRY_IBUS | 4096 | 1 << 12 |
|
||||||
| FUNCTION_RCDEVICE | 16384 |
|
| FUNCTION_VTX_TRAMP | 8192 | 1 << 13 |
|
||||||
| FUNCTION_LIDAR_TF | 32768 |
|
| FUNCTION_RCDEVICE | 16384 | 1 << 14 |
|
||||||
| FUNCTION_FRSKY_OSD | 65536 |
|
| FUNCTION_LIDAR_TF | 32768 | 1 << 15 |
|
||||||
| FUNCTION_VTX_MSP | 131072 |
|
| FUNCTION_FRSKY_OSD | 65536 | 1 << 16 |
|
||||||
|
| FUNCTION_VTX_MSP | 131072 | 1 << 17 |
|
||||||
|
|
||||||
Note: `FUNCTION_FRSKY_OSD` = `(1<<16)` requires 17 bits.
|
Note: `FUNCTION_FRSKY_OSD` = `(1<<16)` requires 17 bits.
|
||||||
|
Note2: We can use up to 32 bits (1<<32) here.
|
||||||
|
|
||||||
### 3. MSP Baudrates
|
### 3. MSP Baudrates
|
||||||
|
|
||||||
|
|
|
@ -201,7 +201,7 @@ COMMON_SRC = \
|
||||||
io/vtx_tramp.c \
|
io/vtx_tramp.c \
|
||||||
io/vtx_control.c \
|
io/vtx_control.c \
|
||||||
io/vtx_msp.c \
|
io/vtx_msp.c \
|
||||||
cms/cms_menu_vtx_msp.c \
|
cms/cms_menu_vtx_msp.c
|
||||||
|
|
||||||
COMMON_DEVICE_SRC = \
|
COMMON_DEVICE_SRC = \
|
||||||
$(CMSIS_SRC) \
|
$(CMSIS_SRC) \
|
||||||
|
@ -363,7 +363,7 @@ SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
|
||||||
osd/osd_warnings.c \
|
osd/osd_warnings.c \
|
||||||
rx/rx_bind.c \
|
rx/rx_bind.c \
|
||||||
io/vtx_msp.c \
|
io/vtx_msp.c \
|
||||||
cms/cms_menu_vtx_msp.c \
|
cms/cms_menu_vtx_msp.c
|
||||||
|
|
||||||
# Gyro driver files that only contain initialization and configuration code - not runtime code
|
# Gyro driver files that only contain initialization and configuration code - not runtime code
|
||||||
SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
|
SIZE_OPTIMISED_SRC := $(SIZE_OPTIMISED_SRC) \
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <drivers/vtx_table.h>
|
|
||||||
|
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
|
|
||||||
|
@ -35,6 +34,7 @@
|
||||||
#include "cms/cms_types.h"
|
#include "cms/cms_types.h"
|
||||||
|
|
||||||
#include "drivers/vtx_common.h"
|
#include "drivers/vtx_common.h"
|
||||||
|
#include "drivers/vtx_table.h"
|
||||||
|
|
||||||
#include "config/config.h"
|
#include "config/config.h"
|
||||||
|
|
||||||
|
@ -241,15 +241,15 @@ static const void *mspCmsOnEnter(displayPort_t *pDisp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const OSD_Entry mspCmsMenuCommenceEntries[] = {
|
static const OSD_Entry mspCmsMenuCommenceEntries[] = {
|
||||||
{ "CONFIRM", OME_Label, NULL, NULL },
|
{ "CONFIRM", OME_Label, NULL, NULL },
|
||||||
{ "YES", OME_Funcall, mspCmsCommence, NULL },
|
{ "YES", OME_Funcall, mspCmsCommence, NULL },
|
||||||
{ "NO", OME_Back, NULL, NULL },
|
{ "NO", OME_Back, NULL, NULL },
|
||||||
{ NULL, OME_END, NULL, NULL }
|
{ NULL, OME_END, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static CMS_Menu mspCmsMenuCommence = {
|
static CMS_Menu mspCmsMenuCommence = {
|
||||||
#ifdef CMS_MENU_DEBUG
|
#ifdef CMS_MENU_DEBUG
|
||||||
.GUARD_text = "XVTXMSC",
|
.GUARD_text = "XVTXMSPC",
|
||||||
.GUARD_type = OME_MENU,
|
.GUARD_type = OME_MENU,
|
||||||
#endif
|
#endif
|
||||||
.onEnter = NULL,
|
.onEnter = NULL,
|
||||||
|
@ -260,18 +260,16 @@ static CMS_Menu mspCmsMenuCommence = {
|
||||||
|
|
||||||
static const OSD_Entry mspMenuEntries[] =
|
static const OSD_Entry mspMenuEntries[] =
|
||||||
{
|
{
|
||||||
{ "- MSP -", OME_Label, NULL, NULL },
|
{ "- MSP -", OME_Label, NULL, NULL },
|
||||||
|
{ "", OME_Label | DYNAMIC, NULL, mspCmsStatusString },
|
||||||
{ "", OME_Label | DYNAMIC, NULL, mspCmsStatusString },
|
{ "PIT", OME_TAB, mspCmsSetPitMode, &mspCmsEntPitMode },
|
||||||
{ "PIT", OME_TAB, mspCmsSetPitMode, &mspCmsEntPitMode },
|
{ "BAND", OME_TAB, mspCmsConfigBand, &mspCmsEntBand },
|
||||||
{ "BAND", OME_TAB, mspCmsConfigBand, &mspCmsEntBand },
|
{ "CHAN", OME_TAB, mspCmsConfigChan, &mspCmsEntChan },
|
||||||
{ "CHAN", OME_TAB, mspCmsConfigChan, &mspCmsEntChan },
|
{ "(FREQ)", OME_UINT16 | DYNAMIC, NULL, &mspCmsEntFreqRef },
|
||||||
{ "(FREQ)", OME_UINT16 | DYNAMIC, NULL, &mspCmsEntFreqRef },
|
{ "POWER", OME_TAB, mspCmsConfigPower, &mspCmsEntPower },
|
||||||
{ "POWER", OME_TAB, mspCmsConfigPower, &mspCmsEntPower },
|
{ "SAVE", OME_Submenu, cmsMenuChange, &mspCmsMenuCommence },
|
||||||
{ "SAVE", OME_Submenu, cmsMenuChange, &mspCmsMenuCommence },
|
{ "BACK", OME_Back, NULL, NULL },
|
||||||
|
{ NULL, OME_END, NULL, NULL }
|
||||||
{ "BACK", OME_Back, NULL, NULL },
|
|
||||||
{ NULL, OME_END, NULL, NULL }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CMS_Menu cmsx_menuVtxMsp = {
|
CMS_Menu cmsx_menuVtxMsp = {
|
||||||
|
|
|
@ -98,7 +98,7 @@ void setMspVtxDeviceStatusReady(const int descriptor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_UNIT_TESTED void prepareMspFrame(uint8_t *mspFrame)
|
void prepareMspFrame(uint8_t *mspFrame)
|
||||||
{
|
{
|
||||||
mspFrame[0] = VTXDEV_MSP;
|
mspFrame[0] = VTXDEV_MSP;
|
||||||
mspFrame[1] = vtxSettingsConfig()->band;
|
mspFrame[1] = vtxSettingsConfig()->band;
|
||||||
|
|
|
@ -32,6 +32,4 @@ typedef enum {
|
||||||
|
|
||||||
bool vtxMspInit(void);
|
bool vtxMspInit(void);
|
||||||
void setMspVtxDeviceStatusReady(const int descriptor);
|
void setMspVtxDeviceStatusReady(const int descriptor);
|
||||||
#ifdef UNIT_TEST
|
void prepareMspFrame(uint8_t *mspFrame);
|
||||||
STATIC_UNIT_TESTED void prepareMspFrame(uint8_t *mspFrame);
|
|
||||||
#endif
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue