board.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include "tick.h"
  14. #include "drv_uart.h"
  15. void rt_hw_board_init(void)
  16. {
  17. #ifdef RT_USING_HEAP
  18. /* initialize memory system */
  19. rt_system_heap_init(RT_HW_HEAP_BEGIN, RT_HW_HEAP_END);
  20. #endif
  21. /* initalize interrupt */
  22. rt_hw_interrupt_init();
  23. /* init rtthread hardware */
  24. rt_hw_tick_init();
  25. #ifdef RT_USING_SERIAL
  26. rt_hw_uart_init();
  27. #endif
  28. /* Set the shell console output device */
  29. #if defined(RT_USING_CONSOLE) && defined(RT_USING_DEVICE)
  30. rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
  31. #endif
  32. #ifdef RT_USING_COMPONENTS_INIT
  33. rt_components_board_init();
  34. #endif
  35. #ifdef RT_USING_HEAP
  36. /* initialize memory system */
  37. 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);
  38. #endif
  39. }