board.c 954 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2014-08-03 aozima first implementation
  9. */
  10. #include <rthw.h>
  11. #include <rtthread.h>
  12. #include "board.h"
  13. /**
  14. * @addtogroup CME_M7
  15. */
  16. /*@{*/
  17. /**
  18. * This is the timer interrupt service routine.
  19. *
  20. */
  21. void SysTick_Handler(void)
  22. {
  23. /* enter interrupt */
  24. rt_interrupt_enter();
  25. rt_tick_increase();
  26. /* leave interrupt */
  27. rt_interrupt_leave();
  28. }
  29. static void idle_hook(void)
  30. {
  31. __WFI();
  32. }
  33. /**
  34. * This function will initial board.
  35. */
  36. void rt_hw_board_init()
  37. {
  38. //rt_thread_idle_sethook(idle_hook);
  39. /* Configure the NVIC Preemption Priority Bits */
  40. NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
  41. SysTick_Config(SYSTEM_CLOCK_FREQ / RT_TICK_PER_SECOND);
  42. rt_components_board_init();
  43. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  44. }
  45. /*@}*/