Skip to content

Commit

Permalink
Disable processing MSPVTX commands if there is not SPIVTX (ExpressLRS…
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 authored Jan 21, 2024
1 parent a4f1657 commit 212361b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/lib/MSPVTX/devMSPVTX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static uint8_t checkingIndex = 0;
static uint8_t pitMode = 0;
static uint8_t power = 0;
static uint8_t channel = 0;
static uint8_t mspState = GET_VTX_TABLE_SIZE;
static uint8_t mspState = STOP_MSPVTX;

static void sendCrsfMspToFC(uint8_t *mspFrame, uint8_t mspFrameSize)
{
Expand Down Expand Up @@ -352,6 +352,14 @@ void disableMspVtx(void)
mspState = STOP_MSPVTX;
}

static void initialize()
{
if (OPT_HAS_VTX_SPI)
{
mspState = GET_VTX_TABLE_SIZE;
}
}

static int event(void)
{
if (GPIO_PIN_SPI_VTX_NSS == UNDEF_PIN)
Expand Down Expand Up @@ -379,8 +387,8 @@ static int timeout(void)
}

device_t MSPVTx_device = {
.initialize = NULL,
.start = NULL,
.initialize = initialize,
.start = nullptr,
.event = event,
.timeout = timeout
};
Expand Down

0 comments on commit 212361b

Please sign in to comment.