mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Merge pull request #9875 from mikeller/move_box_init_to_activate_config
Moved calculation of available boxes into 'activateConfig()' to avoid a reboot.
This commit is contained in:
commit
9eb97ea78d
3 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -3596,5 +3596,4 @@ void mspFcProcessReply(mspPacket_t *reply)
|
|||
|
||||
void mspInit(void)
|
||||
{
|
||||
initActiveBoxIds();
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue