0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 14:21:25 +03:00

remove some speaker clicks

This commit is contained in:
OneOfEleven 2023-10-18 21:39:09 +01:00
parent 9095eba846
commit e0eddfcfdd
3 changed files with 7 additions and 7 deletions

View File

@ -1034,10 +1034,6 @@ void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const
BK4819_EnterTxMute();
// SYSTEM_DelayMs(2);
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); // enable speaker
SYSTEM_DelayMs(2);
BK4819_WriteRegister(BK4819_REG_70, BK4819_REG_70_ENABLE_TONE1 | ((level & 0x7f) << BK4819_REG_70_SHIFT_TONE1_TUNING_GAIN));
if (set_dac)
@ -1049,17 +1045,21 @@ void BK4819_StartTone1(const uint16_t frequency, const unsigned int level, const
BK4819_WriteRegister(BK4819_REG_71, scale_freq(frequency));
BK4819_ExitTxMute();
// SYSTEM_DelayMs(2);
GPIO_SetBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER); // enable speaker
SYSTEM_DelayMs(2);
}
void BK4819_StopTones(void)
{
// if (!g_enable_speaker)
GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
BK4819_EnterTxMute();
BK4819_WriteRegister(BK4819_REG_70, 0);
BK4819_WriteRegister(BK4819_REG_30, 0xC1FE); // 1100 0001 1111 1110
BK4819_ExitTxMute();
// if (!g_enable_speaker)
// GPIO_ClearBit(&GPIOC->DATA, GPIOC_PIN_SPEAKER);
}
void BK4819_PlayTone(const unsigned int tone_Hz, const unsigned int delay, const unsigned int level)

Binary file not shown.

Binary file not shown.