Project Name: FlushCallback Project Type: ADSP-BF533 [ ] ADSP-BF537 [X] ADSP-BF561 [ ] Hardware Used: EZ-Kit Buttons and LEDs System Services Components Used: DMA Manager [ ] Deferred Callback Manager [X] Interrupt Manager [X] Timer Module [X] Power Management Module [ ] Flag Module [ ] External Bus Interface Unit Module [ ] Port Module [ ] Example Overview: This example uses general purpose timer 0 and the first button to illustrate how to use the "flush" command to remove ALL ITEMS from the deferred callback queue. When the program starts, it initializes and sets up the interrupt manager, callback manager, and timer manager. It hooks and enables an interrupt for the timer, creates a callback queue using a different interrupt, and uses the timer services to initialize general purpose timer 0. Then the program loops infinitely. Every time the timer expires the timer interrupt handler is called, which posts a callback. The callback routine cycles the LEDs. If the first button on the EZ-Kit board is pressed when the timer interrupt handler is executing, the timer interrupt routine flushes the callback queue and the LEDs may pause briefly. If the button is held down, the LEDs will stop cycling because the timer interrupt handler will continuously flush the callback queue, preventing the callback from executing. File Structure: "./FlushCallback.dpj" - Main project file "./FlushCallback.c" "./ezkitutilities.c" - EZ-Kit utilities source file for Blackfin processors "./ezkitutilities.h" - EZ-Kit utilities include file for Blackfin processors System Configuration: Default settings External connections: None Getting Started: 1) Load Project file "FlushCallback.dpj" 2) Build Project by selecting "Project->Rebuild Project" 3) Select "Debug->Run" 4) Observe the behavior described above. 5) When finished, select "Debug->Halt" to stop the program.