1 /*
2  * File      : board.c
3  * This file is part of RT-Thread RTOS
4  * COPYRIGHT (C) 2013, RT-Thread Develop Team
5  *
6  * The license and distribution terms for this file may be
7  * found in the file LICENSE in this distribution or at
8  * http://openlab.rt-thread.com/license/LICENSE
9  *
10  * Change Logs:
11  * Date           Author       Notes
12  * 2013-05-27     Grissiom     port to RM48x50
13  */
14 
15 #include <rtthread.h>
16 #include <rthw.h>
17 
18 #include "sys_common.h"
19 #include "system.h"
20 #include "rti.h"
21 
22 #include "board.h"
23 
24 #include "drv_uart.h"
25 
26 #define RTI_INT_VEC 6
27 
rt_timer_handler(int vector,void * param)28 void rt_timer_handler(int vector, void* param)
29 {
30     rtiREG1->INTFLAG = 8U; /* clear interrupt flag */
31 	rt_tick_increase();
32 }
33 
rt_hw_board_init(void)34 void rt_hw_board_init(void)
35 {
36     rtiInit();
37 
38 	rt_hw_interrupt_install(RTI_INT_VEC, rt_timer_handler, RT_NULL, "tick");
39     rt_hw_interrupt_umask(RTI_INT_VEC);
40 
41     rtiStartCounter(rtiCOUNTER_BLOCK1);
42     rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
43 
44     rt_hw_uart_init();
45     rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
46 }
47 
48