platform.c 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifdef RT_USING_LWIP
  15. #ifdef RT_USING_TAPNETIF
  16. tap_netif_hw_init();
  17. #else
  18. pcap_netif_hw_init();
  19. #endif
  20. #endif
  21. #ifdef RT_USING_DFS
  22. /* initialize sd card */
  23. rt_hw_sdcard_init();
  24. #if defined(RT_USING_MTD_NAND)
  25. rt_hw_mtd_nand_init();
  26. #endif
  27. #if defined(RT_USING_MTD_NOR)
  28. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  29. #endif
  30. #endif /* RT_USING_DFS */
  31. return 0;
  32. }
  33. INIT_COMPONENT_EXPORT(platform_init);
  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. }
  46. INIT_COMPONENT_EXPORT(platform_post_init);