mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-25 07:46:17 +02:00
util/spkmodem_recv: Purge unused global: amplitude
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -23,9 +23,7 @@
|
|||||||
|
|
||||||
signed short frame[2 * SAMPLES_PER_FRAME];
|
signed short frame[2 * SAMPLES_PER_FRAME];
|
||||||
signed short pulse[2 * SAMPLES_PER_FRAME];
|
signed short pulse[2 * SAMPLES_PER_FRAME];
|
||||||
int ringpos = 0;
|
|
||||||
int f1, f2;
|
int f1, f2;
|
||||||
int amplitude = 0;
|
|
||||||
int lp = 0;
|
int lp = 0;
|
||||||
int ascii_bit = 7;
|
int ascii_bit = 7;
|
||||||
char ascii = 0;
|
char ascii = 0;
|
||||||
@@ -77,14 +75,14 @@ handle_audio(void)
|
|||||||
void
|
void
|
||||||
fetch_sample(void)
|
fetch_sample(void)
|
||||||
{
|
{
|
||||||
amplitude -= abs(frame[ringpos]);
|
static int ringpos = 0;
|
||||||
|
|
||||||
f1 -= pulse[ringpos];
|
f1 -= pulse[ringpos];
|
||||||
f1 += pulse[(ringpos + SAMPLES_PER_FRAME) % (2 * SAMPLES_PER_FRAME)];
|
f1 += pulse[(ringpos + SAMPLES_PER_FRAME) % (2 * SAMPLES_PER_FRAME)];
|
||||||
f2 -= 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)
|
if (fread(frame + ringpos, 1, sizeof(frame[0]), stdin)
|
||||||
!= sizeof(frame[0]))
|
!= sizeof(frame[0]))
|
||||||
err(errno = ECANCELED, "Could not read frame.");
|
err(errno = ECANCELED, "Could not read frame.");
|
||||||
amplitude += abs(frame[ringpos]);
|
|
||||||
|
|
||||||
if (abs(frame[ringpos]) > THRESHOLD) { /* rising/falling edge(pulse) */
|
if (abs(frame[ringpos]) > THRESHOLD) { /* rising/falling edge(pulse) */
|
||||||
pulse[ringpos] = 1;
|
pulse[ringpos] = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user