From 51aa8e8177a9cfc3789eb4953381279e27a73782 Mon Sep 17 00:00:00 2001 From: jflyper Date: Tue, 19 Sep 2017 23:15:25 +0900 Subject: [PATCH] Fix typo for VTX_RTC6705_OPTIONAL and add vtxCommonDeviceRegistered --- src/main/drivers/vtx_common.c | 5 +++++ src/main/drivers/vtx_common.h | 1 + src/main/fc/fc_init.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/vtx_common.c b/src/main/drivers/vtx_common.c index fff7fcab6b..b58121487d 100644 --- a/src/main/drivers/vtx_common.c +++ b/src/main/drivers/vtx_common.c @@ -42,6 +42,11 @@ void vtxCommonRegisterDevice(vtxDevice_t *pDevice) vtxDevice = pDevice; } +bool vtxCommonDeviceRegistered(void) +{ + return vtxDevice; +} + void vtxCommonProcess(uint32_t currentTimeUs) { if (!vtxDevice) diff --git a/src/main/drivers/vtx_common.h b/src/main/drivers/vtx_common.h index 000859ccab..fc74f130d8 100644 --- a/src/main/drivers/vtx_common.h +++ b/src/main/drivers/vtx_common.h @@ -78,6 +78,7 @@ typedef struct vtxVTable_s { void vtxCommonInit(void); void vtxCommonRegisterDevice(vtxDevice_t *pDevice); +bool vtxCommonDeviceRegistered(void); // VTable functions void vtxCommonProcess(uint32_t currentTimeUs); diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index 27c4c56c57..9edd9cc452 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -677,7 +677,7 @@ void init(void) #endif #ifdef VTX_RTC6705 -#ifdef VTX_RTC6705OPTIONAL +#ifdef VTX_RTC6705_OPTIONAL if (!vtxCommonDeviceRegistered()) // external VTX takes precedence when configured. #endif {