Set debugging on a per-file basis.

This commit is contained in:
Jonathan Naylor 2016-03-14 20:24:51 +00:00
parent 7d77f20ee9
commit 037f60ea06
10 changed files with 35 additions and 33 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2009-2015 by Jonathan Naylor G4KLX
* Copyright (C) 2009-2016 by Jonathan Naylor G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,6 +16,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
// #define WANT_DEBUG
#include "Config.h"
#include "Globals.h"
#include "DStarRX.h"
@ -319,7 +321,7 @@ void CDStarRX::processNone(bool bit)
// Exact matching of the frame sync sequence
if (countBits32((m_patternBuffer & FRAME_SYNC_MASK) ^ FRAME_SYNC_DATA) == 0U) {
// DEBUG1("DStarRX: found frame sync in None");
DEBUG1("DStarRX: found frame sync in None");
::memset(m_rxBuffer, 0x00U, DSTAR_FEC_SECTION_LENGTH_BYTES);
m_rxBufferBits = 0U;
@ -371,7 +373,6 @@ void CDStarRX::processHeader(bool bit)
unsigned char header[DSTAR_HEADER_LENGTH_BYTES];
bool ok = rxHeader(m_rxBuffer, header);
if (ok) {
// DEBUG1("DStarRX: header checksum ok");
io.setDecode(true);
serial.writeDStarHeader(header, DSTAR_HEADER_LENGTH_BYTES);
@ -382,8 +383,6 @@ void CDStarRX::processHeader(bool bit)
m_rxState = DSRXS_DATA;
m_dataBits = MAX_SYNC_BITS;
} else {
// DEBUG1("DStarRX: header checksum failed");
// The checksum failed, return to looking for syncs
m_rxState = DSRXS_NONE;
}
@ -401,7 +400,7 @@ void CDStarRX::processData(bool bit)
// Fuzzy matching of the end frame sequences
if (countBits32((m_patternBuffer & END_SYNC_MASK) ^ END_SYNC_DATA) <= END_SYNC_ERRS) {
// DEBUG1("DStarRX: Found end sync in Data");
DEBUG1("DStarRX: Found end sync in Data");
io.setDecode(false);
serial.writeDStarEOT();
@ -440,7 +439,7 @@ void CDStarRX::processData(bool bit)
// We've not seen a data sync for too long, signal RXLOST and change to RX_NONE
m_dataBits--;
if (m_dataBits == 0U) {
// DEBUG1("DStarRX: data sync timed out, lost lock");
DEBUG1("DStarRX: data sync timed out, lost lock");
io.setDecode(false);
serial.writeDStarLost();