board.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "board.h"
  17. /**
  18. * @addtogroup CME_M7
  19. */
  20. /*@{*/
  21. /**
  22. * This is the timer interrupt service routine.
  23. *
  24. */
  25. void SysTick_Handler(void)
  26. {
  27. /* enter interrupt */
  28. rt_interrupt_enter();
  29. rt_tick_increase();
  30. /* leave interrupt */
  31. rt_interrupt_leave();
  32. }
  33. static void idle_hook(void)
  34. {
  35. __WFI();
  36. }
  37. /**
  38. * This function will initial board.
  39. */
  40. void rt_hw_board_init()
  41. {
  42. //rt_thread_idle_sethook(idle_hook);
  43. /* Configure the NVIC Preemption Priority Bits */
  44. NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
  45. SysTick_Config(SYSTEM_CLOCK_FREQ / RT_TICK_PER_SECOND);
  46. rt_components_board_init();
  47. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  48. }
  49. /*@}*/