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.
This commit is contained in:
parent
b642f82390
commit
9b4095d894
|
@ -160,7 +160,7 @@ void dsp_cleanup_sender(euro_t *euro)
|
||||||
fm_demod_exit(&euro->rx_demod);
|
fm_demod_exit(&euro->rx_demod);
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG_DECODER
|
||||||
|
|
||||||
static void tone_decode(euro_t *euro, sample_t *samples, int length)
|
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++) {
|
for (i = 0; i < length; i++) {
|
||||||
/* get frequency */
|
/* get frequency */
|
||||||
f = frequency[i] + (FREQUENCY_MIN + FREQUENCY_MAX) / 2.0;
|
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);
|
if (i == 0) printf("%s %.5f ", debug_amplitude(frequency[i] / (FREQUENCY_MAX - FREQUENCY_MIN) * 2.0), f);
|
||||||
#endif
|
#endif
|
||||||
for (d = 0; dsp_digits[d].digit; d++) {
|
for (d = 0; dsp_digits[d].digit; d++) {
|
||||||
if (f >= dsp_digits[d].frequency - FREQUENCY_TOL && f <= dsp_digits[d].frequency + FREQUENCY_TOL)
|
if (f >= dsp_digits[d].frequency - FREQUENCY_TOL && f <= dsp_digits[d].frequency + FREQUENCY_TOL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_DECODER
|
||||||
if (i == 0) printf("%c\n", dsp_digits[d].digit);
|
if (i == 0) printf("%c\n", dsp_digits[d].digit);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ void dsp_cleanup_sender(fuenf_t *fuenf)
|
||||||
free(fuenf->rx_tone_filter_spl);
|
free(fuenf->rx_tone_filter_spl);
|
||||||
}
|
}
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG_CODER
|
||||||
|
|
||||||
/* receive digits and decode */
|
/* receive digits and decode */
|
||||||
static void digit_decode(fuenf_t *fuenf, sample_t *samples, int length)
|
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) */
|
/* 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;
|
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(frequency[i] / (DIGIT_FREQ_MAX - DIGIT_FREQ_MIN) * 2.0), f);
|
||||||
if (i == 0) printf("%s %.5f ", debug_amplitude(sqrt(a)), sqrt(a));
|
if (i == 0) printf("%s %.5f ", debug_amplitude(sqrt(a)), sqrt(a));
|
||||||
#endif
|
#endif
|
||||||
|
@ -197,12 +197,13 @@ static void digit_decode(fuenf_t *fuenf, sample_t *samples, int length)
|
||||||
|
|
||||||
/* digit lound enough ? */
|
/* digit lound enough ? */
|
||||||
if (a >= RX_MIN_LEVEL * RX_MIN_LEVEL && d < DSP_NUM_DIGITS) {
|
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);
|
if (i == 0 && d < DSP_NUM_DIGITS) printf("digit=%d (%d == no digit detected)", d, DSP_NUM_DIGITS);
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
d = -1;
|
d = -1;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_CODER
|
||||||
|
sffd
|
||||||
if (i == 0) printf("\n");
|
if (i == 0) printf("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -491,7 +492,7 @@ int dsp_setup(fuenf_t *fuenf, const char *rufzeichen, enum fuenf_funktion funkti
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG_CODER
|
||||||
if (funktion == FUENF_FUNKTION_RUF) {
|
if (funktion == FUENF_FUNKTION_RUF) {
|
||||||
LOGP_CHAN(DDSP, LOGL_DEBUG, " -> Adding call signal of %.0f Hz.\n", digit_freq[REPEAT_DIGIT]);
|
LOGP_CHAN(DDSP, LOGL_DEBUG, " -> Adding call signal of %.0f Hz.\n", digit_freq[REPEAT_DIGIT]);
|
||||||
for (i = 0; i < TX_NUM_KANAL; i++) {
|
for (i = 0; i < TX_NUM_KANAL; i++) {
|
||||||
|
|
Loading…
Reference in New Issue