board.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2006-2024, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024/01/11 flyingcys The first version
  9. */
  10. #include <rthw.h>
  11. #include <rtthread.h>
  12. #include "board.h"
  13. void rt_hw_board_init(void)
  14. {
  15. #ifdef RT_USING_HEAP
  16. /* initialize memory system */
  17. rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
  18. #endif
  19. /* initalize interrupt */
  20. rt_hw_interrupt_init();
  21. /* init rtthread hardware */
  22. rt_hw_tick_init();
  23. #ifdef RT_USING_SERIAL
  24. rt_hw_uart_init();
  25. #endif
  26. /* Set the shell console output device */
  27. #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
  28. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  29. #endif
  30. #ifdef RT_USING_COMPONENTS_INIT
  31. rt_components_board_init();
  32. #endif
  33. #ifdef RT_USING_HEAP
  34. /* initialize memory system */
  35. rt_kprintf("RT_HW_HEAP_BEGIN:%x RT_HW_HEAP_END:%x size: %d\r\n", RT_HW_HEAP_BEGIN, RT_HW_HEAP_END, RT_HW_HEAP_END - RT_HW_HEAP_BEGIN);
  36. #endif
  37. }