diff --git a/impl/src/layer1/rx.c b/impl/src/layer1/rx.c index d0fae51..1a4e30a 100644 --- a/impl/src/layer1/rx.c +++ b/impl/src/layer1/rx.c @@ -184,7 +184,7 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i float level = agc_crcf_get_rssi(rx->agc); enum squelch_state_t result = SQUELCH_CLOSED; - if((sample_idx & 0xFF) == 0) { // every 256 samples + if((sample_idx & 0x3F) == 0) { // every 64 samples if(level < rx->noise_floor_level) { rx->noise_floor_level = level; } else { @@ -197,7 +197,7 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i switch(agc_crcf_squelch_get_status(rx->agc)) { case LIQUID_AGC_SQUELCH_RISE: - DEBUG_LOG("Squelch disabled at #%u RSSI = %.3f dB [thr: %.3f dB]\n", sample_idx, level, agc_crcf_squelch_get_threshold(rx->agc)); + DEBUG_LOG("Squelch disabled at #%zu RSSI = %.3f dB [thr: %.3f dB]\n", rx->sample_index, level, agc_crcf_squelch_get_threshold(rx->agc)); result = SQUELCH_JUST_OPENED; break; @@ -206,7 +206,7 @@ static enum squelch_state_t update_and_check_squelch(layer1_rx_t *rx, unsigned i break; case LIQUID_AGC_SQUELCH_FALL: - DEBUG_LOG("Squelch enabled at #%u RSSI = %.3f dB [thr: %.3f dB]\n", sample_idx, level, agc_crcf_squelch_get_threshold(rx->agc)); + DEBUG_LOG("Squelch enabled at #%zu RSSI = %.3f dB [thr: %.3f dB]\n", rx->sample_index, level, agc_crcf_squelch_get_threshold(rx->agc)); // fall through case LIQUID_AGC_SQUELCH_SIGNALLO: case LIQUID_AGC_SQUELCH_ENABLED: