refactor(boot): move BT and rotary encoder init to board specifics (#7265)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
ac4c4d7b6b
commit
559866c059
@@ -264,12 +264,6 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BLUETOOTH)
|
||||
set(BOARD_COMMON_SRC ${BOARD_COMMON_SRC}
|
||||
targets/common/arm/stm32/bluetooth_driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (VIDEO_SWITCH)
|
||||
add_definitions(-DVIDEO_SWITCH)
|
||||
set(BOARD_COMMON_SRC ${BOARD_COMMON_SRC}
|
||||
@@ -303,6 +297,10 @@ add_library(board OBJECT EXCLUDE_FROM_ALL
|
||||
)
|
||||
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:board>)
|
||||
|
||||
if(BLUETOOTH)
|
||||
target_sources(board PRIVATE targets/common/arm/stm32/bluetooth_driver.cpp)
|
||||
endif()
|
||||
|
||||
if(HARDWARE_TOUCH)
|
||||
add_definitions(-DHARDWARE_TOUCH)
|
||||
|
||||
|
||||
@@ -59,12 +59,29 @@
|
||||
HardwareOptions hardwareOptions;
|
||||
bool boardBacklightOn = false;
|
||||
|
||||
#if defined(VIDEO_SWITCH) || (defined(BLUETOOTH) && defined(BOOT))
|
||||
|
||||
#if defined(VIDEO_SWITCH)
|
||||
#include "videoswitch_driver.h"
|
||||
#endif
|
||||
|
||||
void boardBLEarlyInit()
|
||||
{
|
||||
#if defined(VIDEO_SWITCH)
|
||||
videoSwitchInit();
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
// Disable the BT module so it will be detected on firmware start
|
||||
#if defined(BT_EN_GPIO)
|
||||
gpio_init(BT_EN_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
|
||||
gpio_write(BT_EN_GPIO, 1);
|
||||
#endif
|
||||
#if defined(BT_PWR_GPIO)
|
||||
gpio_init(BT_PWR_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
|
||||
gpio_set(BT_PWR_GPIO);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -77,6 +94,7 @@ void boardBLPreJump()
|
||||
|
||||
void boardBLInit()
|
||||
{
|
||||
rotaryEncoderInit();
|
||||
SDRAM_Init();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user