Added some more debug code. Compiles.
This commit is contained in:
parent
091f414409
commit
da58606409
|
@ -66,6 +66,8 @@ void UBitxDSP::begin() {
|
||||||
// Rig (Line) Input (RX)
|
// Rig (Line) Input (RX)
|
||||||
audioCtrl.inputSelect(AUDIO_INPUT_LINEIN);
|
audioCtrl.inputSelect(AUDIO_INPUT_LINEIN);
|
||||||
audioCtrl.unmuteLineout();
|
audioCtrl.unmuteLineout();
|
||||||
|
audioCtrl.lineInLevel(5, 5); // RX, TX
|
||||||
|
audioCtrl.lineOutLevel(29, 29); //RX, TX
|
||||||
|
|
||||||
// Mic Input (TX)
|
// Mic Input (TX)
|
||||||
audioCtrl.micGain(0); // TODO: set value
|
audioCtrl.micGain(0); // TODO: set value
|
||||||
|
@ -84,6 +86,9 @@ void UBitxDSP::begin() {
|
||||||
// USB Output (RX)
|
// USB Output (RX)
|
||||||
|
|
||||||
// Rig (Line) Output (TX)
|
// Rig (Line) Output (TX)
|
||||||
|
|
||||||
|
// Default to RX.
|
||||||
|
rx();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UBitxDSP::end() {
|
void UBitxDSP::end() {
|
||||||
|
|
|
@ -445,6 +445,10 @@ const int adcIntervalMillis = ADC_INTERVAL_MS;
|
||||||
// MAIN LOOP
|
// MAIN LOOP
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
int frameCounter = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
//char isProcess = 0; // 0: init, 1: complete ADC sampling, 2: complete FFT
|
//char isProcess = 0; // 0: init, 1: complete ADC sampling, 2: complete FFT
|
||||||
|
@ -469,6 +473,37 @@ void loop()
|
||||||
// TODO: debug output (frame skipping / utilization).
|
// TODO: debug output (frame skipping / utilization).
|
||||||
sinceFrameMillis = 0;
|
sinceFrameMillis = 0;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
// For debugging, output some debug info every 1.0" (40 frames @ 40 Hz).
|
||||||
|
frameCounter++;
|
||||||
|
if (frameCounter % 40 == 0) {
|
||||||
|
Serial.print("DBG: Frame: ");
|
||||||
|
Serial.print(frameCounter);
|
||||||
|
if (isTX) {
|
||||||
|
Serial.print(", Loop State: TX");
|
||||||
|
} else {
|
||||||
|
Serial.print(", Loop State: RX");
|
||||||
|
}
|
||||||
|
if (TR.transmitting()) {
|
||||||
|
Serial.println(", TR State: TX");
|
||||||
|
} else {
|
||||||
|
Serial.println(", TR State: RX");
|
||||||
|
}
|
||||||
|
Serial.print("DBG: S-Meter Raw: ");
|
||||||
|
Serial.print(Sensors.sMeterUnscaled());
|
||||||
|
Serial.print(", S-Meter Scaled: ");
|
||||||
|
Serial.println(scaledSMeter);
|
||||||
|
Serial.print("DBG: VSWR Calc: ");
|
||||||
|
Serial.print(calcVSWR, 2);
|
||||||
|
Serial.print(", VSWR Scaled: ");
|
||||||
|
Serial.print(scaledVSWR);
|
||||||
|
Serial.print(", FWD PWR: ");
|
||||||
|
Serial.print(fwdPower, 2);
|
||||||
|
Serial.print(", REV PWR: ");
|
||||||
|
Serial.println(revPower, 2);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
TR.update();
|
TR.update();
|
||||||
|
|
||||||
if (isTX) {
|
if (isTX) {
|
||||||
|
|
Loading…
Reference in New Issue