Use a #define for USB transfer size.
by Martin Ling 2 years 11 months
3418f6e2
Simpify TX loop in the same way as RX loop.
by Martin Ling 2 years 11 months
a943610c
Simplify rx_mode loop and prevent it stalling.
by Martin Ling 2 years 11 months
Simplify rx_mode loop and prevent it stalling.

On rad1o, the UI update could block this loop from running for long
enough that it could stall in a state where neither of the conditions
was met.

Fix this by removing the 'phase' variable, in favour of a counter
tracking the number of bytes that have been scheduled for USB transfer.
Whenever there are enough bytes to schedule the next transfer, do so.

Meanwhile, the M0 count is prevented from wrapping around and clobbering
data not yet sent, because the M0 code monitors the m4_count variable
which is updated as each transfer completes.
0175c2e8
Gain controls: bulleted list (#1113)
by james-pcdf 2 years 11 months
1ed2d3bb
Merge pull request #1119 from grvvy/ci_device_port...
by Michael Ossmann 2 years 11 months
Merge pull request #1119 from grvvy/ci_device_port_change

ci: update target device's changed port number
74c36002
ci: update target device's changed port number
by grvvy 2 years 11 months
53e076e9
Do dB ratio check BEFORE it's used
by colt 2 years 11 months
b47a808e
Fix #902 - Report transmit amplitude
by colt 2 years 11 months
151b431c
Lock the whole code block that touches active tran...
by Martin Ling 2 years 12 months
Lock the whole code block that touches active transfer count.

I believe this was safe before, because this code is only called from
the transfer thread, and the condition being protected is just whether
the count is zero, not the actual value of the count.

However, this isn't performance critical and it's a lot easier to
reason about the code if we just hold the lock for this whole section.
0724bd36
Replace per-transfer flags with a count of active ...
by Martin Ling 3 years 2 weeks
Replace per-transfer flags with a count of active transfers.

This simplifies the code required to wait for cancellations to complete.
The condition variable now reflects whether `active_transfers == 0`, and
the associated lock must be held to decrement that count to zero.
743b2c76
Report a bug