platform.c 756 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <rtthread.h>
  2. #include "board.h"
  3. #include <shell.h>
  4. int platform_init(void)
  5. {
  6. finsh_system_init();
  7. #ifdef RT_USING_LWIP
  8. #ifdef RT_USING_TAPNETIF
  9. tap_netif_hw_init();
  10. #else
  11. pcap_netif_hw_init();
  12. #endif
  13. #endif
  14. #ifdef RT_USING_DFS
  15. /* initialize sd card */
  16. rt_hw_sdcard_init();
  17. #if defined(RT_USING_MTD_NAND)
  18. rt_hw_mtd_nand_init();
  19. #endif
  20. #if defined(RT_USING_MTD_NOR)
  21. sst25vfxx_mtd_init("nor", 0, RT_UINT32_MAX);
  22. #endif
  23. #endif /* RT_USING_DFS */
  24. return 0;
  25. }
  26. int platform_post_init(void)
  27. {
  28. #ifdef PKG_USING_GUIENGINE
  29. {
  30. extern void rt_hw_sdl_start(void);
  31. extern int rtgui_system_server_init(void);
  32. rtgui_system_server_init();
  33. rt_hw_sdl_start();
  34. }
  35. #endif
  36. return 0;
  37. }