fix(amp): init the amplifier once after the string clock is up
Bring up 12V and Dream together after the boot lights, then configure the amp a single time so the string tone stays intact and the unmute write is not lost. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0e106e4da1
commit
df0fd0f6d0
|
|
@ -357,20 +357,29 @@ void System_AudioBringUp_Poll(void)
|
||||||
return;
|
return;
|
||||||
s_audio_bringup_req = 0;
|
s_audio_bringup_req = 0;
|
||||||
LOG_I("PWR", "bring up audio rails");
|
LOG_I("PWR", "bring up audio rails");
|
||||||
BSP_DreamCorePowerEnable(1);
|
/* LOGO 和彩灯期间不要求发音,电源在彩灯结束后才开。
|
||||||
|
12V 与 Dream 一起开:功放没有 I2S 时钟时写寄存器会停在静音。
|
||||||
|
等电源和时钟都稳后再初始化功放,并且只做一次,避免琴弦波形被第二次复位打乱。 */
|
||||||
BSP_HT7178PowerEnable(1);
|
BSP_HT7178PowerEnable(1);
|
||||||
|
BSP_DreamCorePowerEnable(1);
|
||||||
BSP_BlueToothPowerEnable((uint8_t)(mGuiData[GUI_BL_SW].Current ? 1 : 0));
|
BSP_BlueToothPowerEnable((uint8_t)(mGuiData[GUI_BL_SW].Current ? 1 : 0));
|
||||||
Power_LogRails("audio-up");
|
Power_LogRails("audio-up");
|
||||||
/* 12V 升压刚打开时功放模拟电源未稳,立刻写寄存器会仍处于静音 */
|
rt_thread_mdelay(480);
|
||||||
rt_thread_mdelay(80);
|
if (!powon)
|
||||||
|
return;
|
||||||
AD85020B_Init();
|
AD85020B_Init();
|
||||||
App_Auto_Init();
|
App_Auto_Init();
|
||||||
/* App 协议走 UART4:须在开机后即解析,不能等到触摸选模式才 StartTask */
|
/* App 协议走 UART4:须在开机后即解析,不能等到触摸选模式才 StartTask */
|
||||||
StartTask();
|
StartTask();
|
||||||
|
/* Dream 刚上电会丢掉首包。等它起来后再发弦音色和主音量,并补发一次 */
|
||||||
|
rt_thread_mdelay(400);
|
||||||
|
if (!powon)
|
||||||
|
return;
|
||||||
|
MasterVolume_Reapply();
|
||||||
|
LoadConfig();
|
||||||
rt_thread_mdelay(400);
|
rt_thread_mdelay(400);
|
||||||
if (!powon)
|
if (!powon)
|
||||||
return;
|
return;
|
||||||
AD85020B_Init();
|
|
||||||
MasterVolume_Reapply();
|
MasterVolume_Reapply();
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
MainTask_Sendmsg(MSG_ID_EC_VOL, app_adc_get_volume(), level, 0);
|
MainTask_Sendmsg(MSG_ID_EC_VOL, app_adc_get_volume(), level, 0);
|
||||||
|
|
|
||||||
|
|
@ -460,9 +460,8 @@ AD85020B_StatusTypeDef AD85020B_Init(void)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* 样机 EQ:在解除静音前写入,避免先播出直通声音 */
|
/* 样机 EQ:在解除静音前写入。写失败也要继续解除静音,否则拨片和琴弦无声 */
|
||||||
status = AD85020B_ApplyPrototypeEq();
|
(void)AD85020B_ApplyPrototypeEq();
|
||||||
if (status != AD85020B_OK) return status;
|
|
||||||
|
|
||||||
/* 步骤6:解除静音(文档SCTL3,MMUTE=0,0x00) */
|
/* 步骤6:解除静音(文档SCTL3,MMUTE=0,0x00) */
|
||||||
status = AD85020B_I2C_Write(AD85020B_REG_SCTL3, 0x00);
|
status = AD85020B_I2C_Write(AD85020B_REG_SCTL3, 0x00);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue