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

Compander bug fixed, found by two other people :)

This commit is contained in:
OneOfEleven 2023-10-04 14:55:58 +01:00
parent f4b637b51a
commit 567b0cfa83
6 changed files with 31 additions and 28 deletions

View File

@ -13,7 +13,7 @@ ENABLE_NOAA := 0
ENABLE_VOICE := 0
ENABLE_VOX := 0
ENABLE_ALARM := 0
ENABLE_TX1750 := 1
ENABLE_TX1750 := 0
ENABLE_BIG_FREQ := 0
ENABLE_SMALL_BOLD := 1
ENABLE_KEEP_MEM_NAME := 1
@ -23,13 +23,13 @@ ENABLE_F_CAL_MENU := 0
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1
ENABLE_MAIN_KEY_HOLD := 1
ENABLE_BOOT_BEEPS := 0
ENABLE_COMPANDER := 0
ENABLE_COMPANDER := 1
ENABLE_SHOW_CHARGE_LEVEL := 1
ENABLE_REVERSE_BAT_SYMBOL := 1
ENABLE_CODE_SCAN_TIMEOUT := 0
ENABLE_AM_FIX := 1
ENABLE_AM_FIX_SHOW_DATA := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 0
ENABLE_SQUELCH_MORE_SENSITIVE := 1
ENABLE_FASTER_CHANNEL_SCAN := 0
ENABLE_RSSI_BAR := 1
ENABLE_AUDIO_BAR := 1
@ -280,6 +280,9 @@ endif
LDFLAGS = -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld
# Use newlib-nano instead of newlib
LDFLAGS += --specs=nano.specs
ifeq ($(DEBUG),1)
ASFLAGS += -g
CFLAGS += -g

View File

@ -46,7 +46,7 @@ ENABLE_F_CAL_MENU := 0 enable/disable the radios hidden freque
ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 standard CTCSS tail phase shift rather than QS's own 55Hz tone method
ENABLE_MAIN_KEY_HOLD := 1 initial F-key press not needed, instead just hold down keys 0-9 to access the secondary butt functions
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
ENABLE_COMPANDER := 0 this is broken, don't bother with it for now .. compander option (per channel)
ENABLE_COMPANDER := 0 compander option (per channel)
ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge
ENABLE_REVERSE_BAT_SYMBOL := 1 mirror the battery symbol on the status bar (+ pole on the right)
ENABLE_CODE_SCAN_TIMEOUT := 0 enable/disable 32-sec CTCSS/DCS scan timeout (press exit butt instead of time-out to end scan)

View File

@ -835,7 +835,7 @@ void BK4819_SetCompander(const unsigned int mode)
if (mode == 0)
{ // disable
BK4819_WriteRegister(BK4819_REG_31, r31 & ~(1u < 3));
BK4819_WriteRegister(BK4819_REG_31, r31 & ~(1u << 3));
return;
}
@ -856,9 +856,9 @@ void BK4819_SetCompander(const unsigned int mode)
const uint16_t compress_noise_dB = 64;
// AB40 10 1010110 1000000
BK4819_WriteRegister(BK4819_REG_29, // (BK4819_ReadRegister(BK4819_REG_29) & ~(3u < 14)) | (compress_ratio < 14));
(compress_ratio < 14)
| (compress_0dB < 7)
| (compress_noise_dB < 0));
(compress_ratio << 14)
| (compress_0dB << 7)
| (compress_noise_dB << 0));
// set the expander ratio
//
@ -877,12 +877,12 @@ void BK4819_SetCompander(const unsigned int mode)
const uint16_t expand_noise_dB = 56;
// 6B38 01 1010110 0111000
BK4819_WriteRegister(BK4819_REG_28, // (BK4819_ReadRegister(BK4819_REG_28) & ~(3u < 14)) | (expand_ratio < 14));
(expand_ratio < 14)
| (expand_0dB < 7)
| (expand_noise_dB < 0));
(expand_ratio << 14)
| (expand_0dB << 7)
| (expand_noise_dB << 0));
// enable
BK4819_WriteRegister(BK4819_REG_31, r31 | (1u < 3));
BK4819_WriteRegister(BK4819_REG_31, r31 | (1u << 3));
}
void BK4819_DisableVox(void)

View File

@ -24,22 +24,22 @@
enum BK4819_AF_Type_t
{
BK4819_AF_MUTE = 0u, //
BK4819_AF_FM = 1u, // FM
BK4819_AF_ALAM = 2u, //
BK4819_AF_BEEP = 3u, //
BK4819_AF_UNKNOWN1 = 4u, // SSB I think
BK4819_AF_UNKNOWN2 = 5u, // SSB again
BK4819_AF_CTCO = 6u, // strange LF audio .. maybe the CTCSS LF line ?
BK4819_AF_AM = 7u, // AM
BK4819_AF_FSKO = 8u, // nothing
BK4819_AF_UNKNOWN3 = 9u, // distorted
BK4819_AF_UNKNOWN4 = 10u, // nothing at all
BK4819_AF_UNKNOWN5 = 11u, // distorted
BK4819_AF_UNKNOWN6 = 12u, // distorted
BK4819_AF_UNKNOWN7 = 13u, // interesting
BK4819_AF_UNKNOWN8 = 14u, // interesting
BK4819_AF_UNKNOWN9 = 15u // not a lot
BK4819_AF_MUTE = 0u, //
BK4819_AF_FM = 1u, // FM
BK4819_AF_ALAM = 2u, //
BK4819_AF_BEEP = 3u, //
BK4819_AF_BASEBAND1 = 4u, // SSB
BK4819_AF_BASEBAND2 = 5u, // SSB
BK4819_AF_CTCO = 6u, // strange LF audio .. maybe the CTCSS LF line ?
BK4819_AF_AM = 7u, // AM
BK4819_AF_FSKO = 8u, // nothing
BK4819_AF_UNKNOWN3 = 9u, // distorted
BK4819_AF_UNKNOWN4 = 10u, // nothing at all
BK4819_AF_UNKNOWN5 = 11u, // distorted
BK4819_AF_UNKNOWN6 = 12u, // distorted
BK4819_AF_UNKNOWN7 = 13u, // interesting
BK4819_AF_UNKNOWN8 = 14u, // interesting
BK4819_AF_UNKNOWN9 = 15u // not a lot
};
typedef enum BK4819_AF_Type_t BK4819_AF_Type_t;

Binary file not shown.

Binary file not shown.