Main Page | File List | Globals

main.hcc

00001 
00020 /*
00021  * Set the Clock rate for this domain. 50.0 Mhz is minimally required while
00022  * performing audio tasks.
00023  */
00024 #define PAL_TARGET_CLOCK_RATE 50000000
00025 
00026 /******** System Includes *************/
00027 #include <stdlib.hch>
00028 
00029 #include "pal_master.hch"
00030 
00031 /******** Application Includes ********/
00032 #include "audiodriver.hch"
00033 
00034 
00035 /*
00036  * Request Clockrate. Approximated ClockRate is compiler assigned.
00037  */
00038 static macro expr ClockRate = PAL_ACTUAL_CLOCK_RATE;
00039 
00040 
00041 
00050 void main(void) {
00051         /* Setup Audio I/O Pointers */
00052         macro expr AudioIn  = PalAudioInCT(0);
00053         macro expr AudioOut = PalAudioOutCT(0);
00054 
00055         /*
00056          * Check library versions and Request VideoOutput.
00057          * We need at least Major Version 1 and minor version 2.
00058          */
00059         PalVersionRequire(1, 2);
00060         PalAudioInRequire(1);
00061         PalAudioOutRequire(1);
00062 
00063         /*
00064          * Run The Following main tasks in parallel.
00065          */
00066         par {
00067                 /*
00068                  * Primary task is to 'Run' several hardware simultaniously.
00069                  * Audio I/O needs to be in sync.
00070                  */
00071                 PalAudioInRun(AudioIn, ClockRate);
00072                 PalAudioOutRun(AudioOut, ClockRate);
00073                 
00074                 /* Parallel to our Primary tasks we run the application. */
00075                 seq {
00076                         /* But first we need to enable and initialize the audio. */
00077                         PalAudioInEnable(AudioIn);
00078                         PalAudioOutEnable(AudioOut);
00079                         audio_init(7, LINE_IN, SR_44100);
00080                         par {
00081                                 /*
00082                                  * From here we run the main audio loop.
00083                                  */
00084                                 audio_main();
00085                         }
00086                 }
00087         }
00088 } /* --- main() --- */

Generated on Thu Nov 25 15:40:49 2004 for Graphic Equalizer by  doxygen 1.3.9.1