trx_toolkit/clck_gen.py: fix TDMA clock counter wrapping
Change-Id: I157447c7610402f6d62d2b74c9f04fcaa0bc1724
This commit is contained in:
parent
93beb3f5c5
commit
8d19fbef57
|
@ -91,10 +91,6 @@ class CLCKGen:
|
||||||
self.send_clck_ind()
|
self.send_clck_ind()
|
||||||
|
|
||||||
def send_clck_ind(self):
|
def send_clck_ind(self):
|
||||||
# Keep clock cycle
|
|
||||||
if self.clck_src % GSM_HYPERFRAME >= 0:
|
|
||||||
self.clck_src %= GSM_HYPERFRAME
|
|
||||||
|
|
||||||
# We don't need to send so often
|
# We don't need to send so often
|
||||||
if self.clck_src % self.ind_period == 0:
|
if self.clck_src % self.ind_period == 0:
|
||||||
# Create UDP payload
|
# Create UDP payload
|
||||||
|
@ -107,8 +103,8 @@ class CLCKGen:
|
||||||
# Debug print
|
# Debug print
|
||||||
log.debug(payload.rstrip("\0"))
|
log.debug(payload.rstrip("\0"))
|
||||||
|
|
||||||
# Increase frame count
|
# Increase frame count (modular arithmetic)
|
||||||
self.clck_src += 1
|
self.clck_src = (self.clck_src + 1) % GSM_HYPERFRAME
|
||||||
|
|
||||||
# Just a wrapper for independent usage
|
# Just a wrapper for independent usage
|
||||||
class Application(ApplicationBase):
|
class Application(ApplicationBase):
|
||||||
|
|
Loading…
Reference in New Issue