preventing crash caused by negative absolute slot RX value
This commit is contained in:
@@ -117,7 +117,10 @@ static void tx_func(void *param)
|
|||||||
int slot_rx = info->slot_rx;
|
int slot_rx = info->slot_rx;
|
||||||
int absslot_tx = info->timestamp_tx / info->gNB->frame_parms.get_samples_per_slot(slot_tx, &info->gNB->frame_parms);
|
int absslot_tx = info->timestamp_tx / info->gNB->frame_parms.get_samples_per_slot(slot_tx, &info->gNB->frame_parms);
|
||||||
int absslot_rx = absslot_tx - info->gNB->RU_list[0]->sl_ahead;
|
int absslot_rx = absslot_tx - info->gNB->RU_list[0]->sl_ahead;
|
||||||
|
if (absslot_rx < 0) {
|
||||||
|
LOG_W(NR_PHY, "Slot ahead %d is larger than absslot_tx %d. Cannot start TX yet.\n", info->gNB->RU_list[0]->sl_ahead, absslot_tx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
LOG_D(NR_PHY, "%d.%d running tx_func\n", frame_tx, slot_tx);
|
LOG_D(NR_PHY, "%d.%d running tx_func\n", frame_tx, slot_tx);
|
||||||
PHY_VARS_gNB *gNB = info->gNB;
|
PHY_VARS_gNB *gNB = info->gNB;
|
||||||
module_id_t module_id = gNB->Mod_id;
|
module_id_t module_id = gNB->Mod_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user