platform.c 985 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. int platform_init(void)
  12. {
  13. #ifdef RT_USING_LWIP
  14. #ifdef RT_USING_TAPNETIF
  15. tap_netif_hw_init();
  16. #else
  17. pcap_netif_hw_init();
  18. #endif
  19. #endif
  20. #ifdef RT_USING_DFS
  21. /* initialize sd card */
  22. rt_hw_sdcard_init();
  23. #ifdef RT_USING_MTD_NAND
  24. rt_hw_mtd_nand_init();
  25. #endif /* RT_USING_MTD_NAND */
  26. #ifdef RT_USING_MTD_NOR
  27. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  28. #endif /* RT_USING_MTD_NOR */
  29. #endif /* RT_USING_DFS */
  30. return 0;
  31. }
  32. INIT_COMPONENT_EXPORT(platform_init);
  33. int platform_post_init(void)
  34. {
  35. #ifdef PKG_USING_GUIENGINE
  36. {
  37. extern void rt_hw_sdl_start(void);
  38. extern int rtgui_system_server_init(void);
  39. rtgui_system_server_init();
  40. rt_hw_sdl_start();
  41. }
  42. #endif
  43. return 0;
  44. }
  45. INIT_COMPONENT_EXPORT(platform_post_init);