From dee4b3daf57c1e53a88a67f7176e97c07dfbbdcd Mon Sep 17 00:00:00 2001 From: Steven Dan Date: Fri, 15 May 2026 11:44:47 +0800 Subject: [PATCH] udpate bypass --- sw_usb_audio/app_usb_aud_fosi_c1/CMakeLists.txt | 3 +++ .../src/extensions/audiohw.xc | 16 ++++++++++++++-- .../app_usb_aud_fosi_c1_lp/CMakeLists.txt | 1 + .../src/extensions/audiohw.xc | 16 ++++++++++++++-- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/sw_usb_audio/app_usb_aud_fosi_c1/CMakeLists.txt b/sw_usb_audio/app_usb_aud_fosi_c1/CMakeLists.txt index 93a71eb..e44b8cb 100644 --- a/sw_usb_audio/app_usb_aud_fosi_c1/CMakeLists.txt +++ b/sw_usb_audio/app_usb_aud_fosi_c1/CMakeLists.txt @@ -121,6 +121,7 @@ set(APP_COMPILER_FLAGS_fps_uac1 ${SW_USB_AUDIO_FLAGS} -DXUA_SPDIF_RX -DNUM_USB_CHAN_OUT_FS=2 -DXUA_USE_SW_PLL=0 -DOUT_VOLUME_IN_MIXER=0 + -DFPS_UAC1=1 #-fxscope #-DXSCOPE -DXUA_DFU_EN=0 @@ -160,6 +161,7 @@ set(APP_COMPILER_FLAGS_fps_uac2 ${SW_USB_AUDIO_FLAGS} -DXUA_SPD -DNUM_USB_CHAN_OUT_FS=2 -DXUA_USE_SW_PLL=0 -DOUT_VOLUME_IN_MIXER=0 + -DFPS_UAC2=1 #-fxscope #-DXSCOPE -DXUA_DFU_EN=1 @@ -196,6 +198,7 @@ set(APP_COMPILER_FLAGS_br_uac2 ${SW_USB_A -DNUM_USB_CHAN_OUT_FS=2 -DXUA_USE_SW_PLL=0 -DOUT_VOLUME_IN_MIXER=0 + -DBR_UAC2=1 #-fxscope #-DXSCOPE -DXUA_DFU_EN=1 diff --git a/sw_usb_audio/app_usb_aud_fosi_c1/src/extensions/audiohw.xc b/sw_usb_audio/app_usb_aud_fosi_c1/src/extensions/audiohw.xc index 60d623d..db52ebe 100644 --- a/sw_usb_audio/app_usb_aud_fosi_c1/src/extensions/audiohw.xc +++ b/sw_usb_audio/app_usb_aud_fosi_c1/src/extensions/audiohw.xc @@ -38,6 +38,7 @@ extern "C" { #define MODE_BR_UAC2 OPT_IN_FLAG // 3 BR #define MODE_V71_UAC2 UAC1_IN_FLAG // 4 V71 #define MODE_V71_UAC1 BT_IN_FLAG // 5 UAC1 +#define MODE_BYPASS_UAC2 I2S_IN_FLAG // 6 BYPASS extern unsigned g_host_os; // 1 -> Windows, 2 -> Others audio_sampling g_new_playback_format, g_playback_format; @@ -163,24 +164,35 @@ void switch_mode_by_c1_mode(unsigned c1_mode, unsigned force_reboot) switch (c1_mode) { case 1: - SetRoleSwitchFlag(MODE_FPS_UAC2); - reboot_need = 0; +#if !BYPASS_UAC2 + SetRoleSwitchFlag(MODE_BYPASS_UAC2); + reboot_need = 1; +#endif break; case 2: +#if !BYPASS_UAC2 SetRoleSwitchFlag(MODE_BR_UAC2); reboot_need = 1; +#endif break; case 3: +#if !BYPASS_UAC2 SetRoleSwitchFlag(MODE_V71_UAC2); reboot_need = 1; +#endif + reboot_need = 1; break; case 4: +#if !FPS_UAC2 SetRoleSwitchFlag(MODE_FPS_UAC2); reboot_need = 1; +#endif break; case 5: +#if !FPS_UAC2 SetRoleSwitchFlag(MODE_FPS_UAC2); reboot_need = 0; +#endif break; } #else diff --git a/sw_usb_audio/app_usb_aud_fosi_c1_lp/CMakeLists.txt b/sw_usb_audio/app_usb_aud_fosi_c1_lp/CMakeLists.txt index 730a8d0..5ecfe22 100644 --- a/sw_usb_audio/app_usb_aud_fosi_c1_lp/CMakeLists.txt +++ b/sw_usb_audio/app_usb_aud_fosi_c1_lp/CMakeLists.txt @@ -121,6 +121,7 @@ set(APP_COMPILER_FLAGS_bypass_uac2 ${SW_USB_AUDIO_FLAGS} -DXUA_SPDIF_RX -DNUM_USB_CHAN_OUT_FS=2 -DXUA_USE_SW_PLL=0 -DOUT_VOLUME_IN_MIXER=0 + -DBYPASS_UAC2=1 #-fxscope #-DXSCOPE -DXUA_DFU_EN=1 diff --git a/sw_usb_audio/app_usb_aud_fosi_c1_lp/src/extensions/audiohw.xc b/sw_usb_audio/app_usb_aud_fosi_c1_lp/src/extensions/audiohw.xc index 60d623d..db52ebe 100644 --- a/sw_usb_audio/app_usb_aud_fosi_c1_lp/src/extensions/audiohw.xc +++ b/sw_usb_audio/app_usb_aud_fosi_c1_lp/src/extensions/audiohw.xc @@ -38,6 +38,7 @@ extern "C" { #define MODE_BR_UAC2 OPT_IN_FLAG // 3 BR #define MODE_V71_UAC2 UAC1_IN_FLAG // 4 V71 #define MODE_V71_UAC1 BT_IN_FLAG // 5 UAC1 +#define MODE_BYPASS_UAC2 I2S_IN_FLAG // 6 BYPASS extern unsigned g_host_os; // 1 -> Windows, 2 -> Others audio_sampling g_new_playback_format, g_playback_format; @@ -163,24 +164,35 @@ void switch_mode_by_c1_mode(unsigned c1_mode, unsigned force_reboot) switch (c1_mode) { case 1: - SetRoleSwitchFlag(MODE_FPS_UAC2); - reboot_need = 0; +#if !BYPASS_UAC2 + SetRoleSwitchFlag(MODE_BYPASS_UAC2); + reboot_need = 1; +#endif break; case 2: +#if !BYPASS_UAC2 SetRoleSwitchFlag(MODE_BR_UAC2); reboot_need = 1; +#endif break; case 3: +#if !BYPASS_UAC2 SetRoleSwitchFlag(MODE_V71_UAC2); reboot_need = 1; +#endif + reboot_need = 1; break; case 4: +#if !FPS_UAC2 SetRoleSwitchFlag(MODE_FPS_UAC2); reboot_need = 1; +#endif break; case 5: +#if !FPS_UAC2 SetRoleSwitchFlag(MODE_FPS_UAC2); reboot_need = 0; +#endif break; } #else