board.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2009-01-05 Bernard first implementation
  9. */
  10. #include <stdint.h>
  11. #include <rthw.h>
  12. #include <rtthread.h>
  13. #include "board.h"
  14. #include "board_lpc.h"
  15. #include "usart.h"
  16. void _init(void)
  17. {
  18. }
  19. /**
  20. * @brief This function is executed in case of error occurrence.
  21. * @param None
  22. * @retval None
  23. */
  24. void Error_Handler(void)
  25. {
  26. /* USER CODE BEGIN Error_Handler */
  27. /* User can add his own implementation to report the HAL error return state */
  28. while(1)
  29. {
  30. }
  31. /* USER CODE END Error_Handler */
  32. }
  33. /**
  34. * This is the timer interrupt service routine.
  35. *
  36. */
  37. void SysTick_Handler(void)
  38. {
  39. /* enter interrupt */
  40. rt_interrupt_enter();
  41. rt_tick_increase();
  42. /* leave interrupt */
  43. rt_interrupt_leave();
  44. }
  45. /**
  46. * This function will initial LPC8XX board.
  47. */
  48. void rt_hw_board_init()
  49. {
  50. SystemCoreClockUpdate();
  51. SysTick_Config(SystemCoreClock / RT_TIMER_TICK_PER_SECOND);
  52. #ifdef RT_USING_COMPONENTS_INIT
  53. rt_components_board_init();
  54. #endif
  55. #ifdef RT_USING_CONSOLE
  56. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  57. #endif
  58. }
  59. /*@}*/