rx: add monotonic sample counter for debug messages

This commit is contained in:
Thomas Kolb 2024-05-25 18:15:23 +02:00
parent 0237ea6494
commit ca241f266b
2 changed files with 7 additions and 0 deletions

View file

@ -260,6 +260,8 @@ result_t layer1_rx_process(layer1_rx_t *rx, const float complex *samples, size_t
DEBUG_LOG("\nagc: %f\n", agc_crcf_get_gain(rx->agc)); DEBUG_LOG("\nagc: %f\n", agc_crcf_get_gain(rx->agc));
for(unsigned int i = 0; i < sample_count; i++) { for(unsigned int i = 0; i < sample_count; i++) {
rx->sample_index++;
rx_state_t last_state = rx->state; rx_state_t last_state = rx->state;
// Apply the AGC. // Apply the AGC.
@ -560,6 +562,8 @@ result_t layer1_rx_init(layer1_rx_t *rx, rx_callback_t callback)
var_array_cf_init(&rx->packet_debug_info.header_symbols); var_array_cf_init(&rx->packet_debug_info.header_symbols);
var_array_cf_init(&rx->packet_debug_info.data_symbols); var_array_cf_init(&rx->packet_debug_info.data_symbols);
rx->sample_index = 0;
reset_packet_debug_info(rx); reset_packet_debug_info(rx);
return OK; return OK;

View file

@ -73,6 +73,9 @@ typedef struct layer1_rx_s
uint16_t payload_len_enc_bytes; uint16_t payload_len_enc_bytes;
modcod_t modcod; modcod_t modcod;
// sample counter (for debug messages)
size_t sample_index;
// packet debugging information // packet debugging information
rx_packet_dbg_t packet_debug_info; rx_packet_dbg_t packet_debug_info;
} layer1_rx_t; } layer1_rx_t;