mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-22 19:18:56 +00:00
commit
8a67bd4c70
@ -50,6 +50,12 @@ bool gTailFound;
|
||||
const uint16_t RSSI_MAX_VALUE = 65535;
|
||||
|
||||
#define SQUELCH_OFF_DELAY 10
|
||||
// val x 100uS
|
||||
// determines how often rssi gets reset during active RX
|
||||
// too high value will cause audio clipping
|
||||
// too low will cause longer sticky squelch issue
|
||||
#define GLITCH_RESET_DELAY 50
|
||||
uint8_t glitchResetCounter = 0;
|
||||
|
||||
static uint16_t R30, R37, R3D, R43, R47, R48, R7E, R02, R3F;
|
||||
static uint32_t initialFreq;
|
||||
@ -346,13 +352,29 @@ uint8_t GetBWRegValueForScan() {
|
||||
return scanStepBWRegValues[settings.scanStepIndex];
|
||||
}
|
||||
|
||||
static void ResetRSSI() {
|
||||
uint32_t Reg = BK4819_ReadRegister(BK4819_REG_30);
|
||||
Reg &= ~1;
|
||||
BK4819_WriteRegister(BK4819_REG_30, Reg);
|
||||
Reg |= 1;
|
||||
BK4819_WriteRegister(BK4819_REG_30, Reg);
|
||||
}
|
||||
|
||||
uint16_t GetRssi() {
|
||||
uint16_t rssi;
|
||||
// SYSTICK_DelayUs(800);
|
||||
// testing autodelay based on Glitch value
|
||||
if(!isListening || glitchResetCounter > GLITCH_RESET_DELAY)
|
||||
{
|
||||
ResetRSSI();
|
||||
glitchResetCounter=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
glitchResetCounter++;
|
||||
}
|
||||
|
||||
// testing resolution to sticky squelch issue
|
||||
while (!isListening && (BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
|
||||
while ((BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
|
||||
SYSTICK_DelayUs(100);
|
||||
}
|
||||
rssi = BK4819_GetRSSI();
|
||||
@ -383,8 +405,8 @@ static void ToggleAudio(bool on) {
|
||||
static void ToggleRX(bool on) {
|
||||
isListening = on;
|
||||
|
||||
// turn on green led only if screen brightness set to max
|
||||
if(gEeprom.BACKLIGHT_MAX == 10)
|
||||
// turn on green led only if screen brightness is over 7
|
||||
if(gEeprom.BACKLIGHT_MAX > 7)
|
||||
BK4819_ToggleGpioOut(BK4819_GPIO6_PIN2_GREEN, on);
|
||||
|
||||
ToggleAudio(on);
|
||||
|
2
board.c
2
board.c
@ -603,7 +603,7 @@ void BOARD_EEPROM_Init(void)
|
||||
gEeprom.REPEATER_TAIL_TONE_ELIMINATION = (Data[2] < 11) ? Data[2] : 0;
|
||||
gEeprom.TX_VFO = (Data[3] < 2) ? Data[3] : 0;
|
||||
gEeprom.BATTERY_TYPE = (Data[4] < BATTERY_TYPE_UNKNOWN) ? Data[4] : BATTERY_TYPE_1600_MAH;
|
||||
gEeprom.SQL_TONE = (Data[5] < ARRAY_SIZE(CTCSS_Options)) ? Data[5] : 0;
|
||||
gEeprom.SQL_TONE = (Data[5] < ARRAY_SIZE(CTCSS_Options)) ? Data[5] : 50;
|
||||
// 0ED0..0ED7
|
||||
EEPROM_ReadBuffer(0x0ED0, Data, 8);
|
||||
gEeprom.DTMF_SIDE_TONE = (Data[0] < 2) ? Data[0] : true;
|
||||
|
7
dcs.c
7
dcs.c
@ -21,12 +21,13 @@
|
||||
#endif
|
||||
|
||||
// CTCSS Hz * 10
|
||||
const uint16_t CTCSS_Options[51] = {
|
||||
550, 670, 693, 719, 744, 770, 797, 825, 854, 885, 915,
|
||||
const uint16_t CTCSS_Options[55] = {
|
||||
670, 693, 719, 744, 770, 797, 825, 854, 885, 915,
|
||||
948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273,
|
||||
1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679,
|
||||
1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995,
|
||||
2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541
|
||||
2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541,
|
||||
550, 575, 600, 625, 650 // non standard values
|
||||
};
|
||||
|
||||
const uint16_t DCS_Options[104] = {
|
||||
|
2
dcs.h
2
dcs.h
@ -34,7 +34,7 @@ enum {
|
||||
CDCSS_NEGATIVE_CODE = 2U,
|
||||
};
|
||||
|
||||
extern const uint16_t CTCSS_Options[51];
|
||||
extern const uint16_t CTCSS_Options[55];
|
||||
extern const uint16_t DCS_Options[104];
|
||||
|
||||
uint32_t DCS_GetGolayCodeWord(DCS_CodeType_t CodeType, uint8_t Option);
|
||||
|
@ -572,7 +572,7 @@ void BK4819_EnableVox(uint16_t VoxEnableThreshold, uint16_t VoxDisableThreshold,
|
||||
// filter bandwidth lowers when signal is low
|
||||
const uint16_t listenBWRegDynamicValues[5] = {
|
||||
0x3428, // 25
|
||||
0x7B08, // 12.5
|
||||
0x3448, // 12.5
|
||||
0x4458, // 8.33
|
||||
0x1148, // 6.25
|
||||
0x0058 // 5
|
||||
@ -581,7 +581,7 @@ const uint16_t listenBWRegDynamicValues[5] = {
|
||||
// filter bandwidth stays the same when signal is low
|
||||
const uint16_t listenBWRegValues[5] = {
|
||||
0x3628, // 25
|
||||
0x7F08, // 12.5
|
||||
0x3648, // 12.5
|
||||
0x4858, // 8.33
|
||||
0x1348, // 6.25
|
||||
0x0058 // 5
|
||||
|
Loading…
Reference in New Issue
Block a user