耳机插入从tsc更换为gpio,更加准确和敏感

This commit is contained in:
root 2023-07-12 23:46:07 +08:00
parent 525d140110
commit 05f5507323

View File

@ -762,7 +762,7 @@ 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) & 1u; u8 state = GPIO_read(GPIO_2_HEADPH_JACK) & 1u;
if( state != headset ) if( state != headset )
{ {
headset = state; headset = state;