From 540d918a09b5d3d7282c665c37eb920b7cc01fc4 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 16 Jan 2025 13:22:23 +0100 Subject: [PATCH] Detect double sync message and skip frames --- radio/fhi_72/oaioran.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radio/fhi_72/oaioran.c b/radio/fhi_72/oaioran.c index ef8e81dbc5..034035b4bc 100644 --- a/radio/fhi_72/oaioran.c +++ b/radio/fhi_72/oaioran.c @@ -280,6 +280,16 @@ int xran_fh_rx_read_slot(ru_info_t *ru, int *frame, int *slot) #ifndef USE_POLLING // pull next even from oran_sync_fifo notifiedFIFO_elt_t *res = pullNotifiedFIFO(&oran_sync_fifo); + + notifiedFIFO_elt_t *f; + while ((f = pollNotifiedFIFO(&oran_sync_fifo)) != NULL) { + oran_sync_info_t *old_info = NotifiedFifoData(res); + oran_sync_info_t *new_info = NotifiedFifoData(f); + LOG_E(PHY, "Detected double sync message %d.%d => %d.%d\n", old_info->f, old_info->sl, new_info->f, new_info->sl); + delNotifiedFIFO_elt(res); + res = f; + } + oran_sync_info_t *info = NotifiedFifoData(res); *slot = info->sl;