platform.c 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #include <rtthread.h>
  10. #include "board.h"
  11. #include <shell.h>
  12. int platform_init(void)
  13. {
  14. finsh_system_init();
  15. #ifdef RT_USING_LWIP
  16. #ifdef RT_USING_TAPNETIF
  17. tap_netif_hw_init();
  18. #else
  19. pcap_netif_hw_init();
  20. #endif
  21. #endif
  22. #ifdef RT_USING_DFS
  23. /* initialize sd card */
  24. rt_hw_sdcard_init();
  25. #if defined(RT_USING_MTD_NAND)
  26. rt_hw_mtd_nand_init();
  27. #endif
  28. #if defined(RT_USING_MTD_NOR)
  29. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  30. #endif
  31. #endif /* RT_USING_DFS */
  32. return 0;
  33. }
  34. int platform_post_init(void)
  35. {
  36. #ifdef PKG_USING_GUIENGINE
  37. {
  38. extern void rt_hw_sdl_start(void);
  39. extern int rtgui_system_server_init(void);
  40. rtgui_system_server_init();
  41. rt_hw_sdl_start();
  42. }
  43. #endif
  44. return 0;
  45. }