board.c 1013 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <rtthread.h>
  15. #include <rthw.h>
  16. #include "sys_common.h"
  17. #include "system.h"
  18. #include "rti.h"
  19. #include "board.h"
  20. #include "drv_uart.h"
  21. #define RTI_INT_VEC 6
  22. void rt_timer_handler(int vector, void* param)
  23. {
  24. rtiREG1->INTFLAG = 8U; /* clear interrupt flag */
  25. rt_tick_increase();
  26. }
  27. void rt_hw_board_init(void)
  28. {
  29. rtiInit();
  30. rt_hw_interrupt_install(RTI_INT_VEC, rt_timer_handler, RT_NULL, "tick");
  31. rt_hw_interrupt_umask(RTI_INT_VEC);
  32. rtiStartCounter(rtiCOUNTER_BLOCK1);
  33. rtiEnableNotification(rtiNOTIFICATION_COMPARE3);
  34. rt_hw_uart_init();
  35. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  36. }