Leah Rowe
5d03598b99
util/spkmodem_recv: Purge unused global: amplitude
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
63e43819b3
util/spkmodem_recv: Remove unused variable: pos
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
a0abcb9f53
util/spkmodem_recv: Re-order functions for clarity
...
print_char() is referenced last, so declare it last.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
93cc664254
util/spkmodem_recv: Handle output in new function
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
27866e65fb
util/spkmodem_recv: Re-order prototypes
...
Put them in the same order as declared.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
8b851258e2
util/spkmodem_recv: Rename functions for clarity
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
6c1bf756d3
util/spkmodem_recv: Return errno in main
...
This is a good general practise, to catch errors.
Any errors found can then be handled in code.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
c23806e1f6
util/spkmodem_recv: Use correct printf specifier
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
0cc23b2363
util/spkmodem_recv: Add error handling
...
There was literally no error handling before.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
179323819b
util/spkmodem_recv: Move logic out of main
...
Main should only be a skeletal structure.
Actual logic should always be handled externally.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
3d55429443
util/spkmodem_recv: Rename variable for clarity
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
697ae5e2ca
util/spkmodem_recv: Remove use of static keyword
...
It is entirely superfluous in this program.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
2c12e70cfe
util/spkmodem_recv: Rename variable for clarity
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
5b6f5cb06b
util/spkmodem_recv: Remove space in function calls
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
abc5cfd38c
util/spkmodem_recv: Say frame in English
...
Source code should be written in English.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
e286470432
util/spkmodem_recv: Top-down logic (main on top)
...
Add the appropriate prototype.
Top-down function order is easier to read.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
3722c1e67a
util/spkmodem_recv: simplified pulse check
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
88683b767b
util/spkmodem_recv: Define argc/argv in main
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
83b34e2f48
util/spkmodem_recv: Reduced indentation in loop
...
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
22633e0dc0
util/spkmodem_recv: Use tabs for indentation
...
The GNU indentation style is hard to read.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:11:35 +01:00
Leah Rowe
b496ead7b3
util/spkmodem_recv: Import from coreboot
...
Imported from util/spkmodem_recv at coreboot
revision:
e70bc423f9a2e1d13827f2703efe1f9c72549f20
This is a client for spkmodem, to allow serial
console via PC speaker.
I've decided to import it in lbmk, because I
heavily modified it. The patches will be
applied next.
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-05-16 23:09:42 +01:00