Restoring priority level of output streams to PRIO_BEEP when the stream terminates, made M17Modulator::emitBaseband() wait for effective stream termination before returning when transmission stop is requested. Fixes #76
This commit is contained in:
parent
76be50db61
commit
46c988bdc2
|
|
@ -132,10 +132,12 @@ void M17Modulator::emitBaseband()
|
||||||
outputStream_sync(outStream, true);
|
outputStream_sync(outStream, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if transmission stop is requested
|
// Check if transmission stop is requested, if so stop the output stream
|
||||||
|
// and wait until its effective termination.
|
||||||
if(stopTx == true)
|
if(stopTx == true)
|
||||||
{
|
{
|
||||||
outputStream_stop(outStream);
|
outputStream_stop(outStream);
|
||||||
|
outputStream_sync(outStream, false);
|
||||||
stopTx = false;
|
stopTx = false;
|
||||||
txRunning = false;
|
txRunning = false;
|
||||||
idleBuffer = baseband_buffer;
|
idleBuffer = baseband_buffer;
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,11 @@ static inline void stopTransfer()
|
||||||
// Re-activate "beeps"
|
// Re-activate "beeps"
|
||||||
toneGen_unlockBeep();
|
toneGen_unlockBeep();
|
||||||
|
|
||||||
// Finally, clear flags
|
// Finally, clear flags and restore priority level
|
||||||
running = false;
|
running = false;
|
||||||
reqFinish = false;
|
reqFinish = false;
|
||||||
circularMode = false;
|
circularMode = false;
|
||||||
|
priority = PRIO_BEEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ static Thread *dmaWaiting = 0;
|
||||||
* \internal
|
* \internal
|
||||||
* Stop an ongoing transfer, deactivating timers and DMA stream.
|
* Stop an ongoing transfer, deactivating timers and DMA stream.
|
||||||
*/
|
*/
|
||||||
void stopTransfer()
|
static inline void stopTransfer()
|
||||||
{
|
{
|
||||||
// Stop DMA transfers
|
// Stop DMA transfers
|
||||||
DMA1_Stream5->CR = 0;
|
DMA1_Stream5->CR = 0;
|
||||||
|
|
@ -53,10 +53,11 @@ void stopTransfer()
|
||||||
DAC->CR = DAC_CR_EN1; // Keep only channel 1 active
|
DAC->CR = DAC_CR_EN1; // Keep only channel 1 active
|
||||||
DAC->DHR12R1 = 1365; // Set channel 1 (RTX) to about 1.1V when idle
|
DAC->DHR12R1 = 1365; // Set channel 1 (RTX) to about 1.1V when idle
|
||||||
|
|
||||||
// Clear flags
|
// Clear flags and restore priority level
|
||||||
running = false;
|
running = false;
|
||||||
reqFinish = false;
|
reqFinish = false;
|
||||||
circularMode = false;
|
circularMode = false;
|
||||||
|
priority = PRIO_BEEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue