board.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * File : board.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2009-2014, 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. * 2014-08-03 aozima first implementation
  13. */
  14. #include <rthw.h>
  15. #include <rtthread.h>
  16. #include <components.h>
  17. #include "board.h"
  18. /**
  19. * @addtogroup CME_M7
  20. */
  21. /*@{*/
  22. /**
  23. * This is the timer interrupt service routine.
  24. *
  25. */
  26. void SysTick_Handler(void)
  27. {
  28. /* enter interrupt */
  29. rt_interrupt_enter();
  30. rt_tick_increase();
  31. /* leave interrupt */
  32. rt_interrupt_leave();
  33. }
  34. static void idle_hook(void)
  35. {
  36. __WFI();
  37. }
  38. /**
  39. * This function will initial board.
  40. */
  41. void rt_hw_board_init()
  42. {
  43. //rt_thread_idle_sethook(idle_hook);
  44. /* Configure the NVIC Preemption Priority Bits */
  45. NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
  46. SysTick_Config(SYSTEM_CLOCK_FREQ / RT_TICK_PER_SECOND);
  47. rt_components_board_init();
  48. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  49. }
  50. /*@}*/