Skip to content

Commit

Permalink
Merge pull request #89 from kamilsss655/rc19.9
Browse files Browse the repository at this point in the history
Rc19.9
  • Loading branch information
kamilsss655 authored Jan 21, 2024
2 parents 12bf25a + b6ac7a2 commit 9927294
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 40 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ ENABLE_KEEP_MEM_NAME := 1
ENABLE_WIDE_RX := 1
ENABLE_TX_WHEN_AM := 0
ENABLE_F_CAL_MENU := 0
ENABLE_BOOT_BEEPS := 0
ENABLE_SHOW_CHARGE_LEVEL := 1
ENABLE_SHOW_CHARGE_LEVEL := 0
ENABLE_REVERSE_BAT_SYMBOL := 0
ENABLE_NO_CODE_SCAN_TIMEOUT := 1
ENABLE_SQUELCH_MORE_SENSITIVE := 0
Expand Down Expand Up @@ -303,9 +302,6 @@ endif
ifeq ($(ENABLE_F_CAL_MENU),1)
CFLAGS += -DENABLE_F_CAL_MENU
endif
ifeq ($(ENABLE_BOOT_BEEPS),1)
CFLAGS += -DENABLE_BOOT_BEEPS
endif
ifeq ($(ENABLE_SHOW_CHARGE_LEVEL),1)
CFLAGS += -DENABLE_SHOW_CHARGE_LEVEL
endif
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)sav
ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range)
ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM
ENABLE_F_CAL_MENU := 0 enable the radios hidden frequency calibration menu
ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up
ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge
ENABLE_SHOW_CHARGE_LEVEL := 0 show the charge level when the radio is on charge
ENABLE_REVERSE_BAT_SYMBOL := 0 mirror the battery symbol on the status bar (+ pole on the right)
ENABLE_NO_CODE_SCAN_TIMEOUT := 1 disable 32-sec CTCSS/DCS scan timeout (press exit butt instead of time-out to end scan)
ENABLE_SQUELCH_MORE_SENSITIVE := 0 make squelch levels a little bit more sensitive - this has been reported to cause radio freeze in presence of strong signals
Expand Down
6 changes: 0 additions & 6 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,12 +1150,6 @@ void APP_TimeSlice10ms(void)
keyTickCounter++;
#endif

#ifdef ENABLE_BOOT_BEEPS
if (boot_counter_10ms > 0)
if ((boot_counter_10ms % 25) == 0)
AUDIO_PlayBeep(BEEP_880HZ_40MS_OPTIONAL);
#endif

if (UART_IsCommandAvailable())
{
__disable_irq();
Expand Down
33 changes: 6 additions & 27 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ bool isBlacklistApplied;
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;
Expand Down Expand Up @@ -360,29 +354,13 @@ static void DeInitSpectrum() {
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);
// 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 ((BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
SYSTICK_DelayUs(100);
}
Expand Down Expand Up @@ -427,18 +405,19 @@ static void ToggleRX(bool on) {
ToggleAFDAC(on);
ToggleAFBit(on);

if (on) {
if (on)
{
listenT = SQUELCH_OFF_DELAY;
BK4819_SetFilterBandwidth(settings.listenBw, false);

gTailFound=false;

// turn on CSS tail found interrupt
BK4819_WriteRegister(BK4819_REG_3F, BK4819_REG_02_CxCSS_TAIL);
} else {
} else
{
if(appMode!=CHANNEL_MODE)
BK4819_WriteRegister(0x43, GetBWRegValueForScan());
isListening = false;
}
}

Expand Down

0 comments on commit 9927294

Please sign in to comment.