Skip to content

Commit

Permalink
DCS inversion fix (actual fix)
Browse files Browse the repository at this point in the history
Fix for #63
  • Loading branch information
xawen committed Mar 15, 2024
1 parent 73a5466 commit 6b03bdc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,15 @@ void BK4819_SetSquelchGlitch(bool bIsNarrow)
Value = gExtendedSettings.SqGlitchBase - (gSettings.Squelch);
}

BK4819_WriteRegister(0x4E, (BK4819_ReadRegister(0x4E) & 0xFF) | Value);
BK4819_WriteRegister(0x4E, (BK4819_ReadRegister(0x4E) & 0xFF00) | Value);

if (gSettings.Squelch == 0 || gExtendedSettings.SqGlitchBase > 230){
Value = 255;
} else {
Value = (Value * 10) / 9;
}

BK4819_WriteRegister(0x4D, (BK4819_ReadRegister(0x4D) & 0xFF) | Value);
BK4819_WriteRegister(0x4D, 0xA0 << 8 | Value);
#else

static const uint8_t gSquelchGlitchLevel[11] = {
Expand Down Expand Up @@ -360,7 +360,7 @@ void BK4819_SetSquelchNoise(bool bIsNarrow)
}
}

BK4819_WriteRegister(0x4F, (BK4819_ReadRegister(0x4F) & 0x7F7F) | Value);
BK4819_WriteRegister(0x4F, Value);

#else

Expand Down
4 changes: 2 additions & 2 deletions task/rssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ static uint8_t GetToneStatus(uint8_t CodeType, bool bMuteEnabled)
}

// Check DCS N
if (Value & 0x4000U && (CodeType == CODE_TYPE_DCS_I || bMuteEnabled)) {
if (Value & 0x4000U && (CodeType == CODE_TYPE_DCS_N || bMuteEnabled)) {
return STATUS_GOT_TONE;
}

// Check DCS I
if (Value & 0x8000U && CodeType == CODE_TYPE_DCS_N) {
if (Value & 0x8000U && CodeType == CODE_TYPE_DCS_I) {
return STATUS_GOT_TONE;
}

Expand Down

0 comments on commit 6b03bdc

Please sign in to comment.