From 0e8b0c38b5100a0be3c1ce87935fda1daf7f2cb2 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 19 Apr 2019 16:55:25 +0200 Subject: tone: do Q1 and Q2 calculation inside IRQ --- src/common/includes/Audio/tone.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/common/includes') diff --git a/src/common/includes/Audio/tone.h b/src/common/includes/Audio/tone.h index f8f4132..7de1c31 100644 --- a/src/common/includes/Audio/tone.h +++ b/src/common/includes/Audio/tone.h @@ -30,14 +30,6 @@ #define TONE_BUFFER_LEN AUDIO_IN_BUF_LEN -struct tone_detector { - float coef; - float Q1; - float Q2; - - int num_samples_analysed; -}; - void tone_init(void); void tone_detector_enable(int enable); @@ -48,7 +40,10 @@ int tone_1750_status(void); /* The FAX status is 1 if the recently decoded DTMF is the 0-7-* sequence. */ int tone_fax_status(void); -/* Update all tone detection status */ -void tone_detect_push_samples(const int16_t *samples, int len); +/* Must be called by task to do the analysis */ +void tone_do_analysis(void); + +/* Push a sample from the ADC ISR */ +void tone_detect_push_sample_from_irq(const int16_t sample); #endif -- cgit v1.2.3