Update to include basic audio functionality. Compiles. Need to add more debug checking.
This commit is contained in:
45
TeensyDSP/TR.cpp
Normal file
45
TeensyDSP/TR.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
//======================================================================
|
||||
// TR.cpp
|
||||
//======================================================================
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "TR.h"
|
||||
|
||||
UBitxTR TR(DSP);
|
||||
|
||||
void UBitxTR::update(bool cw) {
|
||||
updatePTT();
|
||||
updateVOX();
|
||||
updateKey();
|
||||
|
||||
if (isTX) {
|
||||
// If we are currently transmitting, then ANY T/R release (key
|
||||
// release) will result in exitting transmit... except for VOX
|
||||
// and CAT which can only function as a release if it was enabled.
|
||||
if (pttReleased() || keyReleased() ||
|
||||
(voxEnabled && voxDeactivated()) ||
|
||||
(catEnabled && catDeactivated())) {
|
||||
// first, stop transmitting; then, setup RX audio
|
||||
DBGCMD( setRX() );
|
||||
DBGCMD( dsp.rx() );
|
||||
}
|
||||
} else {
|
||||
if ((pttEnabled && pttPressed()) || (voxEnabled && voxActivated())) {
|
||||
// first, setup TX audio; then, start transmitting (from Mic)
|
||||
DBGCMD( dsp.txMicIn() );
|
||||
DBGCMD( setTX() );
|
||||
} else if (keyEnabled && keyPressed()) {
|
||||
// first, setup TX audio; then, start transmitting (from Line In)
|
||||
DBGCMD( dsp.txLineIn() );
|
||||
DBGCMD( setTX() );
|
||||
} else if (catEnabled && catActivated()) {
|
||||
// first, setup TX audio; then, start transmitting (USB)
|
||||
DBGCMD( dsp.txUSBIn() );
|
||||
DBGCMD( setTX() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// EOF
|
||||
//======================================================================
|
||||
Reference in New Issue
Block a user