board.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 <rthw.h>
  15. #include <rtthread.h>
  16. #include "board.h"
  17. /**
  18. * @addtogroup STM32
  19. */
  20. /*@{*/
  21. /*******************************************************************************
  22. * Function Name : NVIC_Configuration
  23. * Description : Configures Vector Table base location.
  24. * Input : None
  25. * Output : None
  26. * Return : None
  27. *******************************************************************************/
  28. void NVIC_Configuration(void)
  29. {
  30. // NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
  31. }
  32. /**
  33. * This is the timer interrupt service routine.
  34. *
  35. */
  36. void SysTick_Handler(void)
  37. {
  38. /* enter interrupt */
  39. rt_interrupt_enter();
  40. rt_tick_increase();
  41. /* leave interrupt */
  42. rt_interrupt_leave();
  43. }
  44. /**
  45. * This function will initial STM32 board.
  46. */
  47. void rt_hw_board_init()
  48. {
  49. /* NVIC Configuration */
  50. NVIC_Configuration();
  51. /* Configure the SysTick */
  52. SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
  53. //rt_hw_usart_init();
  54. #ifdef RT_USING_CONSOLE
  55. rt_console_set_device(CONSOLE_DEVICE);
  56. #endif
  57. }
  58. /*@}*/