Reset outdated PUCCHs to avoid Assertion caused by non-processed and active PUCCHs

When there is real-time issues in L1 it may happen that the scheduler misses/skips some slots, thus, L2 not processing and not freeing some structures like PUCCH.
This commit avoids the Assertion by resetting any Active outdated PUCCH
This commit is contained in:
luis_pereira87
2025-12-12 16:48:24 +00:00
parent 479be40b30
commit 71e23b12c2
@@ -280,7 +280,10 @@ void nr_csi_meas_reporting(int Mod_idP,frame_t frame, slot_t slot)
const int pucch_index = get_pucch_index(sched_frame, sched_slot, &nrmac->frame_structure, sched_ctrl->sched_pucch_size);
NR_sched_pucch_t *curr_pucch = &sched_ctrl->sched_pucch[pucch_index];
AssertFatal(curr_pucch->active == false, "CSI structure is scheduled in advance. It should be free!\n");
if (curr_pucch->active) {
LOG_E(NR_MAC, "CSI structure is scheduled in advance. It should be free!\n");
memset(curr_pucch, 0, sizeof(*curr_pucch));
}
curr_pucch->r_pucch = -1;
curr_pucch->frame = sched_frame;
curr_pucch->ul_slot = sched_slot;