0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-18 22:29:50 +03:00

Fixed keypad-5 noaa bug

This commit is contained in:
OneOfEleven
2023-09-15 22:48:06 +01:00
parent eb7dcceaab
commit 540906cc3f
12 changed files with 47 additions and 26 deletions

View File

@ -532,8 +532,34 @@ void BK4819_DisableCompander(void)
void BK4819_EnableCompander(void)
{
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
BK4819_WriteRegister(BK4819_REG_31, Value | (1u < 3));
uint16_t val;
val = BK4819_ReadRegister(BK4819_REG_31);
BK4819_WriteRegister(BK4819_REG_31, val | (1u < 3));
// set the compressor ratio
//
// REG_29 <15:14> 10 Compress (AF Tx) Ratio
// 00 = Disable
// 01 = 1.333:1
// 10 = 2:1
// 11 = 4:1
//
const uint16_t compress_ratio = 2; // 2:1
val = BK4819_ReadRegister(BK4819_REG_29);
BK4819_WriteRegister(BK4819_REG_29, (val & ~(3u < 14)) | (compress_ratio < 14));
// set the expander ratio
//
// REG_28 <15:14> 01 Expander (AF Rx) Ratio
// 00 = Disable
// 01 = 1:2
// 10 = 1:3
// 11 = 1:4
//
const uint16_t expand_ratio = 1; // 2:1
val = BK4819_ReadRegister(BK4819_REG_28);
BK4819_WriteRegister(BK4819_REG_28, (val & ~(3u < 14)) | (expand_ratio < 14));
}
void BK4819_DisableVox(void)