Пример #1
0
int main()
{
	LPC_UART_TypeDef *pUart;
	
	SystemInit();	
	__disable_irq();
	
	uart0_irq_init(); // uart0 interrupt driven, for RTX console
	uart1_init();     // uart1 polling, for debugging
	
#ifdef DEBUG_0
	init_printf(NULL, putc);
#endif // DEBUG_0
	__enable_irq();

	uart1_put_string("COM1> Type a character at COM0 terminal\n\r");

	pUart = (LPC_UART_TypeDef *) LPC_UART0;
	
	//while( 1 ) {
		
		if (g_send_char == 0) {
			/* Enable RBR, THRE is disabled */
			pUart->IER = IER_RLS | IER_RBR;
		} else if (g_send_char == 1) {
			/* Enable THRE, RBR left as enabled */
			pUart->IER = IER_THRE | IER_RLS | IER_RBR;
		}
     
	//}
}
Пример #2
0
void k_rtx_init(void)
{
        __disable_irq();
        uart0_init();
        timer_init(0);
        timer_init(1);
        uart0_irq_init();
        uart1_irq_init();
        memory_init();
        process_init();
        __enable_irq();

	/* start the first process */

        k_release_processor();
}