diff options
author | Leah Rowe <leah@libreboot.org> | 2023-05-16 13:33:00 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2023-05-16 23:11:35 +0100 |
commit | 5d03598b990a638a12ede0f08467bcfda43647d7 (patch) | |
tree | 4b67b2f3b1d435f8dec03c9507b75b1f1d6c05cc /util/spkmodem_recv | |
parent | 63e43819b30c68c59b26c6b1d883545154bad987 (diff) |
util/spkmodem_recv: Purge unused global: amplitude
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/spkmodem_recv')
-rw-r--r-- | util/spkmodem_recv/spkmodem-recv.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/util/spkmodem_recv/spkmodem-recv.c b/util/spkmodem_recv/spkmodem-recv.c index 5f06b3b7..0614d103 100644 --- a/util/spkmodem_recv/spkmodem-recv.c +++ b/util/spkmodem_recv/spkmodem-recv.c @@ -23,9 +23,7 @@ signed short frame[2 * SAMPLES_PER_FRAME]; signed short pulse[2 * SAMPLES_PER_FRAME]; -int ringpos = 0; int f1, f2; -int amplitude = 0; int lp = 0; int ascii_bit = 7; char ascii = 0; @@ -77,14 +75,14 @@ handle_audio(void) void fetch_sample(void) { - amplitude -= abs(frame[ringpos]); + static int ringpos = 0; + f1 -= pulse[ringpos]; f1 += pulse[(ringpos + SAMPLES_PER_FRAME) % (2 * SAMPLES_PER_FRAME)]; f2 -= pulse[(ringpos + SAMPLES_PER_FRAME) % (2 * SAMPLES_PER_FRAME)]; if (fread(frame + ringpos, 1, sizeof(frame[0]), stdin) != sizeof(frame[0])) err(errno = ECANCELED, "Could not read frame."); - amplitude += abs(frame[ringpos]); if (abs(frame[ringpos]) > THRESHOLD) { /* rising/falling edge(pulse) */ pulse[ringpos] = 1; |