Corrected vpDataOffset, now use ftell to obtain file offset after reading in header and toc. Added better verification that the TOC was actually read.
This commit is contained in:
parent
e09ce7e95a
commit
6b83af622c
|
|
@ -114,13 +114,14 @@ void vpCacheInit(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fseek(voice_prompt_file, 0L, SEEK_SET);
|
fseek(voice_prompt_file, 0L, SEEK_SET);
|
||||||
vpDataOffset += fread((void*)&header, sizeof(header), 1, voice_prompt_file);
|
fread((void*)&header, sizeof(header), 1, voice_prompt_file);
|
||||||
|
|
||||||
if (vpCheckHeader((uint32_t*)&header))
|
if (vpCheckHeader((uint32_t*)&header))
|
||||||
{ // read in the TOC.
|
{ // read in the TOC.
|
||||||
vpDataOffset += fread((void*)&tableOfContents, sizeof(tableOfContents), 1, voice_prompt_file);
|
fread((void*)&tableOfContents, sizeof(tableOfContents), 1, voice_prompt_file);
|
||||||
|
vpDataOffset = ftell(voice_prompt_file);
|
||||||
vpDataIsLoaded = true;
|
if(vpDataOffset == (sizeof(voicePromptsDataHeader_t) + sizeof(tableOfContents)))
|
||||||
|
vpDataIsLoaded = true;
|
||||||
}
|
}
|
||||||
if (vpDataIsLoaded)
|
if (vpDataIsLoaded)
|
||||||
{ // if the hash key is down, set vpLevel to high, if beep or less.
|
{ // if the hash key is down, set vpLevel to high, if beep or less.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue