This commit is contained in:
@@ -66,12 +66,6 @@ void BACKLIGHT_InitHardware()
|
||||
0;
|
||||
}
|
||||
|
||||
static void BACKLIGHT_Sound(void)
|
||||
{
|
||||
gK5startup = false;
|
||||
}
|
||||
|
||||
|
||||
void BACKLIGHT_TurnOn(void)
|
||||
{
|
||||
#ifdef ENABLE_FEAT_F4HWN_SLEEP
|
||||
@@ -84,38 +78,11 @@ void BACKLIGHT_TurnOn(void)
|
||||
|
||||
if (gEeprom.BACKLIGHT_TIME == 0) {
|
||||
BACKLIGHT_TurnOff();
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if(gK5startup == true)
|
||||
{
|
||||
BACKLIGHT_Sound();
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
backlightOn = true;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if(gK5startup == true) {
|
||||
#if defined(ENABLE_FMRADIO) && defined(ENABLE_SPECTRUM)
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
#else
|
||||
for(uint8_t i = 0; i <= gEeprom.BACKLIGHT_MAX; i++)
|
||||
{
|
||||
BACKLIGHT_SetBrightness(i);
|
||||
SYSTEM_DelayMs(50);
|
||||
}
|
||||
#endif
|
||||
|
||||
BACKLIGHT_Sound();
|
||||
}
|
||||
else
|
||||
{
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
}
|
||||
#else
|
||||
BACKLIGHT_SetBrightness(gEeprom.BACKLIGHT_MAX);
|
||||
#endif
|
||||
|
||||
switch (gEeprom.BACKLIGHT_TIME) {
|
||||
default:
|
||||
|
@@ -48,6 +48,12 @@ __inline uint16_t scale_freq(uint16_t freq)
|
||||
return (((uint32_t)freq * 1353245u) + (1u << 16)) >> 17; // with rounding
|
||||
}
|
||||
|
||||
__inline uint16_t inverse_scale_freq(uint16_t scaled_freq)
|
||||
{
|
||||
return (((uint32_t)scaled_freq << 17) - (1u << 16)) / 1353245u;
|
||||
}
|
||||
|
||||
|
||||
void BK4819_FskEnableTx(void){
|
||||
const uint16_t fsk_reg59 = BK4819_ReadRegister(BK4819_REG_59);
|
||||
BK4819_WriteRegister(BK4819_REG_59, (1u << 11) | fsk_reg59);
|
||||
@@ -854,18 +860,18 @@ void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency)
|
||||
}
|
||||
}
|
||||
|
||||
void BK4819_DisableScramble(void)
|
||||
void BK4819_SetScramble(uint16_t Freq)
|
||||
{
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value & ~(1u << 1));
|
||||
}
|
||||
uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
if (Freq) {
|
||||
Value |= (1u << 1);
|
||||
} else {
|
||||
Value &= ~(1u << 1);
|
||||
}
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value);
|
||||
|
||||
void BK4819_EnableScramble(uint8_t Type)
|
||||
{
|
||||
const uint16_t Value = BK4819_ReadRegister(BK4819_REG_31);
|
||||
BK4819_WriteRegister(BK4819_REG_31, Value | (1u << 1));
|
||||
|
||||
BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Type * 1032)); // 0110 1000 1101 1100
|
||||
//BK4819_WriteRegister(BK4819_REG_71, 0x68DC + (Freq * 1032)); // 0110 1000 1101 1100
|
||||
BK4819_WriteRegister(BK4819_REG_71, Freq);
|
||||
}
|
||||
|
||||
bool BK4819_CompanderEnabled(void)
|
||||
|
@@ -65,6 +65,7 @@ typedef enum BK4819_CssScanResult_t BK4819_CssScanResult_t;
|
||||
// radio is asleep, not listening
|
||||
extern bool gRxIdleMode;
|
||||
|
||||
uint16_t inverse_scale_freq(uint16_t scaled_freq);
|
||||
uint16_t scale_freq(uint16_t freq);
|
||||
|
||||
void BK4819_Init(void);
|
||||
@@ -102,8 +103,7 @@ void BK4819_SetupSquelch(
|
||||
void BK4819_SetAF(BK4819_AF_Type_t AF);
|
||||
void BK4819_RX_TurnOn(void);
|
||||
void BK4819_PickRXFilterPathBasedOnFrequency(uint32_t Frequency);
|
||||
void BK4819_DisableScramble(void);
|
||||
void BK4819_EnableScramble(uint8_t Type);
|
||||
void BK4819_SetScramble(uint16_t Freq);
|
||||
|
||||
bool BK4819_CompanderEnabled(void);
|
||||
void BK4819_SetCompander(const unsigned int mode);
|
||||
|
Reference in New Issue
Block a user