Add selectable BLE-only and Classic-only radio modes

This commit is contained in:
Joey Yakimowich-Payne 2026-09-09 11:40:51 -06:00
commit 595518fe3d
13 changed files with 951 additions and 95 deletions

View file

@ -90,6 +90,29 @@ if(NOT SWITCH_PICO_INPUT_BACKEND STREQUAL "UART"
"Unknown SWITCH_PICO_INPUT_BACKEND='${SWITCH_PICO_INPUT_BACKEND}'. "
"Expected UART or BLUEPAD32.")
endif()
set(SWITCH_PICO_BLUETOOTH_MODE "MIXED" CACHE STRING "Bluetooth radio mode: MIXED, BLE, or CLASSIC")
set_property(CACHE SWITCH_PICO_BLUETOOTH_MODE PROPERTY STRINGS MIXED BLE CLASSIC)
if(NOT SWITCH_PICO_BLUETOOTH_MODE MATCHES "^(MIXED|BLE|CLASSIC)$")
message(FATAL_ERROR "SWITCH_PICO_BLUETOOTH_MODE must be MIXED, BLE, or CLASSIC")
endif()
if(SWITCH_PICO_INPUT_BACKEND STREQUAL "BLUEPAD32")
if(SWITCH_PICO_BLUETOOTH_MODE STREQUAL "CLASSIC")
set(SWITCH_PICO_ENABLE_BLE 0)
else()
set(SWITCH_PICO_ENABLE_BLE 1)
endif()
if(SWITCH_PICO_BLUETOOTH_MODE STREQUAL "BLE")
set(SWITCH_PICO_ENABLE_CLASSIC 0)
else()
set(SWITCH_PICO_ENABLE_CLASSIC 1)
endif()
# Directory scope also covers Bluepad32 and its build-local SDK sources.
add_compile_definitions(
SWITCH_PICO_ENABLE_BLE=${SWITCH_PICO_ENABLE_BLE}
SWITCH_PICO_ENABLE_CLASSIC=${SWITCH_PICO_ENABLE_CLASSIC})
elseif(NOT SWITCH_PICO_BLUETOOTH_MODE STREQUAL "MIXED")
message(FATAL_ERROR "Single-transport Bluetooth modes require the BLUEPAD32 backend")
endif()
set(PICO_BOARD pico CACHE STRING "Board type")
if(SWITCH_PICO_INPUT_BACKEND STREQUAL "BLUEPAD32"
AND NOT PICO_BOARD STREQUAL "pico2_w")