mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
util/spkmodem-recv: tidy up pulse decoding
make it clearer about next/old, in the loop. this also improves performance on older systems (cache the values first, don't re-calculate) again, this is GNU code. but you wouldn't know it, in my current version. i forked this from GRUB several years ago and started cleaning it for fun. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -152,10 +152,14 @@ static void
|
||||
decode_pulse(struct decoder_state *st)
|
||||
{
|
||||
size_t n;
|
||||
unsigned char old_ring, old_sep;
|
||||
|
||||
st->freq_data -= st->pulse[st->ringpos];
|
||||
st->freq_data += st->pulse[st->sep_pos];
|
||||
st->freq_separator -= st->pulse[st->sep_pos];
|
||||
old_ring = st->pulse[st->ringpos];
|
||||
old_sep = st->pulse[st->sep_pos];
|
||||
|
||||
st->freq_data -= old_ring;
|
||||
st->freq_data += old_sep;
|
||||
st->freq_separator -= old_sep;
|
||||
|
||||
n = fread(&st->frame[st->ringpos], sizeof(st->frame[0]), 1, stdin);
|
||||
if (n != 1) {
|
||||
|
||||
Reference in New Issue
Block a user