Skip to content

Commit

Permalink
重构
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Jan 30, 2024
1 parent 91fc4b2 commit c0f71c8
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static void HandleReceive(void)

uint8_t Mode = END_OF_RX_MODE_SKIP;

if (gFlagTailNoteEliminationComplete)
if (gFlagTailToneEliminationComplete)
{
Mode = END_OF_RX_MODE_END;
goto Skip;
Expand Down Expand Up @@ -414,8 +414,8 @@ static void HandleReceive(void)
{
AUDIO_AudioPathOff();

gTailNoteEliminationCountdown_10ms = 20;
gFlagTailNoteEliminationComplete = false;
gTailToneEliminationCountdown_10ms = 20;
gFlagTailToneEliminationComplete = false;
gEndOfRxDetectedMaybe = true;
gEnableSpeaker = false;
}
Expand Down
4 changes: 2 additions & 2 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ void BK4819_GenTail(uint8_t Tail)
}
}

void BK4819_EnableCDCSS(void)
void BK4819_PlayCDCSSTail(void)
{
BK4819_GenTail(0); // CTC134
//亚音
Expand All @@ -1470,7 +1470,7 @@ void BK4819_EnableCDCSS(void)

}

void BK4819_EnableCTCSS(void)
void BK4819_PlayCTCSSTail(void)
{
#ifdef ENABLE_CTCSS_TAIL_PHASE_SHIFT
//BK4819_GenTail(1); // 120° phase shift
Expand Down
4 changes: 2 additions & 2 deletions driver/bk4819.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ void BK4819_PlayDTMFString(const char *pString, bool bDelayFirst, uint16_t F
void BK4819_TransmitTone(bool bLocalLoopback, uint32_t Frequency);

void BK4819_GenTail(uint8_t Tail);
void BK4819_EnableCDCSS(void);
void BK4819_EnableCTCSS(void);
void BK4819_PlayCDCSSTail(void);
void BK4819_PlayCTCSSTail(void);

uint16_t BK4819_GetRSSI(void);
uint8_t BK4819_GetGlitchIndicator(void);
Expand Down
4 changes: 2 additions & 2 deletions functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ void FUNCTION_Init(void)

g_SquelchLost = false;

gFlagTailNoteEliminationComplete = false;
gTailNoteEliminationCountdown_10ms = 0;
gFlagTailToneEliminationComplete = false;
gTailToneEliminationCountdown_10ms = 0;
gFoundCTCSS = false;
gFoundCDCSS = false;
gFoundCTCSSCountdown_10ms = 0;
Expand Down
4 changes: 2 additions & 2 deletions misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ volatile bool gNextTimeslice_500ms;
volatile uint16_t gTxTimerCountdown_500ms;
volatile bool gTxTimeoutReached;

volatile uint16_t gTailNoteEliminationCountdown_10ms;
volatile uint16_t gTailToneEliminationCountdown_10ms;

volatile uint8_t gVFOStateResumeCountdown_500ms;

Expand Down Expand Up @@ -239,7 +239,7 @@ volatile bool gNextTimeslice40ms;
volatile uint16_t gNOAACountdown_10ms = 0;
volatile bool gScheduleNOAA = true;
#endif
volatile bool gFlagTailNoteEliminationComplete;
volatile bool gFlagTailToneEliminationComplete;
#ifdef ENABLE_FMRADIO
volatile bool gScheduleFM;
#endif
Expand Down
4 changes: 2 additions & 2 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ extern volatile bool gNextTimeslice_500ms;
extern volatile uint16_t gTxTimerCountdown_500ms;
extern volatile bool gTxTimeoutReached;

extern volatile uint16_t gTailNoteEliminationCountdown_10ms;
extern volatile uint16_t gTailToneEliminationCountdown_10ms;

#ifdef ENABLE_FMRADIO
extern volatile uint16_t gFmPlayCountdown_10ms;
Expand Down Expand Up @@ -319,7 +319,7 @@ extern volatile bool gNextTimeslice40ms;
extern volatile uint16_t gNOAACountdown_10ms;
extern volatile bool gScheduleNOAA;
#endif
extern volatile bool gFlagTailNoteEliminationComplete;
extern volatile bool gFlagTailToneEliminationComplete;
extern volatile uint8_t gVFOStateResumeCountdown_500ms;
#ifdef ENABLE_FMRADIO
extern volatile bool gScheduleFM;
Expand Down
4 changes: 2 additions & 2 deletions radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,10 +1069,10 @@ void RADIO_EnableCxCSS(void)
switch (gCurrentVfo->pTX->CodeType) {
case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
BK4819_EnableCDCSS();
BK4819_PlayCDCSSTail();
break;
default:
BK4819_EnableCTCSS();
BK4819_PlayCTCSSTail();
break;
}

Expand Down
2 changes: 1 addition & 1 deletion scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ void SystickHandler(void)
if (gCurrentFunction != FUNCTION_MONITOR && gCurrentFunction != FUNCTION_TRANSMIT)
DECREMENT_AND_TRIGGER(gScanPauseDelayIn_10ms, gScheduleScanListen);

DECREMENT_AND_TRIGGER(gTailNoteEliminationCountdown_10ms, gFlagTailNoteEliminationComplete);
DECREMENT_AND_TRIGGER(gTailToneEliminationCountdown_10ms, gFlagTailToneEliminationComplete);

#ifdef ENABLE_VOICE
DECREMENT_AND_TRIGGER(gCountdownToPlayNextVoice_10ms, gFlagPlayQueuedVoice);
Expand Down

0 comments on commit c0f71c8

Please sign in to comment.