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:
parent
6bada9c5e9
commit
9ed83cf67c
3 changed files with 7 additions and 2 deletions
|
@ -60,6 +60,8 @@
|
||||||
#include "io/serial.h"
|
#include "io/serial.h"
|
||||||
#include "io/vtx.h"
|
#include "io/vtx.h"
|
||||||
|
|
||||||
|
#include "msp/msp_box.h"
|
||||||
|
|
||||||
#include "osd/osd.h"
|
#include "osd/osd.h"
|
||||||
|
|
||||||
#include "pg/adc.h"
|
#include "pg/adc.h"
|
||||||
|
@ -181,6 +183,8 @@ static void activateConfig(void)
|
||||||
#if defined(USE_LED_STRIP_STATUS_MODE)
|
#if defined(USE_LED_STRIP_STATUS_MODE)
|
||||||
reevaluateLedConfig();
|
reevaluateLedConfig();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
initActiveBoxIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void adjustFilterLimit(uint16_t *parm, uint16_t resetValue)
|
static void adjustFilterLimit(uint16_t *parm, uint16_t resetValue)
|
||||||
|
|
|
@ -3600,5 +3600,4 @@ void mspFcProcessReply(mspPacket_t *reply)
|
||||||
|
|
||||||
void mspInit(void)
|
void mspInit(void)
|
||||||
{
|
{
|
||||||
initActiveBoxIds();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,8 +125,10 @@ const box_t *findBoxByPermanentId(uint8_t permanentId)
|
||||||
|
|
||||||
static bool activeBoxIdGet(boxId_e boxId)
|
static bool activeBoxIdGet(boxId_e boxId)
|
||||||
{
|
{
|
||||||
if (boxId > sizeof(activeBoxIds) * 8)
|
if (boxId > sizeof(activeBoxIds) * 8) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return bitArrayGet(&activeBoxIds, boxId);
|
return bitArrayGet(&activeBoxIds, boxId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue