From 856ee0bdc094dbd3332e47425f6ba4bd37bb693f Mon Sep 17 00:00:00 2001
From: Kirill Smelkov <kirr@nexedi.com>
Date: Wed, 22 Nov 2023 22:29:27 +0300
Subject: [PATCH] .

---
 software/ors-amarisoft/config/out/enb.cfg | 2 +-
 software/ors-amarisoft/slaplte.jinja2     | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/software/ors-amarisoft/config/out/enb.cfg b/software/ors-amarisoft/config/out/enb.cfg
index 400c5196b..0fe4ff8ea 100644
--- a/software/ors-amarisoft/config/out/enb.cfg
+++ b/software/ors-amarisoft/config/out/enb.cfg
@@ -260,7 +260,7 @@
           bandwidth:    10,
 
           subcarrier_spacing: 30,
-          ssb_nr_arfcn:   522750,
+          ssb_nr_arfcn:   522990,
           ssb_pos_bitmap: "10000000",
 
           root_sequence_index: 2,
diff --git a/software/ors-amarisoft/slaplte.jinja2 b/software/ors-amarisoft/slaplte.jinja2
index 5ada19d45..c554bfc4c 100644
--- a/software/ors-amarisoft/slaplte.jinja2
+++ b/software/ors-amarisoft/slaplte.jinja2
@@ -121,7 +121,9 @@
 {%-   set scs = scs_khz * 1e-3  %}
 {%-   for i in range(10000) %}{# = `while 1` #}
 {%-     set _.fg = nr.get_frequency_by_gscn(_.gscn) %}
-{%-     if _.fg % scs < 1e-5*scs  %}{# == 0 with tolerating fp #}
+{#-     check `fg % scs == 0` with tolerating fp rounding #}
+{%-     set r = (_.fg % scs) / scs  %}
+{%-     if abs(r - round(r)) < 1e-5 %}
 {%-       break %}
 {%-     endif %}
 {%-     set _.gscn = _.gscn - 1 %}
-- 
2.30.9