Skip to content

Commit

Permalink
Simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
JuantAldea authored and wutje committed Jan 1, 2024
1 parent ab29829 commit 15f736a
Showing 1 changed file with 13 additions and 32 deletions.
45 changes: 13 additions & 32 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,42 +252,23 @@ static void HandleReceive(void)
goto Skip;
}

switch (gCurrentCodeType)
{
default:
case CODE_TYPE_OFF:
break;

case CODE_TYPE_CONTINUOUS_TONE:
if (gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0)
{
gFoundCTCSS = false;
gFoundCDCSS = false;
Mode = END_OF_RX_MODE_END;
goto Skip;
}
break;

case CODE_TYPE_DIGITAL:
case CODE_TYPE_REVERSE_DIGITAL:
if (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0)
{
gFoundCTCSS = false;
gFoundCDCSS = false;
Mode = END_OF_RX_MODE_END;
goto Skip;
}
break;
if (gCurrentCodeType != CODE_TYPE_OFF
&& ((gFoundCTCSS && gFoundCTCSSCountdown_10ms == 0)
|| (gFoundCDCSS && gFoundCDCSSCountdown_10ms == 0))
){
gFoundCTCSS = false;
gFoundCDCSS = false;
Mode = END_OF_RX_MODE_END;
goto Skip;
}

if (g_SquelchLost)
{
#ifdef ENABLE_NOAA
if (!gEndOfRxDetectedMaybe && !IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE))
#else
if (!gEndOfRxDetectedMaybe)
#endif
{
if (!gEndOfRxDetectedMaybe
#ifdef ENABLE_NOAA
&& !IS_NOAA_CHANNEL(gRxVfo->CHANNEL_SAVE)
#endif
){
switch (gCurrentCodeType)
{
case CODE_TYPE_OFF:
Expand Down

0 comments on commit 15f736a

Please sign in to comment.