mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
add endianness check to spkmodem-recv
a bit dirty. should handle this at runtime. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* and decodes them. This is a special type of interface provided
|
||||
* by coreboot and GRUB, for computers that lack serial ports.
|
||||
*
|
||||
* Usage example:
|
||||
* Usage example (NOTE: little endian!):
|
||||
* parec --channels=1 --rate=48000 --format=s16le | ./spkmodem-recv
|
||||
*
|
||||
* Originally provided by GNU GRUB, this version is a heavily
|
||||
@@ -51,6 +51,13 @@
|
||||
|
||||
#define READ_BUF 4096
|
||||
|
||||
/* TODO: handle this at runtime instead (bswap) */
|
||||
#if defined(__BYTE_ORDER__)
|
||||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#error "spkmodem-recv requires little-endian samples"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct decoder_state {
|
||||
signed short frame[MAX_SAMPLES];
|
||||
unsigned char pulse[MAX_SAMPLES];
|
||||
|
||||
Reference in New Issue
Block a user