C–– Efficiency
5-52
playing. In some cases speech files can be played to debounce keys. This is
why there is no delay in the main() function. Pressing SW2 calls a function, but
the switch will not be read again until the time has been spoken so there is no
need for a delay there.
Example 5–3. Third Project (C–– with an LCD)
The main difference between this project and the second project is the addition
of an LCD display. The variables storing the time were also changed to an
array of ints instead of separate int variables to demonstrate the use of C––
arrays. This is not the clearest or easiest way to keep track of the time. It was
added as an example of C–– arrays. Multidimensional arrays are not
supported in C––, but the same functionality can be achieved by multiplying
and adding the indices. For example, if an array is defined as:
int a [3*4]; // equivalent to int a [3][4] in C
Then the element at row x column y can be accessed by using index = rowNum
* row + column.
value = a[3*1+0]; // equivalent to value = a[1][0] in C
[Root]
cmm1.asm
cmm1_ram.irx
flags.irx
main.cmm
main.irx
main_ram.irx
mainasm.asm
vroncof2.asm
rtc.rpj
[dsp]
[celp]
celp.irx
celp4.obj
[common]
util.obj
util2.obj
[general]
dsp_var.irx
dsputil.asm
getbits.asm
speak.asm
speak.irx
spk_ram.irx
[melp]