refactor: bootloader & cmake cleanup (#5232)
This commit is contained in:
@@ -13,6 +13,7 @@ set(MINIMAL_BOARD_LIB_SRC
|
||||
|
||||
boards/generic_stm32/inputs.cpp
|
||||
boards/generic_stm32/i2c_bus.cpp
|
||||
boards/generic_stm32/bl_keys.cpp
|
||||
)
|
||||
|
||||
# Dependencies only used in firmware
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "board.h"
|
||||
#include "hal/key_driver.h"
|
||||
|
||||
#if defined(BOOTLOADER_KEYS)
|
||||
|
||||
bool boardBLStartCondition()
|
||||
{
|
||||
// Trims combo activated
|
||||
bool result = (readTrims() == BOOTLOADER_KEYS);
|
||||
#if defined(SECONDARY_BOOTLOADER_KEYS)
|
||||
result |= (readTrims() == SECONDARY_BOOTLOADER_KEYS);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
#elif (defined(RADIO_T8) || defined(RADIO_COMMANDO8)) && !defined(RADIOMASTER_RELEASE)
|
||||
|
||||
bool boardBLStartCondition()
|
||||
{
|
||||
// Bind button pressed
|
||||
return (KEYS_GPIO_REG_BIND->IDR & KEYS_GPIO_PIN_BIND) == 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user