CLK_reconfig
2-54
C Interface
Syntax
status = CLK_reconfig();
Parameters
Void
Return Value
Bool
status
/* FALSE if failed */
Reentrant
yes
Description
This function needs to be called after a call to GBL_setFrequency. It
computes values for the timer period and the prescalar registers using
the new CPU frequency. The new values for the period and prescalar
registers ensure that the CLK interrupt runs at the statically configured
interval in microseconds.
The return value is FALSE if the timer registers cannot accommodate the
current frequency or if some other internal error occurs.
When calling CLK_reconfig outside of main(), you must also call
CLK_stop and CLK_start to stop and restart the timer. Use the following
call sequence:
/* disable interrupts if an interrupt could lead to
another call to CLK_reconfig or if interrupt
processing relies on having a running timer */
HWI_disable() or SWI_disable()
GBL_setFrequency(cpuFreqInKhz);
CLK_stop();
CLK_reconfig();
CLK_start();
HWI_restore() or SWI_enable()
When calling CLK_reconfig from main(), the timer has not yet been
started. (The timer is started as part of BIOS_startup(), which is called
internally after main.) As a result, you can use the following simplified call
sequence in main():
GBL_setFrequency(cpuFreqInKhz);
CLK_reconfig(Void);
Note that GBL_setFrequency does not affect the PLL, and therefore has
no effect on the actual frequency at which the DSP is running. It is used
only to make DSP/BIOS aware of the DSP frequency you are using.
CLK_reconfig
Reset timer period and registers using current CPU frequency