sched,nr: handle case of ssb_periodicity not given

If the parameter ssb_periodicity is not given by higher layers,
the function needs to handle this case. The parameters could be
passed with 0 value, which makes the function crash.

For the time being, if ssb_periodicity is not given, the std value
5 ms will be used.

Signed-off-by: Carlo Galiotto <carlo@srs.io>
master
Carlo Galiotto 3 years ago committed by Andre Puschmann
parent 9d864bbe55
commit fd4b368f71

@ -17,6 +17,8 @@
#define POS_IN_BURST_THIRD_BIT_IDX 2
#define POS_IN_BURST_FOURTH_BIT_IDX 3
#define DEFAULT_SSB_PERIODICITY 5
namespace srsenb {
namespace sched_nr_impl {
@ -47,6 +49,9 @@ void sched_ssb_basic(const slot_point& sl_point, uint32_t ssb_periodicity, ssb_
* 3) Position in Burst 1000
* */
if (ssb_periodicity == 0)
ssb_periodicity = DEFAULT_SSB_PERIODICITY;
uint32_t sl_idx = sl_point.to_uint();
uint32_t ssb_sf_idx = sl_point.to_uint() % ssb_periodicity;

Loading…
Cancel
Save