diff --git a/src/deck/drivers/src/bigquad.c b/src/deck/drivers/src/bigquad.c index 612fd164d9..f5232dd7c1 100644 --- a/src/deck/drivers/src/bigquad.c +++ b/src/deck/drivers/src/bigquad.c @@ -73,8 +73,9 @@ static void osdResponseCallback(uint8_t* pBuffer, uint32_t bufferLen) static void bigquadInit(DeckInfo *info) { - if(isInit) + if(isInit) { return; + } DEBUG_PRINT("Switching to brushless.\n"); motorsInit(motorMapBigQuadDeck); @@ -118,4 +119,8 @@ static const DeckDriver bigquad_deck = { }; DECK_DRIVER(bigquad_deck); + +PARAM_GROUP_START(deck) +PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcBigQuad, &isInit) +PARAM_GROUP_STOP(deck) #endif // ENABLE_BQ_DECK diff --git a/src/deck/drivers/src/flowdeck.c b/src/deck/drivers/src/flowdeck.c index b1c4ce1fc6..c2baf535da 100644 --- a/src/deck/drivers/src/flowdeck.c +++ b/src/deck/drivers/src/flowdeck.c @@ -261,7 +261,7 @@ static void pamotionTask(void *param) readMotion(¤tMotion); // Flip motion information to comply with sensor mounting - // (might need to be changed if mounted diffrently) + // (might need to be changed if mounted differently) int16_t accpx = -currentMotion.deltaY; int16_t accpy = -currentMotion.deltaX; @@ -312,7 +312,9 @@ static void pamotionTask(void *param) static void pamotionInit() { - if (isInit) return; + if (isInit) { + return; + } // Initialize the VL53 sensor using the zRanger deck driver const DeckDriver *zRanger = deckFindDriverByName("bcZRanger"); @@ -399,3 +401,7 @@ LOG_GROUP_STOP(motion) PARAM_GROUP_START(motion) PARAM_ADD(PARAM_UINT8, disable, &useFlowDisabled) PARAM_GROUP_STOP(motion) + +PARAM_GROUP_START(deck) +PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcFlow, &isInit) +PARAM_GROUP_STOP(deck) diff --git a/src/deck/drivers/src/ledring12.c b/src/deck/drivers/src/ledring12.c index b08fa4fbf3..573b90cbe9 100644 --- a/src/deck/drivers/src/ledring12.c +++ b/src/deck/drivers/src/ledring12.c @@ -44,6 +44,7 @@ #include "pm.h" #include "log.h" +static bool isInit = false; /* * To add a new effect just add it as a static function with the prototype @@ -619,6 +620,10 @@ static void ledring12Timer(xTimerHandle timer) static void ledring12Init(DeckInfo *info) { + if (isInit) { + return; + } + GPIO_InitTypeDef GPIO_InitStructure; ws2812Init(); @@ -631,6 +636,8 @@ static void ledring12Init(DeckInfo *info) GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_Init(GPIOB, &GPIO_InitStructure); + isInit = true; + timer = xTimerCreate( "ringTimer", M2T(50), pdTRUE, NULL, ledring12Timer ); xTimerStart(timer, 100); @@ -660,3 +667,7 @@ static const DeckDriver ledring12_deck = { }; DECK_DRIVER(ledring12_deck); + +PARAM_GROUP_START(deck) +PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcLedRing, &isInit) +PARAM_GROUP_STOP(deck) diff --git a/src/deck/drivers/src/oa.c b/src/deck/drivers/src/oa.c index b317eb6d60..2791213a4b 100644 --- a/src/deck/drivers/src/oa.c +++ b/src/deck/drivers/src/oa.c @@ -86,7 +86,9 @@ static void oaTask(void *param) static void oaInit() { - if (isInit) return; + if (isInit) { + return; + } pca95x4Init(); @@ -182,3 +184,7 @@ LOG_ADD(LOG_UINT16, up, &rangeUp) LOG_ADD(LOG_UINT16, left, &rangeLeft) LOG_ADD(LOG_UINT16, right, &rangeRight) LOG_GROUP_STOP(oa) + +PARAM_GROUP_START(deck) +PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcOA, &isInit) +PARAM_GROUP_STOP(deck)