mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 06:39:49 +03:00
Stopped user tuning into the 630MHz to 757MHz range - the BK4819 chip does not work there.
This commit is contained in:
15
app/app.c
15
app/app.c
@ -497,6 +497,8 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
||||
gUpdateStatus = true;
|
||||
}
|
||||
|
||||
// ******************************************
|
||||
|
||||
// original setting
|
||||
uint8_t lna_short = orig_lna_short;
|
||||
uint8_t lna = orig_lna;
|
||||
@ -505,7 +507,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
||||
|
||||
if (gRxVfo->IsAM)
|
||||
{ // AM
|
||||
|
||||
/*
|
||||
#ifndef ENABLE_AM_FIX
|
||||
const uint32_t rx_frequency = gRxVfo->pRX->Frequency;
|
||||
|
||||
@ -526,7 +528,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
||||
pga = 7; // 6 original, 7 increased
|
||||
}
|
||||
#endif
|
||||
|
||||
*/
|
||||
// what do these 4 other gain settings do ???
|
||||
//BK4819_WriteRegister(BK4819_REG_12, 0x037B); // 000000 11 011 11 011
|
||||
//BK4819_WriteRegister(BK4819_REG_11, 0x027B); // 000000 10 011 11 011
|
||||
@ -539,6 +541,8 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
||||
// apply the front end gain settings
|
||||
BK4819_WriteRegister(BK4819_REG_13, ((uint16_t)lna_short << 8) | ((uint16_t)lna << 5) | ((uint16_t)mixer << 3) | ((uint16_t)pga << 0));
|
||||
|
||||
// ******************************************
|
||||
|
||||
// AF gain - original
|
||||
BK4819_WriteRegister(BK4819_REG_48,
|
||||
(11u << 12) | // ??? .. 0 to 15, doesn't seem to make any difference
|
||||
@ -566,7 +570,7 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
|
||||
gUpdateDisplay = true;
|
||||
}
|
||||
|
||||
void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
|
||||
uint32_t APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
|
||||
{
|
||||
uint32_t Frequency = pInfo->freq_config_RX.Frequency + (Step * pInfo->StepFrequency);
|
||||
|
||||
@ -589,12 +593,12 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
|
||||
if (Frequency < LowerLimitFrequencyBandTable[pInfo->Band])
|
||||
Frequency = FREQUENCY_FloorToStep(UpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, LowerLimitFrequencyBandTable[pInfo->Band]);
|
||||
|
||||
pInfo->freq_config_RX.Frequency = Frequency;
|
||||
return Frequency;
|
||||
}
|
||||
|
||||
static void FREQ_NextChannel(void)
|
||||
{
|
||||
APP_SetFrequencyByStep(gRxVfo, gScanState);
|
||||
gRxVfo->freq_config_RX.Frequency = APP_SetFrequencyByStep(gRxVfo, gScanState);
|
||||
|
||||
RADIO_ApplyOffset(gRxVfo);
|
||||
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);
|
||||
@ -1206,6 +1210,7 @@ void APP_CheckKeys(void)
|
||||
while (i-- > 0)
|
||||
{
|
||||
SYSTEM_DelayMs(1);
|
||||
|
||||
if (!GPIO_CheckBit(&GPIOC->DATA, GPIOC_PIN_PTT))
|
||||
{ // PTT pressed
|
||||
if (count > 0)
|
||||
|
16
app/app.h
16
app/app.h
@ -18,17 +18,17 @@
|
||||
#define APP_APP_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "functions.h"
|
||||
#include "radio.h"
|
||||
|
||||
void APP_EndTransmission(void);
|
||||
void CHANNEL_Next(bool bFlag, int8_t Direction);
|
||||
void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix);
|
||||
void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step);
|
||||
|
||||
void APP_Update(void);
|
||||
void APP_TimeSlice10ms(void);
|
||||
void APP_TimeSlice500ms(void);
|
||||
void APP_EndTransmission(void);
|
||||
void CHANNEL_Next(bool bFlag, int8_t Direction);
|
||||
void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix);
|
||||
uint32_t APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step);
|
||||
void APP_Update(void);
|
||||
void APP_TimeSlice10ms(void);
|
||||
void APP_TimeSlice500ms(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
49
app/main.c
49
app/main.c
@ -294,7 +294,8 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
|
||||
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{
|
||||
{ // user is entering channel number
|
||||
|
||||
uint16_t Channel;
|
||||
|
||||
if (gInputBoxIndex != 3)
|
||||
@ -319,17 +320,20 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
gEeprom.MrChannel[Vfo] = (uint8_t)Channel;
|
||||
gEeprom.ScreenChannel[Vfo] = (uint8_t)Channel;
|
||||
gRequestSaveVFO = true;
|
||||
gVfoConfigureMode = VFO_CONFIGURE_RELOAD;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_NOAA
|
||||
if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
#endif
|
||||
{
|
||||
// #ifdef ENABLE_NOAA
|
||||
// if (IS_NOT_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
// #endif
|
||||
if (IS_FREQ_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{ // user is entering frequency
|
||||
uint32_t Frequency;
|
||||
|
||||
if (gInputBoxIndex < 6)
|
||||
@ -337,6 +341,7 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
#ifdef ENABLE_VOICE
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -344,7 +349,16 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
|
||||
NUMBER_Get(gInputBox, &Frequency);
|
||||
|
||||
if (gSetting_350EN || Frequency < 35000000 || Frequency >= 40000000)
|
||||
// if (Frequency < bx_start1_Hz || Frequency >= bx_stop2_Hz)
|
||||
// { // the BK4819 chip does not do this frequency range
|
||||
// }
|
||||
// else
|
||||
// if (Frequency >= bx_stop1_Hz && Frequency < bx_start2_Hz)
|
||||
// { // the BK4819 chip does not do this frequency range
|
||||
// }
|
||||
// else
|
||||
// if (gSetting_350EN || Frequency < 35000000 || Frequency >= 40000000)
|
||||
if (RX_FREQUENCY_Check(Frequency) == 0)
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < 7; i++)
|
||||
@ -376,10 +390,13 @@ static void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef ENABLE_NOAA
|
||||
else
|
||||
{
|
||||
if (IS_NOAA_CHANNEL(gTxVfo->CHANNEL_SAVE))
|
||||
{ // user is entering NOAA channel
|
||||
|
||||
uint8_t Channel;
|
||||
|
||||
if (gInputBoxIndex != 2)
|
||||
@ -648,7 +665,7 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
|
||||
if (bKeyHeld || !bKeyPressed)
|
||||
{
|
||||
if (gInputBoxIndex)
|
||||
if (gInputBoxIndex > 0)
|
||||
return;
|
||||
|
||||
if (!bKeyPressed)
|
||||
@ -669,11 +686,12 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gInputBoxIndex)
|
||||
if (gInputBoxIndex > 0)
|
||||
{
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
|
||||
gBeepToPlay = BEEP_1KHZ_60MS_OPTIONAL;
|
||||
}
|
||||
|
||||
@ -686,8 +704,17 @@ static void MAIN_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
|
||||
uint8_t Next;
|
||||
|
||||
if (IS_FREQ_CHANNEL(Channel))
|
||||
{
|
||||
APP_SetFrequencyByStep(gTxVfo, Direction);
|
||||
{ // step/down in frequency
|
||||
const uint32_t frequency = APP_SetFrequencyByStep(gTxVfo, Direction);
|
||||
|
||||
if (RX_FREQUENCY_Check(frequency) < 0)
|
||||
{ // frequency not allowed
|
||||
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
|
||||
return;
|
||||
}
|
||||
|
||||
gTxVfo->freq_config_RX.Frequency = frequency;
|
||||
|
||||
gRequestSaveChannel = 1;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user