From 62c58bd7222bb5c1479dc798b62f77b7f784e293 Mon Sep 17 00:00:00 2001
From: ChiehChun <chiehchun80348@gmail.com>
Date: Thu, 17 Dec 2020 17:40:11 +0100
Subject: [PATCH] Use correct pucch_index_used

---
 openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
index 5d3124fd6c1..83c5acedbf8 100644
--- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
+++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c
@@ -599,7 +599,7 @@ bool nr_acknack_scheduling(int mod_id,
   pucch->dai_c++;
   const int pucch_res = pucch_index_used[pucch->ul_slot];
   pucch->resource_indicator = pucch_res;
-  pucch_index_used[first_ul_slot_tdd] += 1;
+  pucch_index_used[pucch->ul_slot] += 1;
 
   /* verify that at that slot and symbol, resources are free. We only do this
    * for initialCyclicShift 0 (we assume it always has that one), so other
@@ -612,7 +612,7 @@ bool nr_acknack_scheduling(int mod_id,
     const uint16_t symb = 1 << resource->format.choice.format0->startingSymbolIndex;
     AssertFatal((vrb_map_UL[resource->startingPRB] & symb) == 0,
                 "symbol %x is not free for PUCCH alloc in vrb_map_UL at RB %ld and slot %d\n",
-                symb, resource->startingPRB, first_ul_slot_tdd);
+                symb, resource->startingPRB, pucch->ul_slot);
     vrb_map_UL[resource->startingPRB] |= symb;
   }
   return true;
-- 
GitLab