Skip to content

Commit

Permalink
Merge remote-tracking branch 'DualTachyon/main' into community-main
Browse files Browse the repository at this point in the history
# Conflicts:
#	driver/bk4819.c
  • Loading branch information
reppad committed Nov 23, 2023
2 parents aad2915 + e51115b commit c424633
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static void TuneNOAA(void)
BK4819_SetSquelchGlitch(false);
BK4819_SetSquelchNoise(false);
BK4819_SetSquelchRSSI(false);
BK4819_EnableScramble(false);
BK4819_EnableScramble(0);
BK4819_EnableCompander(false);
BK4819_EnableRX();
BK4819_SetFilterBandwidth(false);
Expand Down
12 changes: 6 additions & 6 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,14 @@ void BK4819_EnableFilter(bool bEnable)
BK4819_WriteRegister(0x33, Value);
}

void BK4819_EnableScramble(bool bIsNarrow)
void BK4819_EnableScramble(uint8_t Scramble)
{
uint16_t Value;

BK4819_WriteRegister(0x71, 0x68DC | (bIsNarrow ? 0x0400 : 0x0000));
BK4819_WriteRegister(0x71, 0x68DC | (Scramble * 1032));

Value = BK4819_ReadRegister(0x31);
if (bIsNarrow) {
if (Scramble) {
Value |= 2;
} else {
Value &= ~2;
Expand Down Expand Up @@ -496,10 +496,10 @@ void BK4819_StartAudio(void)
BK4819_WriteRegister(0x4D, 0xA080);
BK4819_WriteRegister(0x4E, 0x6F7C);
}

if (gMainVfo->gModulationType > 0) {
// AM, SSB
BK4819_EnableScramble(false);
BK4819_EnableScramble(0);
BK4819_EnableCompander(false);
// Set bit 4 of register 73 (Auto Frequency Control Disable)
uint16_t reg_73 = BK4819_ReadRegister(0x73);
Expand Down Expand Up @@ -593,7 +593,7 @@ void BK4819_EnableTone1(bool bEnable)
} else {
OpenAudio(gMainVfo->bIsNarrow, gMainVfo->gModulationType);
if (gMainVfo->gModulationType > 0) {
BK4819_EnableScramble(false); // AM, SSB
BK4819_EnableScramble(0); // AM, SSB
} else {
BK4819_EnableScramble(gMainVfo->Scramble); // FM
}
Expand Down
2 changes: 1 addition & 1 deletion driver/bk4819.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void BK4819_ToggleAGCMode(bool bAuto);
void BK4819_RestoreGainSettings();
void BK4819_SetFilterBandwidth(bool bIsNarrow);
void BK4819_EnableFilter(bool bEnable);
void BK4819_EnableScramble(bool bIsNarrow);
void BK4819_EnableScramble(uint8_t Scramble);
void BK4819_EnableCompander(bool bIsNarrow);
void BK4819_EnableVox(bool bEnable);
void BK4819_SetToneFrequency(bool Tone2, uint16_t Tone);
Expand Down

0 comments on commit c424633

Please sign in to comment.