proc_phr: rename start_periodic_timer() and make sure its only started if a valid config is present

This commit is contained in:
Andre Puschmann 2020-10-07 15:06:33 +02:00
parent fab86382c1
commit 937067a205
3 changed files with 9 additions and 6 deletions

View File

@ -44,7 +44,7 @@ public:
bool is_extended();
void timer_expired(uint32_t timer_id);
void start_timer();
void start_periodic_timer();
private:
bool pathloss_changed();

View File

@ -515,10 +515,10 @@ void mac::new_grant_ul(uint32_t cc_idx,
mac_interface_phy_lte::mac_grant_ul_t grant,
mac_interface_phy_lte::tb_action_ul_t* action)
{
/* Start PHR Periodic timer on first UL dci */
// Start PHR Periodic timer on first UL DCI (See TS 36.321 Sec 5.4.6)
if (is_first_ul_grant) {
is_first_ul_grant = false;
phr_procedure.start_timer();
phr_procedure.start_periodic_timer();
}
// Assert UL HARQ entity

View File

@ -100,16 +100,19 @@ bool phr_proc::pathloss_changed()
}
}
void phr_proc::start_timer()
void phr_proc::start_periodic_timer()
{
timer_periodic.run();
if (phr_cfg.enabled && phr_cfg.periodic_timer > 0) {
timer_periodic.run();
}
}
/* Trigger PHR when timers exires */
void phr_proc::timer_expired(uint32_t timer_id)
{
if (!phr_cfg.enabled) {
Warning("PHR: Timer triggered but PHR has been disabled\n");
Warning("PHR: %s timer triggered but PHR has been disabled\n",
timer_id == timer_periodic.id() ? "Periodic" : "Prohibit");
return;
}
if (timer_id == timer_periodic.id()) {