add mute handler

This commit is contained in:
Steven Dan
2026-03-30 20:01:40 +08:00
parent f548845a29
commit 898ef085c0

View File

@@ -1904,7 +1904,7 @@ void AudioHwRemote(chanend c_hidSendData, chanend cc_mic_level, chanend c_uac_vo
/* Configures the external audio hardware at startup */ /* Configures the external audio hardware at startup */
void AudioHwInit() void AudioHwInit()
{ {
p_ctl_mute <: 0; // p_ctl_mute <: 0;
int result=0; int result=0;
sw_pll_fixed_clock(MCLK_48); sw_pll_fixed_clock(MCLK_48);
@@ -1923,7 +1923,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned s
#else #else
static unsigned count = 0; static unsigned count = 0;
#endif #endif
p_ctl_mute <: 0; // p_ctl_mute <: 0;
g_samfreq = samFreq; g_samfreq = samFreq;
delay_milliseconds(2); delay_milliseconds(2);
{ {
@@ -1935,7 +1935,7 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned s
if (count++ > 0) if (count++ > 0)
{ {
p_ctl_mute <: 1; // p_ctl_mute <: 1;
} }
else else
{ {
@@ -1944,3 +1944,11 @@ void AudioHwConfig(unsigned samFreq, unsigned mClk, unsigned dsdMode, unsigned s
unsafe {uc_audiohw :> dsdMode; } unsafe {uc_audiohw :> dsdMode; }
} }
void mute_handler()
{
p_ctl_mute <: 0;
delay_milliseconds(1000);
p_ctl_mute <: 1;
}