예제 #1
0
int main(void)
{
	int j;
    int i;

    EnableInterrupts;			// enable interrupt
    INIT_ALL_CPIO_CLK;
    flash_protect();           // protect the entire flash

    INIT_CLOCKS_TO_MODULES;    // init clock module	-- need add to APP of uers
    UART_Initialization();     // init UART module -- need add to APP of uers
    NVIC_EnableIRQ(33);       // enable UART1 interrupt -- need add to APP of uers

    APP_LED_INIT;
    init_PIT();				   // init timer
    NVIC_EnableIRQ(48);       // enable PIT timer interrupt

    while(1)
    {
	   if(buff_index==7)
		{
		   buff_index = 0;
		   UpdateAPP();  // update user's application -- need add to the app of user's
		}
    }
    /* Never leave main */
    return 0;
}
예제 #2
0
int main(void)
{   	
	EnableInterrupts;			// enable interrupt 
	
	INIT_ALL_GPIO_CLK;
	
	flash_protect();           // protect the entire flash 
	
	INIT_CLOCKS_TO_MODULES;    // init clock module	-- need add to APP of uers - 2 
	UART_Initialization();     // init UART module -- need add to APP of uers - 3 

	APP_LED_INIT;      
	init_PIT();				   // init timer 
	enable_irq(22);            // enable timer interrupt 

	while(1)
	{
		UpdateAPP();         // update user's application -- need add to the app of user's - 4
	}
}