board.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-12-19 BruceOu first version
  9. */
  10. #include <rthw.h>
  11. #include <rtthread.h>
  12. #include "board.h"
  13. /**
  14. * @brief Configures Vector Table base location.
  15. */
  16. void NVIC_Configuration(void)
  17. {
  18. #ifdef VECT_TAB_RAM
  19. /* Set the Vector Table base location at 0x20000000 */
  20. NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
  21. #else /* VECT_TAB_FLASH */
  22. /* Set the Vector Table base location at 0x08000000 */
  23. NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
  24. #endif
  25. }
  26. /**
  27. * @brief This is the timer interrupt service routine.
  28. */
  29. void SysTick_Handler(void)
  30. {
  31. /* enter interrupt */
  32. rt_interrupt_enter();
  33. rt_tick_increase();
  34. /* leave interrupt */
  35. rt_interrupt_leave();
  36. }
  37. /**
  38. * @brief This function will initial N32G45x board.
  39. */
  40. void rt_hw_board_init()
  41. {
  42. /* NVIC Configuration */
  43. NVIC_Configuration();
  44. /* Configure the SysTick */
  45. SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
  46. /* Call components board initial (use INIT_BOARD_EXPORT()) */
  47. #ifdef RT_USING_COMPONENTS_INIT
  48. rt_components_board_init();
  49. #endif
  50. #ifdef RT_USING_CONSOLE
  51. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  52. #endif
  53. #ifdef BSP_USING_SRAM
  54. rt_system_heap_init((void *)EXT_SRAM_BEGIN, (void *)EXT_SRAM_END);
  55. #else
  56. rt_system_heap_init((void *)HEAP_BEGIN, (void *)HEAP_END);
  57. #endif
  58. }