board.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009 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. * 2009-01-05 Bernard first implementation
  13. */
  14. #include <stdint.h>
  15. #include <rthw.h>
  16. #include <rtthread.h>
  17. #include "board.h"
  18. #include "board_lpc.h"
  19. #include "usart.h"
  20. void _init(void)
  21. {
  22. }
  23. /**
  24. * @brief This function is executed in case of error occurrence.
  25. * @param None
  26. * @retval None
  27. */
  28. void Error_Handler(void)
  29. {
  30. /* USER CODE BEGIN Error_Handler */
  31. /* User can add his own implementation to report the HAL error return state */
  32. while(1)
  33. {
  34. }
  35. /* USER CODE END Error_Handler */
  36. }
  37. /**
  38. * This is the timer interrupt service routine.
  39. *
  40. */
  41. void SysTick_Handler(void)
  42. {
  43. /* enter interrupt */
  44. rt_interrupt_enter();
  45. rt_tick_increase();
  46. /* leave interrupt */
  47. rt_interrupt_leave();
  48. }
  49. /**
  50. * This function will initial LPC8XX board.
  51. */
  52. void rt_hw_board_init()
  53. {
  54. SysTick_Config(SystemCoreClock / RT_TIMER_TICK_PER_SECOND);
  55. #ifdef RT_USING_COMPONENTS_INIT
  56. rt_components_board_init();
  57. #endif
  58. #ifdef RT_USING_CONSOLE
  59. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  60. #endif
  61. }
  62. /*@}*/