FreeCalypso > hg > freecalypso-tools
annotate ffstools/tiaud/binstruct.h @ 965:2969032bdfac
fcup-smsend[mult]: fix buglet in K&R C NULL pointer passing
The only 100% safe way to pass a NULL pointer as a function argument
in K&R C is to cast 0 to a pointer type; failing to do so may cause
mysterious bugs (invalid stack frames or garbage in argument registers)
on 64-bit machines. This issue has already been fixed in most of
FC host tools, but I just found some missed spots: passing of NULL UDH
to PDU encoding functions in fcup-smsend[mult] in the case of single
(not concatenated) SMS.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 01 Sep 2023 07:33:51 +0000 |
parents | c458e33060bf |
children |
rev | line source |
---|---|
163
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * The binary structure of /aud/*.cfg audio mode config files |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * written and read by TI's TCS211 firmware is defined here. |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 struct audio_cfg_bin { |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 uint8_t voice_path; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 uint8_t pad1[3]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 uint8_t mic_mode; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 uint8_t pad2[3]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 int8_t mic_bytes[4]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 uint16_t mic_fir[32]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 uint8_t speaker_mode; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 uint8_t pad3[3]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 int8_t speaker_bytes[4]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 uint16_t speaker_fir[32]; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 int8_t sidetone_gain; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 uint8_t pad4[3]; |
834
c458e33060bf
ffstools/tiaud: prep for adding support for new AEC
Mychaela Falconia <falcon@freecalypso.org>
parents:
163
diff
changeset
|
19 uint16_t aec_words[12]; |
163
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 }; |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 |
834
c458e33060bf
ffstools/tiaud: prep for adding support for new AEC
Mychaela Falconia <falcon@freecalypso.org>
parents:
163
diff
changeset
|
22 #define MODE_FILE_SIZE_NEWAEC (sizeof(struct audio_cfg_bin)) |
c458e33060bf
ffstools/tiaud: prep for adding support for new AEC
Mychaela Falconia <falcon@freecalypso.org>
parents:
163
diff
changeset
|
23 #define MODE_FILE_SIZE_OLDAEC (sizeof(struct audio_cfg_bin) - 12) |
c458e33060bf
ffstools/tiaud: prep for adding support for new AEC
Mychaela Falconia <falcon@freecalypso.org>
parents:
163
diff
changeset
|
24 |
163
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 /* mic_mode byte */ |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 #define AUDIO_MICROPHONE_HANDHELD (0) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #define AUDIO_MICROPHONE_HANDFREE (1) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 #define AUDIO_MICROPHONE_HEADSET (2) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 /* speaker_mode byte */ |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #define AUDIO_SPEAKER_HANDHELD (0) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #define AUDIO_SPEAKER_HANDFREE (1) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #define AUDIO_SPEAKER_HEADSET (2) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #define AUDIO_SPEAKER_BUZZER (3) |
568e2a2b49c8
tiaud-decomp utility written
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #define AUDIO_SPEAKER_HANDHELD_HANDFREE (4) |