修复耳机无法外放的bug

This commit is contained in:
root 2023-07-10 23:07:24 +08:00
parent a30575b935
commit 9fa049e281

View File

@ -762,11 +762,12 @@ bool CODEC_getRawAdcData(CdcAdcData *data)
void CODEC_soundSwitchOutput(void) void CODEC_soundSwitchOutput(void)
{ {
static u8 headset = 0; static u8 headset = 0;
u8 state = readReg(CDC_REG_100_44) & 3u; u8 state = readReg(CDC_REG_100_44) & 1u;
if( state != headset ) if( state != headset )
{ {
headset = state; headset = state;
if( headset ) maskReg( CDC_REG_HEADSET_SEL, HEADSET_SEL_HP, 0xff); // see: forceAudioOutput@Luma3DS/sysmodules/rosalina/source/shell.c
else maskReg( CDC_REG_HEADSET_SEL, HEADSET_SEL_SP, 0xff); if( headset ) maskReg( CDC_REG_HEADSET_SEL, 0x30, 0xff);
else maskReg( CDC_REG_HEADSET_SEL, 0x20, 0xff);
} }
} }