void Callback(void *ClientHandle, u32 Event, void *pArg) {
// ClientHandle = 0x12345678
// Event = ADI_FLAG_EVENT_CALLBACK
switch ((ADI_FLAG_ID)pArg) {
case ADI_FLAG_PF1:
}
}
When the callback function is invoked, the
value that is given when the callback is installed (in this case,
the
is the
Event
contains the flag ID that triggered the callback.
Suspending and Resuming Callbacks
If the application needs to temporarily suspend callback processing, the
following fragment illustrates how to do it.
Result = adi_flag_SuspendCallbacks(ADI_FLAG_PF1);
The callback function for that flag is no longer called when the trigger
condition occurs. The following fragment illustrates how to resume call-
back processing.
Result = adi_flag_ResumeCallbacks(ADI_FLAG_PF1);
Now the callback function will again be invoked when the trigger condi-
tion occurs.
Removing Callbacks
If an application no longer needs the callback, it removes the callback with
the following call.
Result = adi_flag_RemoveCallback(ADI_FLAG_PF1);
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
// do processing when PF1 changes state break;
ADI_FLAG_EVENT_CALLBACK
Programmable Flag Service
parameter is the
ClientHandle
value, and the
),
0x12345678
parameter
pArg
7-13
Need help?
Do you have a question about the VisualDSP++ 5.0 and is the answer not in the manual?