From 2ae900a88fbe43f61a509ff6f9e3559833cc5b8c Mon Sep 17 00:00:00 2001 From: Dual Tachyon Date: Thu, 7 Sep 2023 19:47:26 +0100 Subject: [PATCH] Renamed Index to Code. --- app/app.c | 20 ++++++++++---------- app/scanner.c | 10 +++++----- app/scanner.h | 2 +- dcs.c | 4 ++-- dcs.h | 4 ++-- ui/scanner.c | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/app.c b/app/app.c index cbc6729..993c318 100644 --- a/app/app.c +++ b/app/app.c @@ -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) { diff --git a/app/scanner.c b/app/scanner.c index e3f043c..24d694a 100644 --- a/app/scanner.c +++ b/app/scanner.c @@ -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; diff --git a/app/scanner.h b/app/scanner.h index fd45d32..c5f5086 100644 --- a/app/scanner.h +++ b/app/scanner.h @@ -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; diff --git a/dcs.c b/dcs.c index 1fd5619..9591816 100644 --- a/dcs.c +++ b/dcs.c @@ -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; diff --git a/dcs.h b/dcs.h index 26702de..08db2bf 100644 --- a/dcs.h +++ b/dcs.h @@ -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 diff --git a/ui/scanner.c b/ui/scanner.c index 835015a..2d6ec2e 100644 --- a/ui/scanner.c +++ b/ui/scanner.c @@ -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));