1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-21 07:15:18 +03:00

Moved calculation of available boxes into 'activateConfig()' to avoid a reboot.

This commit is contained in:
mikeller 2020-06-01 21:06:27 +12:00
parent 6bada9c5e9
commit 9ed83cf67c
3 changed files with 7 additions and 2 deletions

View file

@ -60,6 +60,8 @@
#include "io/serial.h"
#include "io/vtx.h"
#include "msp/msp_box.h"
#include "osd/osd.h"
#include "pg/adc.h"
@ -181,6 +183,8 @@ static void activateConfig(void)
#if defined(USE_LED_STRIP_STATUS_MODE)
reevaluateLedConfig();
#endif
initActiveBoxIds();
}
static void adjustFilterLimit(uint16_t *parm, uint16_t resetValue)

View file

@ -3600,5 +3600,4 @@ void mspFcProcessReply(mspPacket_t *reply)
void mspInit(void)
{
initActiveBoxIds();
}

View file

@ -125,8 +125,10 @@ const box_t *findBoxByPermanentId(uint8_t permanentId)
static bool activeBoxIdGet(boxId_e boxId)
{
if (boxId > sizeof(activeBoxIds) * 8)
if (boxId > sizeof(activeBoxIds) * 8) {
return false;
}
return bitArrayGet(&activeBoxIds, boxId);
}