platform.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2012 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. * 2012-12-13 lgnq first implementation
  13. */
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #include "board.h"
  17. #include "cmsis.h"
  18. #ifdef RT_USING_SERIAL
  19. #include "usart.h"
  20. #endif
  21. /**
  22. * @addtogroup LPC4330
  23. */
  24. /*@{*/
  25. /**
  26. * This is the timer interrupt service routine.
  27. */
  28. void SysTick_Handler(void)
  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 initialize the LPC4330 Xplorer board.
  38. */
  39. void rt_hw_board_init(void)
  40. {
  41. Board_Init();
  42. /* Configure the SysTick - Generate interrupt @ 100 Hz*/
  43. SysTick_Config(Chip_Clock_GetRate(CLK_MX_MXCORE) / 100);
  44. #ifdef RT_USING_SERIAL
  45. rt_hw_serial_init();
  46. #ifdef RT_USING_CONSOLE
  47. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  48. #endif
  49. #endif
  50. }
  51. /*@}*/