feat: mute while charging on some Jumper radios (#5541)
This commit is contained in:
@@ -281,12 +281,14 @@ if(TRACE_AUDIO)
|
||||
endif()
|
||||
|
||||
if(DEBUG STREQUAL RTT)
|
||||
set(DEBUG ON)
|
||||
set(DEBUG_SEGGER_RTT ON)
|
||||
add_definitions(-DDEBUG_SEGGER_RTT)
|
||||
set(SRC ${SRC} ${THIRDPARTY_DIR}/Segger_RTT/RTT/SEGGER_RTT.c)
|
||||
endif()
|
||||
|
||||
if(DEBUG STREQUAL RTT_NO_USB)
|
||||
set(DEBUG ON)
|
||||
set(DEBUG_SEGGER_RTT ON)
|
||||
add_definitions(-DDEBUG_SEGGER_RTT)
|
||||
add_definitions(-DDEBUG_DISABLE_USB)
|
||||
|
||||
@@ -127,13 +127,18 @@ void boardInit()
|
||||
board_set_bor_level();
|
||||
#endif
|
||||
|
||||
#if defined(FUNCTION_SWITCHES) && !defined(DEBUG_DISABLE_USB)
|
||||
#if defined(FUNCTION_SWITCHES) && !defined(DEBUG)
|
||||
// This is needed to prevent radio from starting when usb is plugged to charge
|
||||
usbInit();
|
||||
// prime debounce state...
|
||||
usbPlugged();
|
||||
if (usbPlugged()) {
|
||||
delaysInit();
|
||||
#if defined(AUDIO_MUTE_GPIO)
|
||||
// Charging can make a buzzing noise
|
||||
gpio_init(AUDIO_MUTE_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
|
||||
gpio_set(AUDIO_MUTE_GPIO);
|
||||
#endif
|
||||
while (usbPlugged()) {
|
||||
delay_ms(1000);
|
||||
}
|
||||
|
||||
@@ -114,13 +114,18 @@ void boardInit()
|
||||
LL_APB1_GRP1_EnableClock(AUDIO_RCC_APB1Periph);
|
||||
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
|
||||
|
||||
#if defined(USB_CHARGE_LED) && !defined(DEBUG_DISABLE_USB)
|
||||
#if defined(USB_CHARGE_LED) && !defined(DEBUG)
|
||||
usbInit();
|
||||
// prime debounce state...
|
||||
usbPlugged();
|
||||
|
||||
if (usbPlugged()) {
|
||||
delaysInit();
|
||||
#if defined(AUDIO_MUTE_GPIO)
|
||||
// Charging can make a buzzing noise
|
||||
gpio_init(AUDIO_MUTE_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
|
||||
gpio_set(AUDIO_MUTE_GPIO);
|
||||
#endif
|
||||
while (usbPlugged()) {
|
||||
delay_ms(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user