Renamed Index to Code.

This commit is contained in:
Dual Tachyon 2023-09-07 19:47:26 +01:00
parent d264899cdf
commit 2ae900a88f
6 changed files with 22 additions and 22 deletions

View File

@ -930,7 +930,7 @@ void APP_TimeSlice10ms(void)
BK4819_EnableFrequencyScan();
} else {
BK4819_SetScanFrequency(gScanFrequency);
gScanCssResultIndex = 0xFF;
gScanCssResultCode = 0xFF;
gScanCssResultType = 0xFF;
gScanHitCount = 0;
gScanUseCssResult = false;
@ -948,21 +948,21 @@ void APP_TimeSlice10ms(void)
}
BK4819_Disable();
if (ScanResult == BK4819_CSS_RESULT_CDCSS) {
uint8_t Index;
uint8_t Code;
Index = DCS_GetCdcssIndex(Result);
if (Index != 0xFF) {
gScanCssResultIndex = Index;
Code = DCS_GetCdcssCode(Result);
if (Code != 0xFF) {
gScanCssResultCode = Code;
gScanCssResultType = CODE_TYPE_DIGITAL;
gScanCssState = SCAN_CSS_STATE_FOUND;
gScanUseCssResult = true;
}
} else if (ScanResult == BK4819_CSS_RESULT_CTCSS) {
uint8_t Index;
uint8_t Code;
Index = DCS_GetCtcssIndex(CtcssFreq);
if (Index != 0xFF) {
if (Index == gScanCssResultIndex && gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE) {
Code = DCS_GetCtcssCode(CtcssFreq);
if (Code != 0xFF) {
if (Code == gScanCssResultCode && gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE) {
gScanHitCount++;
if (gScanHitCount >= 2) {
gScanCssState = SCAN_CSS_STATE_FOUND;
@ -972,7 +972,7 @@ void APP_TimeSlice10ms(void)
gScanHitCount = 0;
}
gScanCssResultType = CODE_TYPE_CONTINUOUS_TONE;
gScanCssResultIndex = Index;
gScanCssResultCode = Code;
}
}
if (gScanCssState < SCAN_CSS_STATE_FOUND) {

View File

@ -26,7 +26,7 @@
#include "ui/ui.h"
DCS_CodeType_t gScanCssResultType;
uint8_t gScanCssResultIndex;
uint8_t gScanCssResultCode;
bool gFlagStartScan;
bool gFlagStopScan;
bool gScanSingleFrequency;
@ -185,7 +185,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
RADIO_InitInfo(gTxVfo, gTxVfo->CHANNEL_SAVE, FREQUENCY_GetBand(gScanFrequency), gScanFrequency);
if (gScanUseCssResult) {
gTxVfo->ConfigRX.CodeType = gScanCssResultType;
gTxVfo->ConfigRX.Code = gScanCssResultIndex;
gTxVfo->ConfigRX.Code = gScanCssResultCode;
}
gTxVfo->ConfigTX = gTxVfo->ConfigRX;
gTxVfo->STEP_SETTING = gStepSetting;
@ -193,9 +193,9 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
RADIO_ConfigureChannel(0, 2);
RADIO_ConfigureChannel(1, 2);
gTxVfo->ConfigRX.CodeType = gScanCssResultType;
gTxVfo->ConfigRX.Code = gScanCssResultIndex;
gTxVfo->ConfigRX.Code = gScanCssResultCode;
gTxVfo->ConfigTX.CodeType = gScanCssResultType;
gTxVfo->ConfigTX.Code = gScanCssResultIndex;
gTxVfo->ConfigTX.Code = gScanCssResultCode;
}
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE)) {
@ -320,7 +320,7 @@ void SCANNER_Start(void)
BK4819_EnableFrequencyScan();
}
gScanDelay = 21;
gScanCssResultIndex = 0xFF;
gScanCssResultCode = 0xFF;
gScanCssResultType = 0xFF;
gScanHitCount = 0;
gScanUseCssResult = false;

View File

@ -34,7 +34,7 @@ enum {
};
extern DCS_CodeType_t gScanCssResultType;
extern uint8_t gScanCssResultIndex;
extern uint8_t gScanCssResultCode;
extern bool gFlagStartScan;
extern bool gFlagStopScan;
extern bool gScanSingleFrequency;

4
dcs.c
View File

@ -90,7 +90,7 @@ uint32_t DCS_GetGolayCodeWord(DCS_CodeType_t CodeType, uint8_t Option)
return Code;
}
uint8_t DCS_GetCdcssIndex(uint32_t Code)
uint8_t DCS_GetCdcssCode(uint32_t Code)
{
uint8_t i;
@ -118,7 +118,7 @@ uint8_t DCS_GetCdcssIndex(uint32_t Code)
return 0xFF;
}
uint8_t DCS_GetCtcssIndex(uint16_t Code)
uint8_t DCS_GetCtcssCode(uint16_t Code)
{
uint8_t i;
int Smallest;

4
dcs.h
View File

@ -37,8 +37,8 @@ extern const uint16_t CTCSS_Options[50];
extern const uint16_t DCS_Options[104];
uint32_t DCS_GetGolayCodeWord(DCS_CodeType_t CodeType, uint8_t Option);
uint8_t DCS_GetCdcssIndex(uint32_t Code);
uint8_t DCS_GetCtcssIndex(uint16_t Code);
uint8_t DCS_GetCdcssCode(uint32_t Code);
uint8_t DCS_GetCtcssCode(uint16_t Code);
#endif

View File

@ -44,9 +44,9 @@ void UI_DisplayScanner(void)
if (gScanCssState < SCAN_CSS_STATE_FOUND || !gScanUseCssResult) {
sprintf(String, "CTC:******");
} else if (gScanCssResultType == CODE_TYPE_CONTINUOUS_TONE) {
sprintf(String, "CTC:%.1fHz", CTCSS_Options[gScanCssResultIndex] * 0.1);
sprintf(String, "CTC:%.1fHz", CTCSS_Options[gScanCssResultCode] * 0.1);
} else {
sprintf(String, "DCS:D%03oN", DCS_Options[gScanCssResultIndex]);
sprintf(String, "DCS:D%03oN", DCS_Options[gScanCssResultCode]);
}
UI_PrintString(String, 2, 127, 3, 8, 0);
memset(String, 0, sizeof(String));