aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2024-04-12 16:57:09 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2024-04-12 16:57:09 +0200
commit9b4095d8943b61251759aea81eb3bcfede07c091 (patch)
tree0ac4987c5f7ba8cf8c50e14651855a5f8e49f849
parentb642f82390b678cadf8cd47028ebed3d4c7677ee (diff)
Rename definititions that uses the exact word "DEBUG"
"DEBUG" may be defined, but we don't want to compile eurosignal and fuenf-tone-ruf with debug code.
-rw-r--r--src/eurosignal/dsp.c6
-rw-r--r--src/fuenf/dsp.c11
2 files changed, 9 insertions, 8 deletions
diff --git a/src/eurosignal/dsp.c b/src/eurosignal/dsp.c
index 1e2dc10..619bb90 100644
--- a/src/eurosignal/dsp.c
+++ b/src/eurosignal/dsp.c
@@ -160,7 +160,7 @@ void dsp_cleanup_sender(euro_t *euro)
fm_demod_exit(&euro->rx_demod);
}
-//#define DEBUG
+//#define DEBUG_DECODER
static void tone_decode(euro_t *euro, sample_t *samples, int length)
{
@@ -179,14 +179,14 @@ static void tone_decode(euro_t *euro, sample_t *samples, int length)
for (i = 0; i < length; i++) {
/* get frequency */
f = frequency[i] + (FREQUENCY_MIN + FREQUENCY_MAX) / 2.0;
-#ifdef DEBUG
+#ifdef DEBUG_DECODER
if (i == 0) printf("%s %.5f ", debug_amplitude(frequency[i] / (FREQUENCY_MAX - FREQUENCY_MIN) * 2.0), f);
#endif
for (d = 0; dsp_digits[d].digit; d++) {
if (f >= dsp_digits[d].frequency - FREQUENCY_TOL && f <= dsp_digits[d].frequency + FREQUENCY_TOL)
break;
}
-#ifdef DEBUG
+#ifdef DEBUG_DECODER
if (i == 0) printf("%c\n", dsp_digits[d].digit);
#endif
diff --git a/src/fuenf/dsp.c b/src/fuenf/dsp.c
index 9f3919b..9adf167 100644
--- a/src/fuenf/dsp.c
+++ b/src/fuenf/dsp.c
@@ -161,7 +161,7 @@ void dsp_cleanup_sender(fuenf_t *fuenf)
free(fuenf->rx_tone_filter_spl);
}
-//#define DEBUG
+//#define DEBUG_CODER
/* receive digits and decode */
static void digit_decode(fuenf_t *fuenf, sample_t *samples, int length)
@@ -185,7 +185,7 @@ static void digit_decode(fuenf_t *fuenf, sample_t *samples, int length)
/* get amplitude (a is a sqaure of the amplitude for faster math) */
a = (I[i] * I[i] + Q[i] * Q[i]) * 2.0 * 2.0 / TONE_LEVEL / TONE_LEVEL;
-#ifdef DEBUG
+#ifdef DEBUG_CODER
if (i == 0) printf("%s %.5f ", debug_amplitude(frequency[i] / (DIGIT_FREQ_MAX - DIGIT_FREQ_MIN) * 2.0), f);
if (i == 0) printf("%s %.5f ", debug_amplitude(sqrt(a)), sqrt(a));
#endif
@@ -197,12 +197,13 @@ static void digit_decode(fuenf_t *fuenf, sample_t *samples, int length)
/* digit lound enough ? */
if (a >= RX_MIN_LEVEL * RX_MIN_LEVEL && d < DSP_NUM_DIGITS) {
-#ifdef DEBUG
+#ifdef DEBUG_CODER
if (i == 0 && d < DSP_NUM_DIGITS) printf("digit=%d (%d == no digit detected)", d, DSP_NUM_DIGITS);
#endif
} else
d = -1;
-#ifdef DEBUG
+#ifdef DEBUG_CODER
+ sffd
if (i == 0) printf("\n");
#endif
@@ -491,7 +492,7 @@ int dsp_setup(fuenf_t *fuenf, const char *rufzeichen, enum fuenf_funktion funkti
index++;
}
-#ifndef DEBUG
+#ifndef DEBUG_CODER
if (funktion == FUENF_FUNKTION_RUF) {
LOGP_CHAN(DDSP, LOGL_DEBUG, " -> Adding call signal of %.0f Hz.\n", digit_freq[REPEAT_DIGIT]);
for (i = 0; i < TX_NUM_KANAL; i++) {