diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-04-19 16:55:25 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2019-04-19 16:55:25 +0200 |
commit | 0e8b0c38b5100a0be3c1ce87935fda1daf7f2cb2 (patch) | |
tree | 1972fa142bed47a64527779c50c069c12f6bef3e /src/common/includes/Audio | |
parent | 882e3bb1c298343daf66f705bd4036c98c4f4b9f (diff) | |
download | glutte-o-matic-0e8b0c38b5100a0be3c1ce87935fda1daf7f2cb2.tar.gz glutte-o-matic-0e8b0c38b5100a0be3c1ce87935fda1daf7f2cb2.tar.bz2 glutte-o-matic-0e8b0c38b5100a0be3c1ce87935fda1daf7f2cb2.zip |
tone: do Q1 and Q2 calculation inside IRQ
Diffstat (limited to 'src/common/includes/Audio')
-rw-r--r-- | src/common/includes/Audio/tone.h | 15 |
1 files changed, 5 insertions, 10 deletions
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 |