mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Refactor FIFO callback.
This commit is contained in:
parent
9ad1e22470
commit
e0f96ffabe
1 changed files with 10 additions and 19 deletions
25
tnc/modem.py
25
tnc/modem.py
|
@ -351,25 +351,16 @@ class RF:
|
||||||
data_in48k = data_in48k[48:]
|
data_in48k = data_in48k[48:]
|
||||||
|
|
||||||
length_x = len(x)
|
length_x = len(x)
|
||||||
|
for data_buffer, receive in [
|
||||||
|
(self.datac0_buffer, True),
|
||||||
|
(self.datac1_buffer, RECEIVE_DATAC1),
|
||||||
|
(self.datac3_buffer, RECEIVE_DATAC3),
|
||||||
|
]:
|
||||||
if (
|
if (
|
||||||
not self.datac0_buffer.nbuffer + length_x
|
not data_buffer.nbuffer + length_x > data_buffer.size
|
||||||
> self.datac0_buffer.size
|
and receive
|
||||||
):
|
):
|
||||||
self.datac0_buffer.push(x)
|
data_buffer.push(x)
|
||||||
|
|
||||||
if (
|
|
||||||
not self.datac1_buffer.nbuffer + length_x
|
|
||||||
> self.datac1_buffer.size
|
|
||||||
and RECEIVE_DATAC1
|
|
||||||
):
|
|
||||||
self.datac1_buffer.push(x)
|
|
||||||
|
|
||||||
if (
|
|
||||||
not self.datac3_buffer.nbuffer + length_x
|
|
||||||
> self.datac3_buffer.size
|
|
||||||
and RECEIVE_DATAC3
|
|
||||||
):
|
|
||||||
self.datac3_buffer.push(x)
|
|
||||||
|
|
||||||
def mkfifo_write_callback(self):
|
def mkfifo_write_callback(self):
|
||||||
"""Support testing by writing the audio data to a pipe."""
|
"""Support testing by writing the audio data to a pipe."""
|
||||||
|
|
Loading…
Reference in a new issue