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
29
tnc/modem.py
29
tnc/modem.py
|
@ -351,25 +351,16 @@ class RF:
|
|||
data_in48k = data_in48k[48:]
|
||||
|
||||
length_x = len(x)
|
||||
if (
|
||||
not self.datac0_buffer.nbuffer + length_x
|
||||
> self.datac0_buffer.size
|
||||
):
|
||||
self.datac0_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)
|
||||
for data_buffer, receive in [
|
||||
(self.datac0_buffer, True),
|
||||
(self.datac1_buffer, RECEIVE_DATAC1),
|
||||
(self.datac3_buffer, RECEIVE_DATAC3),
|
||||
]:
|
||||
if (
|
||||
not data_buffer.nbuffer + length_x > data_buffer.size
|
||||
and receive
|
||||
):
|
||||
data_buffer.push(x)
|
||||
|
||||
def mkfifo_write_callback(self):
|
||||
"""Support testing by writing the audio data to a pipe."""
|
||||
|
|
Loading…
Reference in a new issue