Пример #1
0
void main(void)
{
    

	InitPLL ();
	SetupIRQ12 () ;
    // Need to initialize DAI because the sport signals
    // need to be routed
    InitDAI();

    // This function will configure the codec on the kit
    Init1835viaSPI();

    // Finally setup the sport to receive / transmit the data
    InitSPORT();

    interrupt (SIG_SP0,TalkThroughISR);
    interrupt (SIG_IRQ1, Irq1ISR) ;
    interrupt (SIG_IRQ2, Irq2ISR) ;

    // Be in infinite loop and do nothing until done.
    for(;;)
    {
     while(blockReady)
          processBlock(src_pointer[int_cntr]);
    }
    
}
Пример #2
0
Файл: main.c Проект: jo9k/rtap
void main(void)
{
    //Initialize PLL to run at CCLK= 331.776 MHz & SDCLK= 165.888 MHz.
    //SDRAM is setup for use, but cannot be accessed until MSEN bit is enabled

        InitPLL_SDRAM();

	// Initialize the secondary heap
   initializeExtHeap();
	
#ifdef USE_EFFECT
    ptrTheClass = &theClass;
#endif

#ifdef USE_RS232
    theRS232ClassC.initializeRS232Link(uartIND::RS_232_MODE_DEFAULT, &theDispatcherC);
    theDispatcherC.initialize(&theRS232ClassC, &theClass);
	theClass.setBackwardReference(&theDispatcherC);
#endif

    if (ptrTheClass)
    {
    	//ptrTheClass->getNameAlgorithm(hostInfoControl.nameFX);
        ptrTheClass->activateAlgorithm(0);
    }

    // Need to initialize DAI because the sport signals need to be routed
    // before the AD1835 chip is initialized
    InitSRU();

    // This function will configure the codec on the kit
    Init1835viaSPI();

    // Endless procesing loop
    while (hostOnline)
    {
        restartCommand = false;

        // Wait until the fx object is ready
        if (ptrTheClass)
        {
            while (!ptrTheClass->isReadyForProcessingAlgorithm())
            {
                asm("nop;");
            }
        }

        // Start processing
        if (ptrTheClass)
        {
            ptrTheClass->prepareProcessingAlgorithm();
            ptrTheClass->startProcessingAlgorithm();
        }

        inProcessing = true;

        // Setup the sport to receive / transmit the audio I/O data 
        theAccessSportC.InitSPORT();

        // Be in infinite loop and do nothing until done.
        while (inProcessing)
        {
            asm("idle;");
        }
	
        // Set the SPORT into not running sate (no interrupts)
        theAccessSportC.termSPORT();

        if (ptrTheClass)
        {
            ptrTheClass->stopProcessingAlgorithm(1000000);
            ptrTheClass->prepareProcessingAlgorithm();
        }

        // Wait until restart is triggered
        while (!restartCommand)
            asm("nop;");
    }

}