rx: signal busy as long as squelch is open

This commit is contained in:
Thomas Kolb 2024-04-26 21:47:41 +02:00
parent 90ed7dc0a8
commit d3b0ac1e0a

View file

@ -191,6 +191,27 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i
return result;
}
static bool is_squelch_open(const layer1_rx_t *rx)
{
bool result = false;
switch(agc_crcf_squelch_get_status(rx->agc)) {
case LIQUID_AGC_SQUELCH_RISE:
case LIQUID_AGC_SQUELCH_SIGNALHI:
result = true;
break;
case LIQUID_AGC_SQUELCH_FALL:
case LIQUID_AGC_SQUELCH_SIGNALLO:
case LIQUID_AGC_SQUELCH_ENABLED:
case LIQUID_AGC_SQUELCH_TIMEOUT:
result = false;
break;
}
return result;
}
result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t sample_count)
{
@ -512,7 +533,7 @@ result_t layer1_rx_shutdown(layer1_rx_t *rx)
bool layer1_rx_is_busy(const layer1_rx_t *rx)
{
return rx->state != RX_STATE_ACQUISITION;
return is_squelch_open(rx);
}