FreeCalypso > hg > freecalypso-tools
changeset 834:c458e33060bf
ffstools/tiaud: prep for adding support for new AEC
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 30 Jul 2021 00:10:13 +0000 |
parents | 625bee54ed34 |
children | 516066ac5bc1 |
files | ffstools/tiaud/binstruct.h ffstools/tiaud/compile.c ffstools/tiaud/decomp.c |
diffstat | 3 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/ffstools/tiaud/binstruct.h Tue Jun 22 02:28:18 2021 +0000 +++ b/ffstools/tiaud/binstruct.h Fri Jul 30 00:10:13 2021 +0000 @@ -16,9 +16,12 @@ uint16_t speaker_fir[32]; int8_t sidetone_gain; uint8_t pad4[3]; - uint16_t aec_words[6]; + uint16_t aec_words[12]; }; +#define MODE_FILE_SIZE_NEWAEC (sizeof(struct audio_cfg_bin)) +#define MODE_FILE_SIZE_OLDAEC (sizeof(struct audio_cfg_bin) - 12) + /* mic_mode byte */ #define AUDIO_MICROPHONE_HANDHELD (0) #define AUDIO_MICROPHONE_HANDFREE (1)
--- a/ffstools/tiaud/compile.c Tue Jun 22 02:28:18 2021 +0000 +++ b/ffstools/tiaud/compile.c Fri Jul 30 00:10:13 2021 +0000 @@ -633,7 +633,7 @@ perror(filename); exit(1); } - write(fd, &bin, sizeof bin); + write(fd, &bin, MODE_FILE_SIZE_OLDAEC); close(fd); }
--- a/ffstools/tiaud/decomp.c Tue Jun 22 02:28:18 2021 +0000 +++ b/ffstools/tiaud/decomp.c Fri Jul 30 00:10:13 2021 +0000 @@ -32,11 +32,11 @@ fprintf(stderr, "%s is not a regular file\n", filename); exit(1); } - if (st.st_size != sizeof(struct audio_cfg_bin)) { + if (st.st_size != MODE_FILE_SIZE_OLDAEC) { fprintf(stderr, "%s has the wrong length\n", filename); exit(1); } - read(fd, &bin, sizeof bin); + read(fd, &bin, MODE_FILE_SIZE_OLDAEC); close(fd); }