board.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, 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://www.rt-thread.org/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-01-25 Bernard first version
  13. */
  14. #include <rtthread.h>
  15. #include <rthw.h>
  16. #include "board.h"
  17. #include "uart.h"
  18. #include <CMSIS/LPC11xx.h>
  19. #include <CMSIS/core_cm0.h>
  20. #include <CMSIS/system_LPC11xx.h>
  21. /**
  22. * @addtogroup LPC1100
  23. */
  24. /*@{*/
  25. /**
  26. * This is the timer interrupt service routine.
  27. */
  28. void rt_hw_timer_handler()
  29. {
  30. /* enter interrupt */
  31. rt_interrupt_enter();
  32. rt_tick_increase();
  33. /* leave interrupt */
  34. rt_interrupt_leave();
  35. }
  36. /**
  37. * This function will initial sam7s64 board.
  38. */
  39. void rt_hw_board_init()
  40. {
  41. SystemInit();
  42. /* init systick */
  43. SysTick_Config(SystemCoreClock);
  44. /* set pend exception priority */
  45. NVIC_SetPriority(PendSV_IRQn, (1<<__NVIC_PRIO_BITS) - 1);
  46. #ifdef RT_USING_UART
  47. /* init hardware UART device */
  48. rt_hw_uart_init();
  49. #endif
  50. #ifdef RT_USING_CONSOLE
  51. /* set console device */
  52. rt_console_set_device("uart");
  53. #endif
  54. }
  55. /*@}*/