HP (Hewlett-Packard) EZ-KIT Switch User Manual


 
Getting Started with ADSP-BF548 EZ-KIT Lite 6-9
Using ADSP-BF548 EZ-KIT Lite Keypad and LED Indicator
Each source file that the Project Wizard generates in response to a new
thread type definition in the Kernel tab contains skeleton definitions of
four functions:
An initialization function called when an instance of the thread
type is created by VDK as a boot thread (or by some other thread
in the application)
A termination function called when an instance of the thread type
is destroyed automatically by VDK (or programmatically by the
application)
An error function called by VDK API functions to report an error
condition
A run function called by VDK to start execution of the thread
instance. The thread exists until the run function returns (unless
terminated programmatically)
The
BootThreadType.c file of example 7 adds no extra code to the initial-
ization, termination, or error functions—the default code in the functions
is sufficient for the application. Listing 6-2 shows the code added to the
thread’s run function.
Listing 6-2. BootThreadType’s Run() Function
void
BootThreadType_RunFunction(void **inPtr)
{
bool running = true;
/* get device descriptor for keypad from VDK-style driver */
VDK_DeviceDescriptor keypad_dd =
VDK_OpenDevice(kKeypad, NULL);
/* create thread instance that will display row and */
/* column values on LEDs */
VDK_ThreadID LEDthread = VDK_CreateThread(kLEDThreadType);